Skip to content
Parallax Learn

Parallax Learn

  • Welcome
  • Tutorials
        • Tutorial Series head tag

          Tutorial Series
        • Tutorial Series

          The special, classroom-ready series pages are organized collections of tutorials for our most popular hardware and/or languages. The tutorials for each topic are conveniently accessible from a single page, shown in the order it is recommended that they be completed.
        • Robotics Series Head tag

          Robotics Series
        • Robotics Series

          • Artificial Intelligence
          • Cybersecurity: Radio Data tutorialCybersecurity
          • cyber:bot + Python
          • cyber:bot + MakeCode
          • Boe-Bot Tutorial SeriesBoe-Bot
          • Arduino Shield-Bot
          • ActivityBot with C TutorialsActivityBot + C
          • ActivityBot with BlocklyProp Tutorial SeriesActivityBot + BlocklyProp
          • Scribbler 3 Tutorial SeriesScribbler 3
        • Electronics & Programming Series Head tag

          Electronics & Programming Series
          • BS2 Board of Education Tutorial SeriesBS2 Board of Education
          • Propeller C-Language BasicsPropeller C Basics
          • FLiP Try-It Kit C Tutorial SeriesFLiP Try-It Kit + C
          • FLiP Try-It Kit BlocklyProp TutorialsFLiP Try-It Kit + BlocklyProp
          • Badge WX Tutorial SeriesBadge WX
          • Propeller BlocklyProp Basics and ProjectsPropeller BlocklyProp Basics
          • View All Tutorial Series »
        • Browse Tutorials
        • Browse Tutorials

          Individual tutorials sorted by robot or kit, and language.
        • By Robot or Kit
          • ActivityBot
          • SumoBot WX
          • Boe-Bot
          • Shield-Bot
          • cyber:bot
          • Badge WX
          • ELEV-8
          • ARLO
        • By Language
        • By Language

          • Propeller C
          • Arduino
          • BlocklyProp
          • PBASIC
          • Python
          • MakeCode
          • View All Tutorials »
  • Educators
  • Reference
  • Downloads
  • Home
  • All Courses

Tilt-Control Gripper cyber:bot with Feedback 360° Servos

Curriculum

  • 1 Section
  • 18 Lessons
  • Lifetime
Expand all sectionsCollapse all sections
  • Tilt-Control Gripper cyber:bot with Feedback 360° Servos
    18
    • 1.0
      Test and Tune the Gripper
    • 1.1
      Gripper Test Script
    • 1.2
      Gripper Troubleshooting
    • 1.3
      How the Gripper Test Works
    • 1.4
      Automatic Open and Close
    • 1.5
      Go and Get an Object with Speed Control
    • 1.6
      Speed Control Script and Tests
    • 1.7
      How the Speed Control Works
    • 1.8
      More Automation
    • 1.9
      Go and Get an Object with Distance Control
    • 1.10
      Distance Control Script and Tests
    • 1.11
      How the Distance Control Works
    • 1.12
      Automation and Turns
    • 1.13
      Adding Tilt Control
    • 1.14
      Script for the Tilt & Grip cyber:bot with F360 Servos
    • 1.15
      Script for the Tilt & Grip Controller with F360 Servos
    • 1.16
      Tilt Control Tests
    • 1.17
      Project Adjustments

How the Distance Control Works

How cyber_bot_gripper_forward_object_distance_with_fb360 Works

First, the script begins by importing the cyberbot and feedback360 modules as expected. Next, the script starts the feedback360.drive system with drive.connect(). Then, the script enters an endless while True: loop that monitors the micro:bit module’s B button to see if it was pressed.

# cyber_bot_gripper_forward_object_distance_with_fb360

from cyberbot import *
from feedback360 import *

drive.connect()

display.show(Image.ARROW_E)

while True:
    if button_b.was_pressed():
        

If the B button was pressed, the cyber:bot starts by lowering and opening the Gripper.  Next, it rolls forward for half of a wheel turn, then stops.  Then, the script uses bot(15).servo_angle(30) to close the Gripper.  That is followed by sleep(1500) to give the Gripper time to close and lift, and partially to make a slight pause between picking up the object and starting to move.  

       
        display.clear()

        bot(15).servo_angle(150)    # Lower & open gripper
        sleep(1500)

        drive.goto(32, 32)          # Forward 0.5 wheel turn

        bot(15).servo_angle(30)     # Close gripper & lift
        sleep(1500)

 

After lifting the object, this part of the script makes the cyber:bot roll forward 1.5 wheel turns.  Then, it lowers and opens the Gripper, letting go of the object.

        drive.goto(96, 96)          # Forward 1.5 wheel turns

        bot(15).servo_angle(150)    # Lower & open gripper
        sleep(1500)

 

Finally, it backs up half a wheel turn so that the object is no longer between the Gripper paddles.

        drive.goto(-32, -32)        # Backward 0.5 wheel turns

        display.show(Image.ARROW_E)

 


Printer-friendly version
Distance Control Script and Tests
Prev
Automation and Turns
Next

DISCUSSION FORUMS | PARALLAX INC. STORE

About | Terms of Use | Feedback: learn@parallax.com | Copyright©Parallax Inc. 2024

© 2026 Parallax Learn • Built with GeneratePress