PDA

View Full Version : making speed controller digital


CharlieWilken
02-17-2002, 11:11 PM
Is it possible to wire a speed controller to a digital output. I want to put one of my motors on one of the the digital switches of the joystick and don't need to control speed. Thanks in advance

Adam Krajewski
02-18-2002, 05:17 AM
It's not possible to wire a speed controller to a digital output, but it is possible to create 'digital control' of a speed controller.

For a very nice explaination and complete software, go here (http://www.innovationfirst.com/FIRSTRobotics/pdfs/buttonpwm.pdf) at innovationfirst.com.

Greg McCoy
02-18-2002, 07:05 AM
Yeah, if you don't want the motor going full power when you press the button, you can also just say

if p1_sw_trig = 1 then PWM12 = 150

or something like that. Otherwise just use a spike.

GhettoTech
03-01-2002, 05:01 PM
if p1_sw_trig = 1 then PWM12 = 150

Just a little note. That won't work in PBasic. PBasic's If/Then statemtents include an automatic "Goto."

If p1_sw_trig = 1 then (Goto) is implied



If p1_sw_trig = 0 then skip:
PWM12 = 150
skip:

that would be one way to work around that problem. (Similar to how the PWM limit switches are programed)

Don
03-01-2002, 07:15 PM
Otherwise just use a spike.

If I'm not mistaken, most of the motors are not allowed to be hooked up to a spike. I think you can for one or two of them, but not all.