bs2 isn't making the motors move
Sadao Fujiwara-san
Posts: 31
so i bought the what is a microcontroller kit awile back and i finished that up and such. but this year i am doing an event in science olympiad (electric vehicle) the purpose of the event is to make a vehicle that will travel somewhere between 5-10 m. i figured this would be easy ya know just plug the motors into the homework board and be on my merry. well i did all the previously mentioned and the code is correct and the stamp accepts the program but nothing happens. so what happened did i do something wrong? is this a bad idea? what can i do in the next day so that the car is ready for this saturday?
Comments
Are you talking about electric DC motors or servos? If they are motors, then what voltage do they need to run? I'm not familiar with the homework board, but I'm pretty sure the Stamp can only output 5 volts, so if you're using a 9V motor I don't think it'll run.
' Electric Vehicle program electricvehicle.BS2
' By: Tristan Bissinger 1-28-07
' {$STAMP BS2}
' {$PBASIC 2.5}
' objective run car for 5-10m. find target time.
'
' I/O ports ' This lables the I/O ports that the bs2 will use.
fforward PIN 1 ' If this segment was not here the stamp would not
rreverse PIN 0 ' know which ports(pins) to use, it also labels the
lleft PIN 15 ' variables that will be used.
rright PIN 14
'
' Switch to outputs ' This segments tells the bs2 that the variables are
LOW fforward ' all outputs.
LOW rreverse
LOW lleft
LOW rright
'
' Main line ' This is the part progam that makes the little car
HIGH fforward ' go and can be motifide in any way.
PAUSE 5000
LOW fforward
END
You can damage them (the I/O pins) by drawing too much current. Several tutorials like "Industrial Control" have
examples for using a transistor to control a relay or motor or solenoid. You can find this by looking on Parallax's
Downloads page for "Stamps in Class Tutorials".