My project is basically a flying craft. It will have 2 modes automatic and manual, toggled with a switch from the transmitter controlled by the user. There will be 3 inputs and 1 output to the motor. The inputs will be 1. The thrust information in the form of PWM, 2. The switch position in PWM form, 3. A IR distance sensor. When the switch is in off position (manual mode), the thrust information input will be flowing through the output. When the switch is in on position (automatic mode) the distance will be sensed from the IR distance sensor and PWM signals will be sent to the output according to the distance measured.
Now the problem which I am facing is, how do I make the UNO board understand, the changes in switch position that are in the form of PWM?
Any other approach to this Auto thrust concept will also be appreciated, but only requirement is at any time I should be able to switch back and forth between the manual and automatic mode.