2WD Robot, ArduinoMega 1280, PanPing sensor problem
First sorry for my English but not good. I want to ask the profis about my robotics problems. :)
I have a 2wd mobile platform. I played with this so many and my old simple codes was working well.
But I decided, I want to upgrade a little bit my "stupid" code which was very good with the fixed ping sensor and some IR sensor but too simple. Than I rebuilded all IR sensor first, and builded a little servo for the PING sensor.
I modificated my code but I don´t understand how can I get a data from the PING sensor when the Servo turned to the left and right direction. ...Maybe I closed to my old code.
Now If the PING is "feel" something than the right+left motor stopped and the pan servo turn left and right. But the data now from the ping sensor is only the last which was from the first time when the Robot stopped.
The board is a DFRobot DFRduino Mega 1280, +2A motor shield, +Solar charger shield. The last is only for powering the logic with Li-Po accu.
The code is made by Arduino v1.0 but nothing special inside.
Here is the code: http://ielektros.de/uploads/robi1.txt
Some picture about the hardware:
Thanks for every help and spent minutes.