// This is a simple Arduino program to // read the value of analog pin A0 // initializations void setup() { Serial.begin(9600); // Initialize serial communication pinMode(A0, INPUT); // Set pin A0 as input to program } // A loop to read value of analog pin A0 and print // to the serial monitor in the Arduino IDE void loop() { int value = analogRead(A0); // Read the value from pin A0 char off[] = "Motor OFF"; char on[] = "Motor ON"; if(value < 1000) // POKE 54018,60 "OFF" should return values < 1000 { Serial.println(value); } else // POKE 54018,52 "ON" should return values >= 1000 { Serial.println(value); } delay(3000); // Delay for 1000 milliseconds or 1 second }