|
|
<header>
|
|
|
Microbot Activity
|
|
|
============
|
|
|
</header>
|
|
|
Microbot Lab
|
|
|
==============
|
|
|
|
|
|
<img src="/uploads/80492143ba92533320b400ae1c6a1c00/uwcedar_plain.png" alt="drawing" width="200" style="float:right;width:100px;height:100px;"/>
|
|
|
|
... | ... | @@ -10,11 +8,10 @@ Microbot Activity |
|
|
|
|
|
<p id="top"></p>
|
|
|
|
|
|
|
|
|
## Introduction
|
|
|
# Introduction <a name="introduction"></a>
|
|
|
This lab enables students to learn about communication interception through a hands on approach with Micro:Bots. We will demonstrate the use of radio technology as a means for remote control and the potential for radio wave hijacking. Students will learn the fundamentals of Bluetooth and radio waves through implementation by using one micro:bit as a controller for another micro:bit embedded in a robot.
|
|
|
|
|
|
## Features
|
|
|
# Features
|
|
|
* **Estimated Time: 1 Hour (basic; base lab) - 4 Hours (advanced; enhancements)**
|
|
|
* **Appropriate Grades: 6-12**
|
|
|
* **Topic Alignment** ( **L**imited, **M**edium, **H**igh )
|
... | ... | @@ -45,7 +42,7 @@ This lab enables students to learn about communication interception through a ha |
|
|
| Think Like an Adversary | H |
|
|
|
| Keep It Simple | L |
|
|
|
|
|
|
## Step 0: The Basics
|
|
|
# Step 0: The Basics
|
|
|
* Micro::Bit Coding Options
|
|
|
* [Click here to code with JavaScript/Blocks] (https://makecode.microbit.org)
|
|
|
* [Click here to code with MicroPython](https://python.microbit.org)
|
... | ... | @@ -53,13 +50,13 @@ This lab enables students to learn about communication interception through a ha |
|
|
* [Click here for Micro:Bit radio basics](https://makecode.microbit.org/reference/radio)
|
|
|
|
|
|
|
|
|
## Step 1: Gather Materials
|
|
|
# Step 1: Gather Materials
|
|
|
* Micro::Bit (1 per person / 2 per team)
|
|
|
* Micro-USB Cable
|
|
|
* Battery Pack (Equivalent to two AA batteries)
|
|
|
* Microbot
|
|
|
|
|
|
## Step 2: Get Familiar With Microbots
|
|
|
# Step 2: Get Familiar With Microbots
|
|
|
Radios work by sending and receiving messages over different channels. This allows you to use on Micro:Bit to send messages and another to receive them. In this lab, you will use a Micro:bit as a controller to get user input and then send messages based on those inputs. Then, you will use a second Micro:bit to receive messages from the controller and then control the robot based on those received messages.
|
|
|
|
|
|
Start this lab by going over this basic programming example.
|
... | ... | @@ -72,7 +69,7 @@ The first set of code is for the Micro:Bit controller. This controller waits for |
|
|
|
|
|
The second set of code is for the Micro:Bot robot. This Micro:Bit waits to receive a message. If they receive a "left" message, it tells the robot to go left. If they receive a "right" message, it tells the robot to go right.
|
|
|
|
|
|
## Step 3: Download The Files
|
|
|
# Step 3: Download The Files
|
|
|
* Download (click on) the following file to get started: [MicroBotLab.zip](/uploads/99bcb034cdee9aad07dcc403efcdbe35/MicroBotLab.zip)
|
|
|
|
|
|
* Unzip MicrobotLab.zip (right click on the MicrobotLab.zip and select "extract all". Then, just pick where you want to save your copy of these files). Notice there are three folders/directories in MicrobotLab:
|
... | ... | @@ -83,14 +80,14 @@ The second set of code is for the Micro:Bot robot. This Micro:Bit waits to recei |
|
|
|
|
|
![microbot_files](/uploads/55820c43e18aa35782b09b8757501741/microbot_files.PNG)
|
|
|
|
|
|
## Step 4: Open your editor
|
|
|
# Step 4: Open your editor
|
|
|
* For JavaScript/Blocks, you will use the Micro::Bit online editor: [MakeCode](https://makecode.microbit.org/). Here, you can switch back and forth between JavaScript and Blocks by clicking on the button/slider in the top center of the screen.
|
|
|
|
|
|
![blocks](/uploads/7061a5064100caa0790c714bdb1182c1/blocks.PNG)
|
|
|
|
|
|
* For Python, you can use Mu ([click here to see Mu](https://codewith.mu/)) or the online editor ([click here to get to the online editor](http://python.microbit.org/v/1)).
|
|
|
|
|
|
## Step 5: Get Moto-Bit library
|
|
|
# Step 5: Get Moto-Bit library
|
|
|
* For JavaScript/Blocks, start by selecting the "Advanced" drop down box in the libraries toolbar.
|
|
|
|
|
|
![microbot_lib1](/uploads/8b8abbdeb2a7281e77d469955ce2fa39/microbot_lib1.PNG)
|
... | ... | @@ -107,10 +104,10 @@ You can check to make sure that you have the library by searching for the librar |
|
|
|
|
|
![microbot_lib4](/uploads/50880517646fef4065f781d017771d02/microbot_lib4.PNG)
|
|
|
|
|
|
## Step 6: Programming!
|
|
|
# Step 6: Programming!
|
|
|
1. Partner up
|
|
|
|
|
|
### Complete the Robot Code
|
|
|
## Complete the Robot Code
|
|
|
1. Open the robot base code by:
|
|
|
1. Go to the files you downloaded from above
|
|
|
2. Double-click on the JavaScript or Python folder
|
... | ... | @@ -131,7 +128,7 @@ You can check to make sure that you have the library by searching for the librar |
|
|
* When the command "right" is received over the radio, drive the mototbit right
|
|
|
3. Generate your robot .hex file and flash your robot Micro::Bit. If you don't remember how to flash code to your Micro::Bit, see the instructions [here](how-to-flash).
|
|
|
|
|
|
### Compelete the Controller code
|
|
|
## Compelete the Controller code
|
|
|
1. Open the controller base code by:
|
|
|
1. Go to the files you downloaded from above
|
|
|
2. Double-click on the JavaScript or Python folder. Stick with the same language as you chose for the robot_base
|
... | ... | @@ -448,7 +445,7 @@ You can check to make sure that you have the library by searching for the librar |
|
|
|
|
|
<br></br>
|
|
|
|
|
|
### Test your code
|
|
|
## Test your code
|
|
|
* Your robot should:
|
|
|
* Allow radio group selection on startup and allow locking that radio group in
|
|
|
* wait for commands from the controller
|
... | ... | @@ -457,14 +454,14 @@ You can check to make sure that you have the library by searching for the librar |
|
|
* Allow radio group selection on startup and allow locking that radio group in
|
|
|
* send commands to the robot upon various button presses: a+b is "start" and "stop", a is "left", b is "right"
|
|
|
|
|
|
### Hack
|
|
|
## Hack
|
|
|
* Now try to intercept other robots. Are you able to control another group's robot simply by changing what radio group you set your controller to?
|
|
|
* Are you able to control another group's robot?
|
|
|
* Does your control work with their robot?
|
|
|
|
|
|
|
|
|
|
|
|
## Step 7: Further Exploration
|
|
|
# Step 7: Further Exploration
|
|
|
* Spend some time exploring with your Micro::Bit and see what kind of improvements you can make.
|
|
|
* Can you think of a way to incorporate a reverse function for the microbot?
|
|
|
* What if you needed to push and hold a+b to make it move in a direction?
|
... | ... | |