Thursday, January 20, 2011

wednesday week 2

First off we learned some basics of serial communications and soldered together a RS-232 connector to interface the computer with our breadboard. We recieved a PICKAXE microcontroller and began construction of a basic programming circuit. The first program we wrote was to make a simple flashing LED. Here it is functioning with the logic probe showing the switching between high and low:


and the basic code used:
main:
high 1
pause 1000
low 1
pause 1000
goto main

For the next while I familiarized myself with the BASIC programming language, and wrote some other programs. I learned how to interface input sensors both analog (like a CdS cell) and digital (a momentary switch). The following video shows the program i wrote. It senses variable values from the cds cell between 0 and 255; if the values are above a specified threshold (bright), the one LED lights, if it's below a threshold the other LED will light, and if the values are in between, neither will light.

The last thing I did was to crack open a "Billy Bass" singing,talking toy. I cut the motor wires and rerouted them out of the device so i could acess them easily. I then made a simple program for the PIC to make a spazzing mouth movement. I had the signal from the PIC trigger the base of a larger transistor to switch on and off the motors:

No comments:

Post a Comment