lil text shuffle tryout
parent
da4c398d7f
commit
82c4d9fc53
@ -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
|
||||
}
|
Loading…
Reference in New Issue