Automatic Open and Close

Did You Know: Types of Servos

A standard servo turns to and holds a certain angle in response to a rapid series of timed on/off signals from the cyber:bot board.  This is the kind of servo that controls the Gripper.  The Parallax Standard Servo can turn to and hold positions in the 0° to 180° range.

A continuous rotation servo turns at certain approximate speeds in response to a rapid series of timed on/off signals from the cyber:bot board.  This was the kind of servo that controlled the cyber:bot robot’s wheels before you upgraded them to Feedback 360° servos.  

A feedback servo is a continuous rotation servo that can measure and report its angular position as “feedback.”  The cyber:bot board uses the Feedback 360° servos’ angular position reports to adjust the speed control signals to make them maintain certain speeds and travel certain distances.

Your Turn: Handle with Care Automatically

Instead of you having to hold down the A/B buttons, the script can make the gripper gradually open and close on its own automatically after a button press-release.  Simply put the statements updating the degrees variable and servo degree angle in a while loop that continues while the angle is greater than 30.  A similar loop could also be written for button A that continues while degrees is less than 150.

 

  • Update the test code to make it gradually close and open the Gripper automatically by just pressing and releasing the micro:bit module’s B and A buttons. 
  • Name your updated script test_gripper_angles_buttons_your_turn.