Week 6 Lab
I finally had a chance to work on my week 6 lab assignment. I couldn’t get my hands on a H-bridge so I did the next best thing…use a TIP120 which only allowed me to vary the speed of the motor by receiving pause intervals. After finals I was basically broke so I got the cheapest DC motor I could find at Radio Shack, a 1.5 - 3v DC hobby motor.
I got the DC motor to do what it’s supposed to do, which is to spin. The ER room was out of still camera’s so I didn’t have a chance to take any photos but below is the code I used to program my PIC chip.
‘define oscillator @ 4mhz
DEFINE OSC 4
‘ make ports D1 output
output PORTD.1
pause 500 ‘ start program with a half-second delay
main:
high PORTD.1
pause 1000 ‘ turns motor power on for 1 second
low PORTD.1
pause 1000 ‘ turns power off for 1 second
goto main
