top of page

Kishen Group

Public·8 members

What should you do on 26 April

  • First, test the code that I gave you.

  • If the robot movement is wrong, you can adjust the code step by step.

  • Follow the guide below to know which line needs to be changed.

Step 1: Fix reversed motor direction

  • Edit lines 29–32:

  • If all forward movements become reverse, set all to true.

  • If only the right side is reversed, set REV_M3 = true and REV_M4 = true.

  • If only the left side is reversed, set REV_M1 = true and REV_M2 = true.

Step 2: Fix reversed left/right turning

  • Try Step 1 first.

  • If the turning is still reversed, edit lines 109–114:


Step 3: Fix reversed servo left/right scanning

  • Edit lines 50–51 by swapping the values:

Step 4: If the servo scan is too fast

  • Edit lines 50–51 and reduce the scan range.

  • Edit line 53 and increase the waiting time.


Example:


const unsigned long SCAN_SETTLE_MS = 5000;

  • By changing the value 5000 to another number, you can control how long the servo and ultrasonic sensor stay and detect at the front, left, and right.

  • A higher value makes the detection slower and longer.

  • A lower value makes the detection faster and shorter.


15 Views

Copyright © 2026 AUTOBOTIC SDN BHD (Reg. No. 201601042778) (1213720-P). All rights reserved.

bottom of page