registered authors login here For more on PMWiki, see pmwiki.org |
Tom, I believe there's an error in the DC motor code on next week's lab. At the top, "motorPin1" is declared, but the rest of the program calls "motor1Pin." I'm also wondering whether "motor2pin" is equal to "motor2Pin." I can't remember whether or not PIC Basic Pro is case sensitive. Whoops, good catch. I fixed the motor1Pin error. PicBasic Pro is not case sensitive, so those two terms are equivalent, yes. I ordered but am still waiting on an H-Bridge so I went ahead and did the lab with a TIP120. My motor takes 3V so I got a AAA adapter at radioshack. Learned something useful about it; The batteries are in series, so it won't work unless you put all the batteries in (in the case of the one i bought, 4). Moreover, the voltage adds up. So I wound up with 6V instead of 1.5. I soddered wires into the + and - sides of one compartment so I could use just one battery and get my 1.5V. Anyway I wrote code to listen to a Potentiometer and only spin the motor within certain ranges of the potentiometer. although silly with one motor, i'd imagine this technique could be used more effectively with several motors controlling the movement of a given device. Like one of thos motorized innertubes that kids ride in while getting shot at with water cannons at coney island (maybe?). Here's my lab/notes: http://www.zenzenarimasen.com/wordpress/?p=42 Alice Did this lab a few weeks ago in a hurry. Fortunately, I only encountered minor bumps. At first I wasn't getting anything to the motor. I didn't have the ports in Tom's code available, so rewired to open ports. That saved me from the error in the code, but i created my own pin mismatch. As soon as that was corrected I was on my way... sort of... I only had 3v motors, so began by borrowing one from rob. unfortunately, the motor would not change directions. Reversing polarity on the motor revealed that it wasn't made to reverse. Next I used a variable resistor to knock down the voltage to a 3v motor. That also only worked in one direction because the pot leg had to be the hot leg. Finally found a proper motor and everything was fine. [[~ot6 | Toshi]} I tried the motor lab several times and finally figured out that my problem was a missing resister with my button to control the motor running forward and backward. Third time was lucky as I revisited the lab for preparation of my final "proximity jacket". I used a small pager motor as I though I might change the direction of the motor based on location of the object in front of the sharp IR sensor. For a small Flash movie of my motor lab, go here: http://www.bamford.net/pComp/motorLab.htm [[~db1409 | David]} |