Capture RC receiver input with pulsin
Britannicus
Posts: 98
OK,
I know I'm being increadibly dumb here - I'm trying to capture the pulse from an RC receiver on my basic stamp2 - I've rigged the output and coupled the signal wire to port 1, via 470ohm reistor by way of protection.
I've written a very short code just to display (I had hoped) the value of the pulse in - have I wired this wrong ?? I've not wired the other two wires from the receiver figuring all these do is supply power to the servo.
I'm obviously wrong in either my code or my wiring - does anyone have a good example of both I can look at of a simple RC input being captured and displaying the variable value ?? all I get is a stream of ones.
code is like this
' {$STAMP BS2}
' {$PBASIC 2.5}
SIG1 VAR Word ' SETS THE VARIABLE SIG1
PULSIN 1,0,SIG1
MAIN:
DO
DEBUG CR, "I'VE GOT A VALUE of "
DEBUG ? SIG1
PAUSE 260
LOOP
I know I'm being increadibly dumb here - I'm trying to capture the pulse from an RC receiver on my basic stamp2 - I've rigged the output and coupled the signal wire to port 1, via 470ohm reistor by way of protection.
I've written a very short code just to display (I had hoped) the value of the pulse in - have I wired this wrong ?? I've not wired the other two wires from the receiver figuring all these do is supply power to the servo.
I'm obviously wrong in either my code or my wiring - does anyone have a good example of both I can look at of a simple RC input being captured and displaying the variable value ?? all I get is a stream of ones.
code is like this
' {$STAMP BS2}
' {$PBASIC 2.5}
SIG1 VAR Word ' SETS THE VARIABLE SIG1
PULSIN 1,0,SIG1
MAIN:
DO
DEBUG CR, "I'VE GOT A VALUE of "
DEBUG ? SIG1
PAUSE 260
LOOP
Comments
You didn't mention what happens when you try your setup, just that something's happening that you're not happy about. It's important to give enough information when you have a problem. You need to show or describe your entire setup and what happens or doesn't happen when you try something.
Your're both quite right I should have mentioned that I'd connected this to a BOE.
I'm a real novice here, so bear with me please ! Tom's pointed out my real dummy mistake - I'll try that and I'll post again if I'm still struggling
thanks guys