From: KatJoyWhite Date: Sun, 9 Dec 2012 11:20:31 +0000 (-0800) Subject: Create maracas.ino X-Git-Url: https://git.njae.me.uk/?a=commitdiff_plain;h=46dd832ce56b2070a6fa3fc674f4aeebd336601c;p=miniband.git Create maracas.ino --- diff --git a/arduino/maracas.ino b/arduino/maracas.ino new file mode 100644 index 0000000..a50a53a --- /dev/null +++ b/arduino/maracas.ino @@ -0,0 +1,19 @@ +int newState; +int states[] = {-1,-1}; +const int wait = 500; + +void setup() { + Serial.begin(9600); +} +void loop() { + for (int i = 0; i < 3; i+=2) { + newState = digitalRead(i); + if (newState != states[i]) { + Serial.print(i); + Serial.print(",1023"); + Serial.println(); + states[i] = newState; + delay(wait); + } + } +} \ No newline at end of file