I made a red LED flash. The next project was to make a series of 8 LEDs flash – in sequence up and then in sequence down. The programming for this was still simple. It got more complicated when I was playing with the code to make just the green LEDs flash, then just the red. I reprogrammed to all the lights come on, in sequence, then go off again in sequence. That coding was a little more challenging.
Still, I am learning a bit about circuits and I guess I am halfway back to remembering how to code in C.
Next project I think will have some switch built in, so that I can turn the thing on and off. Each of the circuits gets just a little more complicated as does the coding so it is a good learning process.
When I was back in Oz over Christmas I noticed that both Jeffro and Steve were mucking around with some electronics stuff. Now, I’d always had a passing interest. Dad was a plumber and really, electronics can’t be all that different can it? After all, what goes in must come out, mustn’t it?
So, armed with the $89 electronics kit, I started on my road to understanding the vagaries of electronics tonight. It was just a little something to play with after working on a proposal and before sleeping.
I grabbed the bits I needed.
Now to understand what they were. I needed a diode (red or green). That was easy to find. I also needed a 470 ohm resistor (sounds like I know what I am talking about doesn’t it). Now, resistors have bands of colour on them and the combination of colours tells you what size they are. Fortunately my desk lamp has a magnifying glass in the middle of it so it was easier to determine which were the 470 ohm resistors as compared to the 1K and 10K ones.
And so the assembly begins into the breadboard.
Now I know this doesn’t look that complicated. Whack the red LED into the breadboard, run a resistor in series from the negative end of the diode, ground all that from the breadboard to the microcontroller board (that’ll be the black wire) and then connect the active (blue) wire from microcontroller header number 13 back to the positive end of the LED.
Plug it in and it should work. To make life simple, the first project is pre-coded into the microcontroller so if everything has been done correctly, then the LED blinks about once a second for a second.
Easy. I then went into the editor that you can download with this kit and started hacking the code around, changing the blink sequence and so on. What appears below is the final output with a half second blink, half second off, one second on and then one second off.
Now I am looking forward to the next project … controlling 8 LEDs (oh, and I have a couple of painting projects coming up as well).