int sensorPin = 2; int sensorValue = 0; void setup() { pinMode(sensorPin, INPUT); Serial.begin(9600); } void loop() { sensorValue = analogRead(sensorPin); if (sensorValue < 2000) { Serial.println("North"); } else if (sensorValue > 2500) { Serial.println("South"); } else { Serial.println("None"); } delay(100); }