... | ... | @@ -105,9 +105,9 @@ You can check to make sure that you have the library by searching for the librar |
|
|
8. Paste your code into the editor
|
|
|
9. If you are using Blocks, to get back to blocks, you can select the Blocks button in the center-top of the page.
|
|
|
6. Complete the controller base code. You will add channel choosing functionality and send radio commands depending on the buttons pressed:
|
|
|
1. When button a and b are pressed, if the radio channel has not already been set, set it. if the radio channel has already been set, send a "forward" command over the radio
|
|
|
2. When button a is pressed, if the radio group has not been set, decrement the radio group by 1. if the radio group has been set, send a "left" command over the radio
|
|
|
3. When button b is pressed, if the radio group has not been set, increment the radio group by 1. if the radio group has been set, send a "right" command over the radio
|
|
|
1. When button a and b are pressed, if the radio channel has not already been set, set it. if the radio channel has already been set, send a "forward" command over the radio
|
|
|
2. When button a is pressed, if the radio group has not been set, decrement the radio group by 1. if the radio group has been set, send a "left" command over the radio
|
|
|
3. When button b is pressed, if the radio group has not been set, increment the radio group by 1. if the radio group has been set, send a "right" command over the radio
|
|
|
7. Generate your controller .hex file. From your editor, click on the "Download" button in the bottom right hand corner. This will download your .hex file. You can find it in the Downloads folder on your computer.
|
|
|
|
|
|
![download](/uploads/c3c3a26fb266867fc4cbe74a08ab952e/download.PNG)
|
... | ... | @@ -116,7 +116,7 @@ You can check to make sure that you have the library by searching for the librar |
|
|
|
|
|
![flash_py](/uploads/f88092bbd58733b96896c29481a875b1/flash_py.PNG)
|
|
|
|
|
|
5. Flash the robot hex file to one Micro::Bit and the controller hex file to the other. You should be able to choose a radio group on each and lock it in. From there, you should be able to drive your robot using the controller. To help you in the debugging process, we have provided a potential solution. The completed code for these solutions (as well as pictures of the completed code blocks) is included in the directory you downloaded during setup.
|
|
|
5. Flash the robot hex file to one Micro::Bit and the controller hex file to the other. You should be able to choose a radio group on each and lock it in. From there, you should be able to drive your robot using the controller. To help you in the debugging process, we have provided a potential solution. The completed code for these solutions (as well as pictures of the completed code blocks) is included in the directory you downloaded during setup.
|
|
|
|
|
|
<details>
|
|
|
<summary>
|
... | ... | @@ -418,7 +418,7 @@ You can check to make sure that you have the library by searching for the librar |
|
|
|
|
|
<br></br>
|
|
|
|
|
|
6. Test your code.
|
|
|
6. 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
|
... | ... | @@ -426,7 +426,7 @@ You can check to make sure that you have the library by searching for the librar |
|
|
* Your Controller should:
|
|
|
* 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"
|
|
|
7. 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?
|
|
|
7. 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?
|
|
|
|
|
|
|
|
|
### Step 7: Further Exploration
|
... | ... | |