Bluetooth Task Instructions
Your task is the learn how to get 2 bricks talking over Bluetooth with the end goal of
full remote control of a bot. This is actually a big and complex task!
Starting Hints
- When confronted with a large complex task, break it into baby steps.
- Get each baby step perfect before you move on to the next.
- Test early, test often.
- *ALWAYS* *ALWAYS* *ALWAYS* be concerned about flooding or saturating the SLAVE w/msgs.
- MSG = message, RCV = receive, XMT = transmit, MSTR = master.
- I've broken this task into some baby steps for you...
Task 1
| SLAVE | MSTR |
1 | Waits for txt msg fm MSTR | |
2 | Displays msg when rcvd | Sends txt msg to SLAVE |
3 | May NOT use wait block | |
Notes:
- I want *NO* flicker at all on the slave screen.
- HINT: you should only display a message when you *KNOW* you have a message.
- You can't even use what amounts to a wait block...like a loop holding just a receive block...
Task 2
| SLAVE | MSTR |
1 | Waits for txt msg fm MSTR | |
2 | Displays count of secs until msg rcvd | Sends txt msg to SLAVE |
3 | Displays msg when rcvd | |
4 | Does not display secs after msg rcvd | |
5 | May NOT use wait block | |
Notes:
- This task teaches you how to get the SLAVE doing something else while waiting for a msg.
-
I want the count of seconds to stop *AND* disappear once the msg is rcvd.
- Variables would be a great help here!
- They can help you remember that an event occured.
- Have the count of seconds display at the bottom of the screen.
- ...and have the msg from the MSTR display at the top.
- Again, *NO* flicker at all!
Task 3
| | SLAVE | MSTR |
Task 3a | 1 | - nothing to do - | Attach motor to brick as handle |
2 | | Rotate motor by hand |
3 | | Read motor rotation info (direction & degress) |
4 | | Display motor info on screen |
Task 3b | 5 | Wait for motor info | Same as task 3a |
6 | Display when rcvd | ...and send motor info to SLAVE |
7 | May NOT use wait block | |
Task 3c | 8 | Build a tribot | Same as task 3b |
9 | Drive a motor using info fm MSTR | |
10 | Drive both motors using info fm MSTR | |
Notes:
- Continue displaying the motor info on the MSTR so you can compare to the SLAVE.
- SLAVE & MSTR must be in *PERFECT* sync...
- Flicker ... just say no.