Dual Independent Arduino Blink
Budget: $10 – $30 USD
I have a small Arduino experiment in mind and I’d like you to write the sketch for it. The board will drive two separate standard LEDs, each following its own blink routine.
• LED 1 follows a “Triadic math” pattern—think of a repeating three-value sequence (for example 120 ms, 240 ms, 360 ms or any other set that clearly shows a 1 : 2 : 3 relationship).
• LED 2 just blinks normally, but both its ON and OFF times should be chosen randomly on each cycle within a sensible range that you set in code.
The two loops must run truly independently, so the timing of one never blocks or distorts the other; the usual non-blocking techniques with millis() or hardware timers are fine. I’m using plain, single-colour 5 mm LEDs on digital pins, no RGB or addressable strips involved.
Deliverable
• A single, well-commented .ino file that compiles on a stock Arduino Uno and demonstrates the two patterns exactly as described.
I’ll consider the job complete once I upload the sketch, see the two LEDs blinking according to their respective rules, and can easily tweak the timing constants in the code comments you provide.
• LED 1 follows a “Triadic math” pattern—think of a repeating three-value sequence (for example 120 ms, 240 ms, 360 ms or any other set that clearly shows a 1 : 2 : 3 relationship).
• LED 2 just blinks normally, but both its ON and OFF times should be chosen randomly on each cycle within a sensible range that you set in code.
The two loops must run truly independently, so the timing of one never blocks or distorts the other; the usual non-blocking techniques with millis() or hardware timers are fine. I’m using plain, single-colour 5 mm LEDs on digital pins, no RGB or addressable strips involved.
Deliverable
• A single, well-commented .ino file that compiles on a stock Arduino Uno and demonstrates the two patterns exactly as described.
I’ll consider the job complete once I upload the sketch, see the two LEDs blinking according to their respective rules, and can easily tweak the timing constants in the code comments you provide.
Related categories:
C Programming
Electronics
Microcontroller
Robotics
Arduino
Circuit Design
Programming
Embedded Systems