Suggestions on switching from autonomous to manual using RC transmitter

I don't see the point of having your remote turned on to have your robot run in autonomous mode. It sound to me like keeping the light on when you are gone ]:smiley:
I have been working the last few days on how to switch between autonomous and rc on my robot. The way it works now (and I'm pleased about it) is as follows.
Using a transistor I can turn on and off the receiver.
When you turn on the receiver and the transmitter is off you get no pulse (pulsein will timeout and return 0) this way you know the RC transmitter has not been turned on. you can turn the receiver off for a while and go (or stay) in autonomous mode.
If you get a value from pulsein different from 0 you know the RC is on and you can switch or stay in manual mode.
With my receiver, when I switch of the transmitter, the receiver keeps on giving the same value (I guess this is a safety measure most RC's will have). Therefore you can not easily see the rRCc transmitter has been turned off.
That is why I do as follows:
If I get the same signal for to long 1 switch of the receiver; wait long enough for the receiver to switch completely off (15microseconds in my case) and turn it back on.
That is all there is to it.

The code is bad but not to bad :slight_smile:
The main reason why the code is bad is because you can not linger to long in your RC code as you robot (in autonomous mode) may bump into something. This means you have to keep timers for all the actions.

Best regards
Jantje