4-channel R/C
Does anyone have some sample code for a 4-channel R/C? This is what I have but is still acting up.
' ==============================================================================
'
' File......
' Purpose...RC CONTROL OF Unmanned Search And Rescue Vehicle (USARV)
'
' {$STAMP BS2}
' {$PBASIC 2.5}
'
' ==============================================================================
'
' Program Description
'
'Control USARV using 4-Channel R/C
'
'
' I/O Definitions
'
Ch1 PIN 12 ' Channel used to receive up
Ch2 PIN 1 ' Channel used to drive forward
Ch3 PIN 13 ' Channel used to recieve back
Ch4 PIN 2 ' Channel used to drive reverse1
Ch5 PIN 14 ' Channel used to receive LT
Ch6 PIN 3 ' Channel used to steer left
Ch7 PIN 15 ' Cannel used to receive RT
Ch8 PIN 4 ' Channel used to steer right
'
' Program Code|
'
begin:
DO
INPUT Ch1
IF Ch1 THEN OUTPUT Ch2 ELSE LOW Ch2
INPUT Ch3
IF Ch3 THEN OUTPUT Ch4 ELSE LOW Ch4
INPUT Ch5
IF Ch5 THEN OUTPUT Ch6 ELSE LOW Ch6
INPUT Ch7
IF Ch7 THEN OUTPUT Ch8 ELSE LOW Ch8
PAUSE 10
LOOP
' ==============================================================================
'
' File......
' Purpose...RC CONTROL OF Unmanned Search And Rescue Vehicle (USARV)
'
' {$STAMP BS2}
' {$PBASIC 2.5}
'
' ==============================================================================
'
' Program Description
'
'Control USARV using 4-Channel R/C
'
'
' I/O Definitions
'
Ch1 PIN 12 ' Channel used to receive up
Ch2 PIN 1 ' Channel used to drive forward
Ch3 PIN 13 ' Channel used to recieve back
Ch4 PIN 2 ' Channel used to drive reverse1
Ch5 PIN 14 ' Channel used to receive LT
Ch6 PIN 3 ' Channel used to steer left
Ch7 PIN 15 ' Cannel used to receive RT
Ch8 PIN 4 ' Channel used to steer right
'
' Program Code|
'
begin:
DO
INPUT Ch1
IF Ch1 THEN OUTPUT Ch2 ELSE LOW Ch2
INPUT Ch3
IF Ch3 THEN OUTPUT Ch4 ELSE LOW Ch4
INPUT Ch5
IF Ch5 THEN OUTPUT Ch6 ELSE LOW Ch6
INPUT Ch7
IF Ch7 THEN OUTPUT Ch8 ELSE LOW Ch8
PAUSE 10
LOOP
Comments
I assume you are just using the 5V out on the board to power straight to a motor ? That seems like you might overpower the regulator on the board