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.
test_gripper_angles_buttons_with_fb360.hex [1]
Note: The script was created by entering the python script below and adding the cyberbot.py and feedback360.py modules to the Project Files as shown in Add modules to your micro:bit [2]. 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 [3].
# test_gripper_angles_buttons_with_fb360 from cyberbot import * display.show(Image.ARROW_E) while True: if button_b.was_pressed(): bot(15).servo_angle(30) # Close gripper & lift display.show(Image.ARROW_W) elif button_a.was_pressed(): bot(15).servo_angle(150) # Lower gripper & open display.show(Image.ARROW_E)
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.
Links
[1] https://learn.parallax.com/sites/default/files/content/cyberbot/GripperF360/Hex/test_gripper_angles_buttons_with_fb360.hex
[2] https://learn.parallax.com/tutorials/robot/cyberbot/add-modules-your-microbit
[3] https://learn.parallax.com/tutorials/robot/cyberbot/how-save-and-reopen-script-python-editor-v2
[4] https://python.microbit.org/v/2