Tethered Terminal Control project
This is a simple tethered application where you type in left and right wheel speeds, and run time in milliseconds, into a terminal. When you press Enter, your text gets parsed and executed by the micro:bit, which then makes the cyber:bot execute the maneuver.
Example Project: terminal_controlled_bot_tethered_intro
- Make sure the cyber:bot’s batteries are connected, and its 3-position switch is set to 2.
- Open a browser with makecode.microbit.org and add the cyber:bot extension to your project.
- Enter this project as terminal_controlled_bot_tethered_intro.
- Flash the project into the micro:bit.
Example Project: terminal_controlled_bot_tethered_intro
Since your cyber:bot is currently tethered, it’s best to use low speeds and short run times. Otherwise, your cyber:bot might try to roll beyond the tether length. In other words, it’ll try to unplug itself from the USB cable, or maybe roll off the table.
- Open a new browser and navigate to Google Chrome Labs Serial Terminal to open the terminal, press connect, and choose your micro:bit.
- Make sure you have the local echo option checked. Click in the terminal and type 25 in response to the Enter right speed: prompt, then press Enter.
- Type 25 in response to the Enter left speed: prompt, then press Enter.
- Type 750 in response to the Enter ms to run: prompt, and press Enter.
- Verify that your cyber:bot rolled forward for about ¾ of a second.
- Next, try -25, -25, and 750. Did it roll backwards?
- Now, try 25, -25, 750. Did it pivot to the right?
- Try 25, 10, 750 for a curving motion.
- Can you make it turn in place left and right?
- Try causing an exception by typing non-digits in response to one of the prompts.
For example, what happens if you type abc and press enter? You will have to press/release the reset button to restart the app.