I have been working at this for days now and would appreciate any help. I am trying to figure out the code for an obstacle avoidance robot with a HC-SR04 sensor mounted on a servo for scanning.
arduino uno with adafruit motor controller V2.3
mounted on platform with Emgreat geared dc motors.
I use these libraries-
I can make it work without the scanning servo but I really want it to take three distance measurements , left, right and center and react to those measurements.
I have found that the sensor will work without a special library and can work with ultrasonic.h included. It will not work with Ping or New Ping libraries which it seems everyone uses.
I am new to coding so I have been trying to translate and adapt from other code but I the 3 position servo and sensor scan has been too much for me to adapt.
in case it helps, below is the code that is working for me. It does not have a scanning servo.
Thanks for any help.