]> git.piffa.net Git - arduino/blob - books/ArduinoNextSteps-master/ArduinoNextSteps/sketch_01_05_gibberish/sketch_01_05_gibberish.ino
office
[arduino] / books / ArduinoNextSteps-master / ArduinoNextSteps / sketch_01_05_gibberish / sketch_01_05_gibberish.ino
1 // sketch 01_05_gibberish
2
3 char* messages[] = {
4                "My name is Arduino", 
5                "Buy books by Simon Monk", 
6                "Make something cool with me",
7                "Raspberry Pis are fruity"};
8                
9 void setup()
10 {
11   Serial.begin(9600);
12 }
13
14 void loop()
15 {
16   int delayPeriod = random(2000, 8000);
17   delay(delayPeriod);
18   int messageIndex = random(4);
19   Serial.println(messages[messageIndex]);
20 }