diff --git a/sketches/my_sk_sandra/catdogmouse/catdogmouse.ino b/sketches/my_sk_sandra/catdogmouse/catdogmouse.ino new file mode 100644 index 0000000..4267e17 --- /dev/null +++ b/sketches/my_sk_sandra/catdogmouse/catdogmouse.ino @@ -0,0 +1,45 @@ +/* +*/ +int toggle_2; +int toggle_1; +const byte NUMBER_OF_NAMES = 5; +char *names[NUMBER_OF_NAMES] = { + "BOB0", + "BOB1", + "BOB2", + "BOB3", + "BOB4",}; +void setup() { + // initialize serial communications (for debugging only): + Serial.begin(9600); + +} + + +void loop() { + toggle_2 = analogRead(2); + if (toggle_2 < 250) { + Serial.println(" cat"); + } + +else if(toggle_2 >250 && toggle_2 <500){ + Serial.println(" dog"); + } + +else if(toggle_2 >500 && toggle_2 <750){ + Serial.println(" mouse"); + } + +else if(toggle_2 >750){ + Serial.println(" cockroach"); + } +delay(250); + +{ + randomSeed(analogRead(0)); + Serial.print("Hello "); + Serial.print(names[random(0,NUMBER_OF_NAMES)]); +} + + // delay in between reads for stability +}