Gripper Test Script

Gripper Test Script

The script will turn the Gripper control servo to its 30° position to make the gripper close and lift, and to its 150° position to make the Gripper paddles lower and open.  If your Gripper does not properly complete both motions, the troubleshooting section (just below this section) has a script you can run while making mechanical adjustments.    

  • Right-click test_gripper_angles_buttons_with_fb360.hex link below, choose Save As, and then save the file to your computer.


Note: The script was created by entering the python script below and adding the and modules to the Project Files as shown in Add modules to your micro:bit.  The Script Name was set to test_gripper_angles_buttons_with_fb360 before saving it as a .hex file as shown in How to Save and Reopen a Script in Python Editor v2.


  • Open the script you just downloaded with the editor.
  • Plug the battery pack’s barrel plug into the cyber:bot board’s barrel jack.
  • Set the cyber:bot board’s PWR switch to 1.
  • Click Connect, then Flash.
  • Set the PWR switch to 0.
  • Disconnect the USB from the cyber:bot robot’s micro:bit module.


Test script: test_gripper_angles_buttons_with_fb360

# test_gripper_angles_buttons_with_fb360

from cyberbot import *

while True:
    if button_b.was_pressed():
        bot(15).servo_angle(30)     # Close gripper & lift
    elif button_a.was_pressed():
        bot(15).servo_angle(150)    # Lower gripper & open    


Gripper Tests

The main purpose of these tests is to verify that the script makes the Gripper paddles complete both the close/lift and lower/open motions.  If it doesn’t do both correctly, try the Troubleshooting section below.

  • Set the PWR switch to 2.
  • Press/release the micro:bit module’s B button and verify that the Gripper paddles close and lift.

  • Press/release the micro:bit module’s A button and verify that the Gripper paddles lower and open.

  • If the Gripper does not complete both the close-lift and lower-open motions, check the Troubleshooting section below.
  • When you are done, set the cyber:bot board’s PWR switch to 0. 
  • To extend battery life, make sure to do this whenever the cyber:bot with Gripper is not in use.