Hi, I just got this (knockoff) arduino today, and wanted to see what I could do with it.
4 hours later (I suck at coding), I’ve finally written some very inefficient code for those flashing lights at crossings. Since I plan on using LEDs for my lights, they tend to just blink on and off. I wanted to recreate the fading effect, where they fade in and out intead of just blinking. And I wanted it to be controlled by a button(which Im sure you can replace with a sensor of sorts).
The final product has a very soft fade in and fade out sequence, and also the lights dont shoot on or cut off, instead they finish the current sequence before turning off.
Im away from all my tools and supplies, so I cobbled together some blue LEDs and manually held a wire to simulate a button. A very poor setup haha
Here’s how they turned out:
Add some sensors, maybe get some gates, and get a speaker for a bell chime and you can have a full system!
All you need for wiring is two LEDs, a few resistors and a button.
Wire the two LEDs into pins 9 and 10 along with their given resistors. Wire the button as shown in this link: https://www.arduino.cc/en/Tutorial/BuiltInExamples/Button
Code: https://drive.google.com/file/d/1zp54-t24x6gKOfvcwQazhVNd6Gv6WHKx/view?usp=sharing