/* Program to test the optical sensor. Sensor connected on port 2. */ void main() { while(!stop_button()) // keep doing this until STOP is pressed { printf("Port 2: %d\n", analog(2)); // print value from port sleep(0.5); // delay to avoid flickering display } }