Dive Deep into Creativity: Discover, Share, Inspire
New motors and 2 additional batteries are installed on wheeled robot.
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.
KemaLED is a class for controlling a full-color LED indicator. Blinking means radio control mode, constant light - robot mode. There are three colors: Green - the robot rides ahead (no obstacles); Yellow - the robot is stopped; Red - the robot rides back. The blue LED means a rollback from memory.
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.
Arduino sketch for remote control of robot.
Description, designs, sketches and links to used parts: https://vk.com/topic-73778892_35223613