Advice on codes
WILLQH
Posts: 11
Hi !!
· I have wriiten the following code and will like to seek advice on whether they look functional and correct, before i put it on trial on my airplane.
· Basically what I need the program to do is for the parallax microprocessor to
read in 2 signals from the reciever unit (Channel 2 and 5). If channel 5
is 'Off', the processor will simply pass on the signal read in from
channel 2 to the elevator servo unmodified. On the other hand, if channel 5 is
'On', then the processor will ignore the signal read in from channel 2,
and follow its preset logic to send the necessary signal to the servo.
· Thank you !
Regards
Wilson
· I have wriiten the following code and will like to seek advice on whether they look functional and correct, before i put it on trial on my airplane.
· Basically what I need the program to do is for the parallax microprocessor to
read in 2 signals from the reciever unit (Channel 2 and 5). If channel 5
is 'Off', the processor will simply pass on the signal read in from
channel 2 to the elevator servo unmodified. On the other hand, if channel 5 is
'On', then the processor will ignore the signal read in from channel 2,
and follow its preset logic to send the necessary signal to the servo.
· Thank you !
Regards
Wilson
bs2
5K
Comments
Ryan
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Ryan Clarke
Parallax Tech Support
RClarke@Parallax.com
Towards the very beginning of the program (in the ESC section) I do a check to make sure that I am receiving
a valid 1mS to 2mS signal from the receiver. If the signal is invalid (i.e. not there or out of range) everything
gets turned OFF to prevent a run away car on a mindless mission with it's last known instruction!
Basically you could apply the same technique.....
1) Read the HIGH pulse as well as the LOW pulse
2) Add the HIGH pulse together with the LOW pulse value
3) If the result from #2 is within the proper limits of the frame or "pulse window" from your receiver, then
your input channel is "ON" otherwise consider it "OFF".
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.