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 #122 background imageLoading...
Page #122 background image
Sensor
Box or obstacle
More than 25
centimeters
Execute the Code
Before you can upload the sketch to the PULSE, remember to check your
connections. The Line Finder Sensor will be in D2, and the Ultrasonic Sensor will be
in D3.
You will use the Line Finder Sensor for line following and the Ultrasonic Sensor for
obstacle detection. This example sketch will have the robot follow the black line on
a white surface and look for an object in its path.
When the object is detected at a distance of less than 25 cm, the robot will stop
to avoid crashing into it. The robot will raise its beam and wait until the object is
cleared and then continue.
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 on a white or reflective surface with the Line Finder
Sensor slightly to the side of a line to follow.
When running this code, set an obstacle in front of your robot at a distance well
outside the 25-centimeter detection range. Cardboard boxes work well for this
purpose. You do not want anything too heavy that could cause damage to your
robot just in case your robot crashes into it.
Press the green Start button to execute the sketch. Observe the behavior of the
robot. You can also play around with moving your obstacles to see how your robot
reacts.
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 and a while() loop block, which you have covered
before. This sketch is not about adding new elements. It is about combining the
elements from the previous activities.
The if-else block in this sketch does the same line-following behavior as in Activity
12 with two if blocks but in a more controlled way. The while() loop block monitors
the Ultrasonic Sensor and creates a behavior when an object is detected within 25
cm. This new behavior stops the Codee Bot and uses the servo to raise the Codee
Bot’s arm until the object is cleared from the Codee Bots path. When the object is
cleared, the Codee Bot will lower its arm and continue the original behavior of line
following.
Tip: If youre struggling
with your sensors, look back
at previous activities for
troubleshooting tips.
120 Building and Coding the PULSE CodeeBot

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