Line Follower + Obstacle Detection and stopping for 4wd robot

Hello, I require urgent help in adjusting the code for my 4wd arduino robot for my final year project. Here is how the car works currently:

IR Remote key 1 for Line following mode
IR Remote key 2 for Obstacle Avoidance mode

I want to press key 1 so that my robot is in line following mode but stops upon detecting an obstacle.

SmartCar_Core_20200904.ino (28.4 KB)

MsTimer2.h (353 Bytes)

MsTimer2.cpp (3.09 KB)

ArduinoJson-v6.11.1.h (173 KB)

Hello, I require urgent help in adjusting the code for my 4wd arduino robot for my project. Here is how the car works currently:

IR Remote key 1 for Line following mode
IR Remote key 2 for Obstacle Avoidance mode

(I am using an Arduino Uno)

I want to press key 1 so that my robot is in line following mode but stops upon detecting an obstacle.

SmartCar_Core_20200904.ino (28.4 KB)

I know you need hep put please don't duplicate post! Also you have absolutely given no information on the type of sensors, motors and everything else! Please explain in detail..!

Duplicate topics moved and merged

Cross-posting is against the rules of the forum. The reason is that duplicate posts can waste the time of the people trying to help. Someone might spend 15 minutes (or more) writing a detailed answer on this topic, without knowing that someone else already did the same in the other topic.

Repeated cross-posting will result in a timeout from the forum.

In the future, please take some time to pick the forum board that best suits the topic of your question and then only post once to that forum board. This is basic forum etiquette, as explained in the sticky "How to use this forum - please read." post you will find at the top of every forum board. It contains a lot of other useful information. Please read it.

Thanks in advance for your cooperation.