forward, 18 RGB LEDs turn on blue light; robot moves backward, 18 RGB LEDs turn on red light; turn left, 18 RGB
LEDs turn on purple light; turn right, 18 RGB LEDs turn on yellow light.
2 Measure the distance between the robot and obstacles using an ultrasonic sensor.
3 When the measured distance is greater than 10cm, make use of infrared sensors to detect obstacle at both
sides:
If no detecting obstacles at both sides, robot moves forward; if obstacles are at right side but not left side, robots
turn left; if obstacles are at left side but not right side, robots turn right; if both sides have obstacles, robot will go
back for 0.1 second then turn left.
4 When the measured distance is less than or equal to 10cm, make use of infrared sensors to detect obstacle
at both sides:
If no detecting obstacles at both sides, robot turns left; if obstacles are at right side but not left side, robot turns
left; if obstacles are at left side but not right side, robot turns right; if both sides have obstacles, robot will go back
for 0.1 second then turn left.