Calling Subroutines?
Hey guys,
·· I have a program that uses two different inputs #1 joystick and #2 RC radio controller I have two different programs that work with each one to control a servo but I would like to put a switch on it and then control the servos according to what position the·switch is·in. Can I use the·IF THEN , ELSEIF statement to make it call·two different subrotines one with the Joystick VAR or the other with the RC·controller VAR.
Like This?
DO
IF IN0 = 1 THEN
GOSUB Joystick
ELSE
GOSUB RC Controller
LOOP
·· I have a program that uses two different inputs #1 joystick and #2 RC radio controller I have two different programs that work with each one to control a servo but I would like to put a switch on it and then control the servos according to what position the·switch is·in. Can I use the·IF THEN , ELSEIF statement to make it call·two different subrotines one with the Joystick VAR or the other with the RC·controller VAR.
Like This?
DO
IF IN0 = 1 THEN
GOSUB Joystick
ELSE
GOSUB RC Controller
LOOP
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Chris Savage
Parallax Tech Support
csavage@parallax.com