Engineering Tutorial
By;Micheal Cho , Triet Nguyen
Movement dictated by time
1. Add a motor and set it to forward.
2. Add another motor and set it to backwards.
3. Add time(wait) in between the two motors.
4. Connect the two motors to the “time”.
5. Make a constant of “time”, and put in number.
6. Connect the two motors by clicking “output port”.
7. Make a constant by right-clicking the “x” sign.
8. Connect the port constant with the line connecting the two motors.
Movement over a specific distance
1. Open labview
2. Press add new vi
3. Name it movement dictated by time or distance.(depending on what you want to create
4. On the front panel right click and click nxt robotics then click on motors
5. Place it somewhere on your screen
6. Then right click again, nxt robotics, then click on wait
7. Place that on the right side of the motor block
8. Right click the top of the motor block, then click create, constant. Make sure your motors are on the correct ports A&C
9. Then on the block click on the box and press wait for time, or distance
10. Right click the left side of the wait box, create, constant
11. Type in the amount of time in seconds that you want it to run. If distance type the number of rotations
12. Then connect the motor block to the wait block where the hour glass is
13. Then click run on the top right had corner
what does the code look like for the following:
a) Zero point turn: Both motors(wheels) turning the opposite direction. For example, one motor can be set as forward and the other one can be set as backwards.
b) Left point turn: Left wheel brakes, and the right one keeps going, which makes the robot turn.
c) Right point turn: Right wheel brakes, and the left one keeps going, which makes the robot turn.
d) Left "car" turn: The power of the left wheel is less than the power of the right wheel, which makes the robot turn.
‘’While ‘’, ‘’For’’ Loop and what they use for
While loop is an infinity loop and it runs forever until you stop it or the robot ran out of battery .
For loop is like a time loop you set the time and it will run until the time is over .
How does a Case structure work ?
Case structures give circumstances so if something is true this would happen and if it is not true something else would happen
Create a case structure
click true
Create a motor block
Right click create constant, Ports A and C
Place that in the case structure
Click false on the case structure
Create Motor On Ports A and C
click the box and select reversed
place that in the case structure
Then create a touch sensor and place it outside of the case structure
Set it to release then connect it to the case structure.
run program.
What are some other "structures" ?
There are for loop , while loop , Local variable , case structure , stacked sequence structure , Formula node.
How can you "motor sync"?
how do I use loops/structures to improve sensor A.I.?
For loops can run infinitely if needed for a long term AI or for sensors to keep checking for conditions infinitely.
While loops can be used so that if sensors detect something the the code is executed and can replace for loops but take sensor inputs instead of number of times to run.