Im duing a project where I want my roomba robot to drive forward when it
receives a ping from the ultrasonic transmitter.
The speed of the roomba is ditected by the distance from the ultrasonic
transmitter to the ultrasonic receiver.
I’ve made 3 functions to call depending on how far the distance is.
The distance is showed in the serial monitor and I want to use that information
to make the robot drive in the called velocity.
my problem is that I want to define the distance as:
distance = a, where the distance is =
so it will work with my if / else statements
// if (a >= 40 || a <120) // 40 cm or 120 cm
if (a <40)
if (a >120)