BS2 and RC car Receiver
i do believe i posted something like this before but when i posted it, it wasn't very descriptive.
What im trying to do is have a Receiver for a Futaba Pistol grip controller connected to pin 15 on a BS2 and
then display the "duration" in the debug terminal so i can use it for a pulsout command for a HB25. the code i have is very simple but it doesn't work.....right.
' {$STAMP BS2}
' {$PBASIC 2.5}
time VAR Word
DO
PULSIN 15, 1, time
DEBUG HOME, time
LOOP
when i run the program and i pull the trigger on the controller it displays odd things like:
What im trying to do is have a Receiver for a Futaba Pistol grip controller connected to pin 15 on a BS2 and
then display the "duration" in the debug terminal so i can use it for a pulsout command for a HB25. the code i have is very simple but it doesn't work.....right.
' {$STAMP BS2}
' {$PBASIC 2.5}
time VAR Word
DO
PULSIN 15, 1, time
DEBUG HOME, time
LOOP
when i run the program and i pull the trigger on the controller it displays odd things like:
Comments
Post Edited (Casey Gross) : 1/1/2010 3:02:36 AM GMT
' {$STAMP BS2}
' {$PBASIC 2.5}
time VAR Word
DO
RCTIME 15, 1, time
DEBUG HOME, time
LOOP
but it doesn't seem to work because it still displays those weird little symbols when i try it
' {$STAMP BS2}
' {$PBASIC 2.5}
time VAR Word
DO
RCTIME 15, 1, time
DEBUG HOME, DEC time
LOOP
example: if the joystick was in the all the way down position, it would display "138" in the debug terminal, when i move the joystick to the up position in a fast movement..then numbers would get higher (139,150,160,ect.) but as soon as i stop moving the joystick the number in the debug terminal would go straight to "138".
thanks,
miles. K
would it be like:
IF 15 > 750
THEN GOSUB forward
IF 15 < 750
THEN GOSUB backwards
Thanks,
Miles. K
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
Something like;
PULSIN 15, ThrottleChannelValue
PULSIN 16, SteerChannelValue
PULSOUT Left_HB25, (ThrottleChannelValue + (750 - SteerChannelValue)) MAX 1000
PULSOUT Right_HB25, (ThrottleChannelValue - (750 - SteerChannelValue)) MIN 500
Rich H
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
The Simple Servo Tester, a kit from Gadget Gangster.