Silly Bytes has moved - Silly Bytes se trasladó

28 ago. 2016

TDD (Test-Driven Development) Physical Traffic Light

Robert C. Martin (Uncle Bob) said in a talk:
Imagine you have a button that you can push, it will test your code and if everything is working a green light will come up, but if something is break, a red light will come up [...]
He was of course talking about TDD, but I was bored and get inspired to build this little toy.

Hardware schematics, firmware and host software is available in this Github repo. Along with information on how to compile and use.
This is a physical toy traffic light to be used with software development TDD (and testing in general) tools. It will not boost your productivity nor make you a better programmer or TDD practitioner, but it looks cool :)
Lets explain how it works, it's very simple:



The atmega328p AVR microcontroller is very popular and cheap, but if you buy them on Ebay for example, chances are it comes with an Arduino bootloader, which gets in the way because we can perfectly use the internal oscillator instead of an external 16Mhz crystal. So the first thing is to change de fuses to the default ones: