Settings

Theme

Show HN: Arduino traffic light(table-driven design)

resorte.neocities.org

1 points by chclau 4 months ago · 1 comment · 1 min read

Reader

I started with a very simple Arduino project: two traffic lights controlling a junction (six LEDs).

I refactored it by using arrays and small, modular functions, so it’s easier to read, modify, and extend.

chclauOP 4 months ago

Why refactor the code?: less repetition, clearer intent, easier to change timing/logic by editing a table instead of code paths.

Feedback welcome—especially ideas to extend it.

(This post is part of Resorte, a Spanish magazine (comics, hobbies, technical notes) inspired by Argentina’s legendary Lúpin. If you read Spanish, check it out.)

Keyboard Shortcuts

j
Next item
k
Previous item
o / Enter
Open selected item
?
Show this help
Esc
Close modal / clear selection