How can I specify this task in if ? is this even possible?

int previousReading = analogRead(sensorPin);

otherwise you will probably get a "1" sent when loop() first executes even if the pot has not moved.

However, there's a good chance of getting random "0" and "1" sent continuously because of noise in the analog reading.

1 Like