Add an output device to a microcontroller board and program it to do something

My goal this week was to make an RGB LED array. I started by making the basic RGB LED board, and as usual, it took three attempts to get one that works. The first one wouldn't light when connected to a battery, so I connected it to a FabISP that had its 0 ohm resistor soldered on. My computer immediately cut the power supply to the USB port, claiming it drew too much power. This made me realize the board was working after all and that the problem was with the battery, or more likely, the connecting header. However, even with a fresh battery I couldn't get that board to work, so I made another one. That didn't work either until I asked Toni to connect it to her 0-ohm FabISP, and voila! Apparently Windows PCs are more lenient on the power coming out of their USB ports. I tried the battery again and got it to work this time. Unfortunately, a moment later I accidentally paired the header and battery in the opposite direction, and the board instantly burnt, accompanied by some very impressive smoke effects.

I got this error message programming one of the boards:

	avrdude: verifying ...
	avrdude: verification error, first mismatch at byte 0x0000
	         0x0e != 0xcf
	avrdude: verification error; content mismatch

	avrdude: safemode: lfuse changed! Was 62, and is now 0
	Would you like this fuse to be changed back? [y/n]
							

I made another last board that still works pretty well.

I then milled, stuffed, and programmed the Charlieplex board. Neil's code worked right away. For my final project, I want to use such a matrix to display the level of liquid in the glass, and started adjusting the code for that. Still in the works, I plan to integrate this with the application code I'd write next week. Everything will be posted here once I'm done.

I also compiled a guide on setting up an AVR programming environment and Python, on Windows and Mac.

  • 01
  • 02
  • 03
  • 04
  • 05
  • 06
  • 07

An AVR simulator for debugging I need to check out: MacSim.

A Charlieplexing library for Arduino, which unfortunately is not as good as Neil's C code. To install:

  1. Download, extract, and move into a folder named libraries under your Arduino sketch folder (usually a folder called Arduino in your documents folder).
  2. Note Arduino 1.0 (the version we installed to use ATTiny) had one of its core libraries renamed, so you need make a small change the Charlieplex header code: open Charlieplex.h and replace #include <WProgram.h> with #include <Arduino.h>.