LIGHTS, CAMERA, BUTTON!

back
Sarah Hirschman
M.Arch. 2011

This week was a major challenge for me, since there were so many new vocabulary terms and bits and pieces of software and hardware to figure out.

To the side here, you can see Huang's board, which I successfully programmed with a new alternating blinking program that I wrote (eventually)... Problems with WinAVR, Windows in general, and my board in particular prevented me from programming on my board, though I'm eager to figure out the bug and get it up and running soon!

Thanks to David Cranor's Eagle session, I was happy to have a nice-looking board, which I was able to extend a bit to the right so that my parts fit happily. I went back before milling in order to change the width of each trace to .12 (rather than .16).

Also useful was the command that Jie found "run bom" typed in while in schematic in Eagle, to show the details of the parts on the board... I couldn't figure out how to get it to show the parts I'd added (like the LED, the resistor, and the button), but I'm sure that's not a tough extension.

Here's what my board looked like when exported from Eagle to .png.

I ran through the png_path commands a few times to get some traces that seemed reasonable. I ended up doing 5 contours, since I'd had a mess of a time with the FabISP Programmer earlier.

After becoming accustomed to losing five or six hours at a time trying to mill a board, I went over the CBA, where I was in and out (aside from having to replace the sacrificial layer - it was all bent up!!) in less than a half hour. Superior, by far!

Here's Ann Woods, showing off her many vinyl-cut circuits for this project. She always remembers that safety comes first, hence the glasses.

So after battling it out with my computer, I decided to check out how Huang was coming along on his Mac. Success! I tried to run some commands that were working on his, and apparently my board programmed just fine, which also means that my FabISP is doing an ok job... which means probably my board is busted in some way...

Here's my FabISP and possibly-busted LED-button board canoodling.

So using the same process, I found that I could program and re-program Huang's board with no trouble!

So I played around with programming his board in order to get more familiar with C. Admittedly I was not at all familiar with it before, so this very rudimentary on/off/blink/blink program is a real accomplishment, even if it is on Huang's board.

#define TRUE 1
#define FALSE 0

int main()
{
  //SETUP
  //Button is on PA3
  //LED is PB2

  PORTA= _BV(PA3); //Turn button pullup resistor on
  
  DDRB = _BV(PB2); //Enable output on the LED pin

  //LOOP
  while (TRUE)
    {
if (PINA & _BV(PA3)) //button has not been pushed
{
PORTB = 0; //turn LED off 
}
      else
{
PORTB = _BV(PB2);
_delay_ms(700);
PORTB=0;
_delay_ms(100);
PORTB=_BV(PB2);
_delay_ms(200);
PORTB=0;
_delay_ms(500);
}
    }
}