making_the_hand_controller
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
making_the_hand_controller [2016/07/15 16:52] – salinasmichael | making_the_hand_controller [2016/07/25 17:01] (current) – salinasmichael | ||
---|---|---|---|
Line 1: | Line 1: | ||
+ | ======The Packbot Code, Bluetooth, and Hand Controller Build====== | ||
+ | |||
+ | **Author:** Michael Salinas Email: < | ||
+ | \\ | ||
+ | **Date:** Last modified on < | ||
+ | \\ | ||
+ | **Keywords: | ||
+ | |||
+ | |||
+ | |||
+ | \\ | ||
+ | |||
The Hand Controller uses a second NXT brick, connected via Bluetooth, to act as a controller. I found three really good videos on YouTube that can help you better understand how it works. | The Hand Controller uses a second NXT brick, connected via Bluetooth, to act as a controller. I found three really good videos on YouTube that can help you better understand how it works. | ||
Line 15: | Line 27: | ||
\\ \\ | \\ \\ | ||
- | I will supply | + | I also made the code for the packbot in NXC so it is easier |
+ | \\ | ||
- | \\ \\ | + | Since the code for both the controller and the packbot are relatively short, I will leave it here to be copied and pasted or modified as you please. |
+ | < | ||
+ | task main() | ||
+ | { | ||
+ | | ||
+ | long a, b, c; | ||
+ | char x; | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | a = MotorRotationCount(OUT_A); | ||
+ | b = MotorRotationCount(OUT_B); | ||
+ | c = MotorRotationCount(OUT_C); | ||
+ | // | ||
+ | |||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | | ||
+ | x = SendRemoteNumber(CONN_BT1, | ||
+ | Wait(10); | ||
+ | x = SendRemoteNumber(CONN_BT1, | ||
+ | Wait(10); //Measured in Milliseconds | ||
+ | x = SendRemoteNumber(CONN_BT1, | ||
+ | Wait(10); // A delay between each message | ||
+ | //The PackBot programs' | ||
+ | // | ||
+ | } | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | < | ||
+ | task main() | ||
+ | |||
+ | { //This is the Packbot Code | ||
+ | long a, | ||
+ | char x; | ||
+ | |||
+ | | ||
+ | | ||
+ | Wait(50); | ||
+ | //If it refreshes too slow, there will be input lag. | ||
+ | x = ReceiveRemoteNumber(MAILBOX2, | ||
+ | left = a; //a message to arrive in the | ||
+ | OnFwd(OUT_A, | ||
+ | x = ReceiveRemoteNumber(MAILBOX1, | ||
+ | flip = b; //The message is then paired | ||
+ | OnFwd(OUT_B, | ||
+ | x = ReceiveRemoteNumber(MAILBOX3, | ||
+ | right = c; //are directly converted to | ||
+ | OnFwd(OUT_C, | ||
+ | | ||
+ | } | ||
+ | </ | ||
+ | |||
+ | **Adjusting wait times within the code can help smooth out the commands given to the packbot. So you can essentially " | ||
+ | \\ You can also have some fun adding sounds when backing up, or possibly adding buttons to the controller that perform other functions. | ||
+ | |||
+ | ======The Controller Build====== | ||
+ | |||
+ | \\ \\ | ||
+ | **Step 1** | ||
+ | \\ {{:: | ||
+ | **Step 2** | ||
+ | \\ {{:: | ||
+ | **Step 3** | ||
+ | \\ {{:: | ||
+ | **Step 4** | ||
+ | \\ {{:: | ||
+ | **Step 5** | ||
+ | \\ {{:: | ||
+ | **Step 6** | ||
+ | \\ {{:: | ||
+ | **Step 7** | ||
+ | \\ {{:: | ||
+ | **Step 8** | ||
+ | \\ {{:: | ||
+ | **Step 9** | ||
+ | \\ {{:: | ||
+ | **Step 10** | ||
+ | \\ {{:: | ||
+ | **Step 11** | ||
+ | \\ {{:: | ||
+ | **Step 12** | ||
+ | \\ {{:: | ||
+ | **Step 13** | ||
+ | \\ {{:: | ||
+ | **Step 14** | ||
+ | \\ {{:: | ||
+ | **Step 15** | ||
+ | \\ {{:: | ||
+ | **Step 16** | ||
+ | \\ {{:: | ||
+ | **Step 17** | ||
+ | \\ {{:: | ||
+ | **Step 18** | ||
+ | \\ {{:: | ||
+ | **Step 19** | ||
+ | \\ {{:: | ||
+ | **Step 20** | ||
+ | \\ {{:: | ||
+ | **Step 21** | ||
+ | \\ {{:: | ||
+ | **Step 22** | ||
+ | \\ {{:: | ||
+ | **Step 23** | ||
+ | \\ {{:: | ||
+ | **Step 24** | ||
+ | \\ {{:: | ||
+ | **Step 25** | ||
+ | \\ {{:: | ||
+ | **Step 26** | ||
+ | \\ {{:: | ||
+ | **Step 27** | ||
+ | \\ {{:: | ||
+ | **Step 28** | ||
+ | \\ {{:: | ||
+ | **Step 29** | ||
+ | \\ {{:: | ||
+ | **Step 30** | ||
+ | \\ {{:: | ||
+ | **Step 31** | ||
+ | \\ {{:: | ||
+ | **Step 32** | ||
+ | \\ {{:: | ||
+ | **Step 33** | ||
+ | \\ {{:: | ||
+ | **Step 34** | ||
+ | \\ {{:: | ||
+ | **Step 35** | ||
+ | \\ {{:: | ||
+ | **Step 36** | ||
+ | \\ {{:: | ||
+ | **Step 37** | ||
+ | \\ {{:: | ||
+ | **Step 38** | ||
+ | \\ {{:: | ||
+ | **Step 39** | ||
+ | \\ {{:: | ||
+ | **Step 40** | ||
+ | \\ {{:: | ||
+ | **Step 41** | ||
+ | \\ {{:: | ||
+ | **Step 42** | ||
+ | \\ {{:: | ||
+ | **Step 43** | ||
+ | \\ {{:: | ||
+ | **Step 44** | ||
+ | \\ {{:: | ||
+ | **Step 45** | ||
+ | \\ I skipped a few tedious parts to this step. Basically you keep staking the 3 beams to connect the two motors. Do this by using the pins used in step 44 | ||
+ | \\ {{:: | ||
+ | **Step 46** | ||
+ | \\ {{:: | ||
+ | **Step 47** | ||
+ | \\ {{:: | ||
+ | You will actually need to set where the |
making_the_hand_controller.1468626770.txt.gz · Last modified: 2016/07/15 16:52 by salinasmichael