Lab 4 - Analog Out

The Serial Communicator is really helpful for making sure that your variable resistor is working. This part of the lab went well, but the pot I'm using is a little finicky. When the resistence is the highest, sometimes it jumps around a little bit, which obviously throws off the output. You can check that out here. I am going to try making a variable brightness LED with a different kind of pot. Next, I need to crackin on the sound.

View the code for Lab 4 - pot controlled LED - here.
View the code for Lab 4(2) - dim to bright to dim - here.

Tried the sound tonight (2.21.06) but am not hearing a clean sine wave for some reason, here's my code:

' ## DEFINITIONS ##
define osc 4
output portc.3
startProgram var byte

' ## BLINKY TO SHOW PROGRAM START ##

for startprogram = 0 to 3 'this loop shows program is running by
high portd.2 'blinking an LED 4 times on portd.2 (TEST)
pause 500
low portd.2
pause 500
next

' ## MAIN LOOP ##
main:
pause 500
freqout portc.3, 500, 600, 1200
high portd.0
pause 500
low portd.0
goto main


Back


Page last modified February 21, 2006, at 10:38 PM