More examples

Now that you have learned how to write and save programs to the robot, it is time to explore Yozh capabilities. To help with that, we have provided a number of examples, which can be found in examples folder of the Yozh library you had downloaded previously. Try opening and running them to see what the robot can do.

Below is the list of provided examples (as of Nov 1, 2023):

  • basic_test.py - basic test of robot operation, including OLED display, LEDs, and buttons

  • motor_test.py - testing basic operation of motors and encoders

  • drive_test.py - testing higher-level drive commands, such as go forward for 10cm or turn 90 degrees

  • servo_test.py - testing servos (if you have any attached).

  • imu_test.py - testing IMU

  • pid_test.py - testing PID control of motors

  • distancesensors_test.py - testing operation of front-facing distance sensors

  • linearray_test.py - testing reflectance sensor array

  • line_following.py - following a line (requires a white line 1-3 cm wide, on black background)

  • obstacle_avoidance.py - moving around and using distance sensors to avoid obstacles

All of these examples are amply commented, so it should be easy to understand how the code works and how to modify it.