Hello,
I want to know that how can I make a self driving car with a remote control I am using flysky Ct6b remote controller and I want to switch between self driving and remote control by a push button which is wired with the Arduino board.
I am using Arduino mega and I am using it sensor,servo motor and ultrasonic sensor for my self driving mode I am also using L298N motor driver.
if you already were able to connect the remote to the arduino i would suggest 2 separate "While" loops, one for self driving and the other one just for remote mode.
for that i would add a "digitalread" to the botton pin, if remote is active, it will turn off remote and switch on self-driving, and it'll work as well the other way around
NOTE: The "digitalRead" of the botton should be in both loops, so that no matter what you never stop reading the state of the botton