Polytechnic • Embedded Systems
Blink & Sense
Keep an LED blinking while your controller watches a sensor.
Round 1/6Score: 0
Microcontroller simulator
Arduino-style C++ sketch
Timing idea
Ideal timing model; no switch bounce, electrical noise or hardware scheduling overhead.
Configure the loop
Timing method
Blink period—
Sensor response—
Live plot
The idea
The loop() function repeats for as long as the board runs. delay() prevents other code from executing while waiting. millis() allows the programme to check the clock and sensor repeatedly without blocking.