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
  • Upgrade Your cyber:bot with Feedback 360° Servos

Upgrade Your cyber:bot with Feedback 360° Servos

How the Maneuver Tests Work

Both the cyberbot and feedback360 modules have to be added to the micro:bit file system for the script to work.  In the maneuver tests you just finished, both scripts were included in the .hex file speeds_forward_left_right_backward.hex. Keep in mind that the feedback360 module is not included in .py files for the activities throughout the other cyber:bot tutorials, and would need to be added!

For a reminder on how to add ado that, see Add modules to your micro:bit.  Pro tip: you can always reopen a script that had the modules added and was as a .hex file.  That way, you won’t have to add modules every time.  You can just open a previous app and then give it a new name before you start changing it.  For a refresher on this, see Save & Edit Scripts.

How the speeds_forward_left_right_backward Script Works

Below the name comment, the script imports both the cyberbot and feedback360 modules.

# speeds_forward_left_right_backward

from cyberbot import *
from feedback360 import *

 

A call to drive.connect is required to start the Feedback 360° built into the cyber:bot board.

drive.connect()

 

The drive.speed(64, 64) call starts the Feedback 360° servos turning at 1 turn/second.  Then, sleep(2000) makes sure the wheels continue to turn for 2 seconds.  

drive.speed(64, 64)             # Forward
sleep(2000)

 

The drive.speed(-64, 64) call makes the left servo turn backwards and while the right servo continues to roll forward.  The result is that the cyber:bot turn to the left by rotating in place.  The sleep(1000) makes sure the wheels continue this maneuver for 2 seconds.  

drive.speed(-64, 64)            # Rotate left
sleep(1000)

 

This next bit below is just the turn right version of the previous routine.  

drive.speed(64, -64)            # Rotate right
sleep(1000)

 

Compare this to the first maneuver.  Instead of positive values, it has negative values.  The result is that both wheels reverse.  

drive.speed(-64, -64)           # Backward
sleep(2000)

 

Setting the speeds to zero makes the servos stay still, bringing the cyber:bot to a stop.  

drive.speed(0, 0)

Try This: Going Faster

Try changing the forward and backward speeds to +/- 96.  This should make the cyber:bot roll 1.5x faster!

  • Modify the script as shown below by changing the forward and backward drive speeds.
  • Change the Script Name and comment to speeds_forward_left_right_backward_try_this.
  • Click Save to cownload a copy of your work.
  • Reconnect your cyber:bot to USB.
  • Set the PWR switch to 0
  • Flash the script into the cyber:bot
  • Disconnect the cyber:bot from the USB cable.
  • Set it on the floor and set the PWR switch to 2.
  • Verify that the forward and backward speeds increased.

 

 


Printer-friendly version
Maneuvers with Speed Control
Prev
More Turning Maneuvers
Next

DISCUSSION FORUMS | PARALLAX INC. STORE

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

© 2025 Parallax Learn • Built with GeneratePress