// State-ing Serial is on 115200. void setup() { Serial.begin(115200); } // Starting the loop void. This runs for infinty. void loop() { // Declaring variables and reading the anolog output of each sensor. int TopLeft = analogRead(A0); int TopRight = analogRead(D2); int MiddleTopRight = analogRead(D3); int MiddleTopLeft = analogRead(D4); int MiddleBottomRight = analogRead(D5); int MiddleBottomLeft = analogRead(D6); int BackCenter = analogRead(D7); // Serial printing each sensors value Serial.println(TopLeft); Serial.println(TopRight); Serial.println(MiddleTopRight); Serial.println(MiddleTopLeft); Serial.println(MiddleBottomRight); Serial.println(MiddleBottomLeft); Serial.println(BackCenter); // Checking if a sensor is pressed if ( TopLeft > 10 ) { // If a sensor is pressed the machine will result in a serial print output. Serial.println("Top Left is pressed"); }; if ( TopRight > 10 ) { Serial.println("Top Right is pressed"); }; if ( MiddleTopRight > 10 ) { Serial.println("Middle Top Right is pressed"); }; if ( MiddleTopLeft > 10 ) { Serial.println("Middle Top Left is pressed"); }; if ( MiddleBottomRight > 10 ) { Serial.println("Middle Bottom Right is pressed"); }; if ( MiddleBottomLeft > 10 ) { Serial.println("Middle Bottom Left is pressed"); }; if ( BackCenter > 10 ) { Serial.println("Back Center is pressed"); }; // Preventing a Data overload. delay(1000); }