EasyManuals Logo

pitsco TETRIX PULSE User Manual

pitsco TETRIX PULSE
146 pages
To Next Page IconTo Next Page
To Next Page IconTo Next Page
To Previous Page IconTo Previous Page
To Previous Page IconTo Previous Page
Page #115 background imageLoading...
Page #115 background image
Figure 62 Figure 63 Figure 64
Execute the Code
Before you can upload the sketch to the PULSE, remember to check your
connections. The Ultrasonic Sensor should be in D3. 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.
The Codee Bot should be pointed toward an object or wall at least 25 cm away.
Press the green Start button to execute the sketch. Observe the behavior of the
robot. What happens if the Codee Bot or object is moved before the sketch is
ended?
Press the red Stop/Reset button to end the sketch. Based on the sketch comments,
did the behavior match expectations?
Further Investigate
This sketch uses an if-else block. An if-else block gives greater control over the flow
of code than the basic if block. It enables multiple tests to be grouped together so
they can be run at the same time. In other words, the if part of the block says if this
condition is true, do this. The else part of the block says if this condition is false, do
this instead.
In this sketch, the first part of the if-else block tests the condition of the Ultrasonic
Sensor, and if the sensor is more than 25 cm away from an object, it sets the power
for the motors at 50 percent. The second part of the if-else block uses the same test,
but if the sensor is less than 25 cm away from an object, it gives an alternate action
and tells the motors to brake.
On the if block, you can choose from different programming options. You can use
the basic if-do block, and then the program will do the action within the loop. In
this activity, you are using the if-do; else if-do block. Another option is the if-do,
else-do block. You have to click the blue gear icon to change the block type (Figures
62 and 63). Then you drag over the statement you plan to use underneath the if
block on the right side (Figure 64).
More than 25
centimeters
Box or obstacle
Troubleshooting: Be sure
to check that the Ultrasonic
Sensor is plugged into the
correct sensor port and is
plugged in correctly. Keep
in mind that objects without
adequate surface size or that
have an irregular surface
might not be detected or
might affect the distance the
sensor reads.
Building and Coding the PULSE CodeeBot 113

Questions and Answers:

Question and Answer IconNeed help?

Do you have a question about the pitsco TETRIX PULSE and is the answer not in the manual?

pitsco TETRIX PULSE Specifications

General IconGeneral
Brandpitsco
ModelTETRIX PULSE
CategoryRobotics
LanguageEnglish

Related product manuals