Embedded Programming
Week 7: Designing, stuffing, programming and debugging a button with an RGB LED


This week our task was to program the board I designed in week 5 to make a button turn on an LED. Since I didn't have a chance to stuff it then, I did that this week.

Since I used an RGB LED, I wanted to have the button turn the LED to red, then green, then blue (just to show its versatility!).



This time, I tried getting all the components on my list first (which worked really well). I taped them to my notebook, but forgot to take the picture until I was halfway done:



I then began stuffing the board and didn't run into any problems. One thing I wanted to practice this week was removing the solder using the solder braid. In the moment, though, I tried to see if I could get through all the pins without needing it and somehow I did. I guess I'll have to wait for later.



As I worked, I used the volt meter to check my connections (especially where traces were close together). This helped me on more than one occasion to know which parts to re-solder.

When it came time to program, I first tried the Atmel ISP mk II just so I could know it wasn't my ISP that was the problem. After following the directions to set up the arduino software here.

I used the default code in the Arduino to piece together the parts of the button as well as the parts of the LED to make it work:


After I realized my board was OK, I then used the FabISP I made in Week 2 to program it. Fortunately that one still worked.



Here is a short video showing the working button:


One problem I had was that the LED would sometimes turn on if my finger touched parts of the board/components. Talking to Charles, it seems that this has to do with the potential changing on the pin I connected the button to (I didn't use a resistor). I couldn't figure out how to turn on the internal pull-up resistor, so I tried hacking the board by adding a 1K resistor to ground. Unfortunately, that screwed up my board (I think because I was in a rush). I am going to keep trying to fix that, however.

Back