I am in the process of building an arduino Tank robot. I am using IR remote to control it. As of right now I have basic control, forward, back, left, right etc. turn LEDs on off, and sound buzzer. I have line following and avoidance modules installed as well. I have 3 basic sketches to perform basic manual control, line following, and avoidance. each one works fine independently of each other. I am trying to figure out how
to incorporate the three into one sketch using the numbered buttons on IR remote to select line tracking,
avoidance, and still have manual control as well. I figured out earlier today how to get the IR hex codes in serial viewer and how to add continuous movement when holding down the four way directional buttons on the remote. I have been trying to merge the basic control sketch with line tracking but cant quite get it. I put the bot on the line to follow but have to continually press the assigned 1 button on remote for it to follow the line.(it should run with one button press until its told to stop or cant negotiate the track.) If i run just the line tracking sketch its fine same as the avoidance sketch. I havn’t even tried to incorporate avoidance yet. I am going to add my basic sketch and the line tracking sketch below in an attachment and my attempted merger of the two.
I am fairly new to arduino language, have some limited python and html. I can usually figure it out if i have examples and stare at it long enough. I sure this build is above my paygrade, but hey I did figure out the above stuff earlier today.
Hardware Genuine arduino uno r3, wifi expansion board esp13 shield, motor driver module, Standard tracking sensor using 2, IR sensor, buzzer sensor, voltage meter, and 1 ultrasonic sensor.