I have made a wifi controlled car. The basic system is when I press a button on my phone, it sends data to the ip address of the esp8266 12e which is connected to my home network and then the data received by the wifi module performs it. For example, when I send 'right' to the esp8266 12e it turns the motor by using the l298n motor driver. Now I want to add the hcsr04 module to the car and when it detects a wall or something it should stop disregarding the data sent to the wifi module. But I went through weeks for searching how to do this and finally i found the code how to do this. I have pasted the code below which has been combined with the original sketch. But the car does not stop when it detects a wall. Please help me??
CAR.ino (5.76 KB)