I decided to post an old project (from 2009) of mine which I made for my kids (and of cause to learn :).
The project is a PCB prototype for a LEGO DUPLO train which uses a 8-bit ATtiny85 microcontroller (still available!) to control the motor, buttons, sensor and produce different train sounds.
The idea was to change the sound to sound a bit more like a steam train than a more modern diesel train. Why? Because it could be done :)
- Starts and stops slowly as an old steam train 🚂
- Have realistic sounds (sound from a real steam train) when the train starts and stops 🔉
- When the train is running there is a sound from a bell and horn (again real steam train sounds) 📣
- When the train is fuelled via the button the horn is heard
- The motor stops if it hits e.g. a wall 💥
- If the train has not been used within 5 seconds it goes into a power save mode 💤
The code was written in Atmed Studio but also compiles with the older CrossPack on Mac OS X.
Happy hacking! :)