Execute the Code
Before you can upload the sketch to the PULSE, remember to check your
connections. Upload the sketch. The green LED will light up, indicating the code
is ready to execute. When this has occurred, disconnect the USB cable and set the
Codee Bot on the floor.
Press the green Start button to execute the sketch. Observe the direction and
duration of the Codee Bot’s motion. Based on the sketch comments, did the
behavior match expectations?
Further Investigate
When you have a lot of blocks on screen, it can hard to see your whole program.
You can use the zoom in and out feature. Also, some blocks can be changed to
inline inputs. The pulse Set Motor Powers block can be changed to an inline input.
Below is an example of how this block can change appearance (Figure 51). This
does not affect your program.
This sketch has a lot to it, but it is made of functions that you have used before. You
have just combined multiple sequential behaviors to create one larger behavior – in
this case, a square.
An important thing to understand about this program is that you are using dead
reckoning to program the robot’s square driving path. Dead reckoning is simply
using time as the basis for controlling a motor. For instance, to make a right-hand
turn, you are commanding the motors to turn on in opposite directions at 50%
power and run for 1,650 milliseconds.
You estimate that if you spin the motors at a certain rpm for a certain time, you
should come close to making a 90-degree right turn. However, this is not always
accurate because the amount that your robot’s battery is charged can vary, and any
wheel slippage on the surface you are working on can cause a variation in results.
You are using dead reckoning to make a right turn.
All the functions in this sketch work together to make the Codee Bot move in a
square (Figure 52). Because you want the motors to always work together, the pulse
Invert Motor block needs to be used only in the setup part of the loop. The pulse
Set Motor Powers block tells both motors to move at different speeds in a single
function.
Figure 51
Tip: Depending on the
surface type, your bot might
not execute a perfect square.
96
Building and Coding the PULSE CodeeBot
Содержание tetrix prime
Страница 1: ...44301 TETRIX PULSE Robotics Controller Programming Guide...
Страница 7: ...PULSE Controller Technology Overview Getting Started 5...
Страница 60: ...Step 5 Step 6 Step 7 Step 8 Step 3 Step 4 Servo Horn Screw 58 Building and Coding the PULSE CodeeBot...
Страница 61: ...Step 9 Step 10 Step 12 Step 14 Step 11 Step 13 Building and Coding the PULSE CodeeBot 59...
Страница 62: ...Step 18 Step 17 Finished Assembly Step 16 Step 15 60 Building and Coding the PULSE CodeeBot...
Страница 73: ...Step 1 0 Step 1 1 Build two like this Building and Coding the PULSE CodeeBot 71...
Страница 74: ...Step 1 2 Step 1 3 72 Building and Coding the PULSE CodeeBot...
Страница 75: ...Step 1 4 Building and Coding the PULSE CodeeBot 73...
Страница 77: ...Partial assembly should look like this Step 2 0 Step 2 1 Building and Coding the PULSE CodeeBot 75...
Страница 78: ...Step 2 2 Step 2 3 76 Building and Coding the PULSE CodeeBot...
Страница 79: ...Step 2 4 Step 2 5 Building and Coding the PULSE CodeeBot 77...
Страница 80: ...Step 2 6 Step 2 7 78 Building and Coding the PULSE CodeeBot...
Страница 81: ...Step 2 8 Building and Coding the PULSE CodeeBot 79...
Страница 83: ...Step 3 0 Step 3 1 Building and Coding the PULSE CodeeBot 81...
Страница 84: ...Step 3 2 82 Building and Coding the PULSE CodeeBot...
Страница 85: ...Step 3 3 Building and Coding the PULSE CodeeBot 83...
Страница 87: ...Step 4 0 Step 4 1 Building and Coding the PULSE CodeeBot 85...
Страница 88: ...Step 4 2 86 Building and Coding the PULSE CodeeBot...
Страница 89: ...Finished assembly should look like this Building and Coding the PULSE CodeeBot 87...
Страница 131: ...GS Activity 4 extension GS Activity 5 extension Appendix 129...
Страница 144: ...142 Notes...
Страница 145: ......
Страница 146: ...Call Toll Free 800 835 0686 Visit Us Online at TETRIXrobotics com TETRIX PULSE Robotics Controller Programming Guide...