... | ... | @@ -118,13 +118,13 @@ 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.
|
|
|
2. Complete the robot code. You will add channel choosing functionality and give the motobit commands after receiving a radio transmission from the controller:
|
|
|
1. When button a and b are pressed, set the radio group
|
|
|
2. When button a is pressed, if the radio group has not been set, decrement the radio group by 1
|
|
|
3. When button b is pressed, if the radio group has not been set, increment the radio group by 1
|
|
|
4. When the command "forward" is received over the radio, drive the mototbit Forward
|
|
|
5. When the command "stop" is received over the radio, stop the motobit
|
|
|
6. When the command "left" is received over the radio, drive the mototbit left
|
|
|
7. When the command "right" is received over the radio, drive the mototbit right
|
|
|
* When button a and b are pressed, set the radio group
|
|
|
* When button a is pressed, if the radio group has not been set, decrement the radio group by 1
|
|
|
* When button b is pressed, if the radio group has not been set, increment the radio group by 1
|
|
|
* When the command "forward" is received over the radio, drive the mototbit Forward
|
|
|
* When the command "stop" is received over the radio, stop the motobit
|
|
|
* When the command "left" is received over the radio, drive the mototbit left
|
|
|
* 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
|
... | ... | @@ -139,9 +139,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.
|
|
|
2. 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
|
|
|
* 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
|
|
|
* 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
|
|
|
* 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
|
|
|
3. Generate your controller .hex file and flash your controller Micro::Bit. If you don't remember how to flash code to your Micro::Bit, see the instructions [here](how-to-flash).
|
|
|
|
|
|
<details>
|
... | ... | |