From 81d276f57a5fa7c5b3e7652baae90a4838ab7a27 Mon Sep 17 00:00:00 2001 From: Sam Perry Date: Fri, 18 Nov 2016 10:51:13 +0000 Subject: [PATCH] Fully commented arduino sketch --- ArduinoMax/src/sketch.ino | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ArduinoMax/src/sketch.ino b/ArduinoMax/src/sketch.ino index 03cb6f8..5b1bc22 100644 --- a/ArduinoMax/src/sketch.ino +++ b/ArduinoMax/src/sketch.ino @@ -22,17 +22,20 @@ void loop() started = 1; // set the started flag to on } if(started) { // loop once serial data has been received - // Fix inverted pots + // Fix inverted pot values and send to Max for (int i = 0; i < 2; i++){ Serial.print(1024 - analogRead(i)); Serial.print(" "); } + // Sned values for FSRs to Max for (int i = 2; i < pinCount; i++){ Serial.print(analogRead(i)); Serial.print(" "); } + // Print carriage return to signal the end of this chunk of data Serial.println(); - // wait - delay(25); + + // wait 50ms + delay(50); } }