I've added NiMh batteries for motor feeding. Li-ion 650mA is used for arduino and other electronics.
Description, designs, sketches and links to used parts: https://vk.com/topic-73778892_35223613
Test of ultrasonic sensors on wheeled robot.
Description, designs, sketches and links to used parts: https://vk.com/topic-73778892_35223613
KemaState is a class for saving robot status. It records sensor values, speed and rotation, if any. In the sketch for Arduino Mega, two variables of this class are used: current and previous states.
KemaUS is a class for working with ultrasonic sensors. If the distance to the obstacle is more than 30cm, the robot moves forward, the light on the LED indicator is green. At a distance of 15 - 30 cm - it stops, the LED indicator is yellow. When the obstacle approaches less than 15 cm - the robot travels back, the LED indicator is red.
KemaMem is a robot memory class. At each iteration of the loop () , the speed and rotation data are written to the memory, for a total of 3 seconds. The meaning of this memory is to roll back, i.e. If the robot rode forward, then it rolls back, etc.
My wheeled robot is turning around. The power of new motors is enough to do it.
Ultrasonic sensors are mounted on wheeled robot.
Description, designs, sketches and links to used parts: https://vk.com/topic-73778892_35223613