Qw6ambp9t_PopBot X2 Line Tracking Robot With Multiple Junctions
Qw6ambp9t_PopBot X2 Line Tracking Robot With Multiple Junctions
Robot Line
Tracking with
Multiple
Junctions
Objectives
a. explain the significance of programming a
line-tracking robot capable of navigating
multiple junctions
b. create a program enabling the
Pop-Bot X2 to follow a map with
multiple intersections/junctions
Have you ever thought about how
delivery robots navigate complex
paths with intersections in
warehouses or streets?
Short video or animation of a robot
navigating a complex line tracking map
with intersections, such as warehouse
robots or autonomous vehicles.
void loop() {
int count= 0;
int IRa = analog(1); // right IR sensor
int IRb = analog(0); // left IR sensor
motor(ALL4, 80);
if(IRa < __ && IRb < ___ ) // if both sensors detect a line
{
motor(ALL4, 100);
delay(200);
count++; // post increment operator
if(count == 1) // Junction 1
{
// add codes here
}
if(IRa < __) // if the Right IR sensor detects a black line
{
motor(1, -50); // spin to the right for 0.5 milliseconds
motor(2, 50); //
delay(500); //
}
if(IRb < ___) // if the Left IR sensor detects a black line
{
motor(1, 50); // spin to the left for 0.5 milliseconds
motor(2, -50); //
delay(500); }
Formative Task Group Activity
• Directions:
Create accurately a program that makes the Pop-
Bot X2 robot follow a line tracking map from the
starting line to the finishing line, passing through
multiple intersections / junctions.
Formative Task 1 Requirements
Junctions 1 &
2– robot
Junction 1
should beep
Place the and pause for
Junction 2
robot 3 seconds
before the Junction 3
Start line. – robot
should
Junction 3 stop
Scoring Rubric
• Accuracy – 10 pts.
• Individual Role Participation – 5 pts.
• Program Source Code – 20pts.
• Teamwork – 10pts.
• Total : 45 pts.
Program source code version 2
#include<popx2.h>
int L,R;
int countJB=0;
void setup() {
OK();
}
void loop(){
L=analog(0);
R=analog(1);
JB(); // function for junction black
TBL(); // function for trace black line
}
void JB() // black junction
{
int L=analog(0);
int R=analog(1);
if(L< ___&&R<____)
{
countJB++;
if (countJB==1) // Junction 1
{
sound(1500,100);
fd(50);
}
void TBL() //trace black line
{
int L=analog(0);
int R=analog(1);
if (L <=___)
{
sl(70);
}
else if(R <=___)
{
sr(70);
}
else
{
fd(25);
} } // end of code
A c ti o n w h e n b o t h I R s e n s o r s
d e t e c t s a j u n c ti o n
START
A c ti o n w h e n b o t h I R s e n s o r s
d e t e c t s a j u n c ti o n
START
A c ti o n w h e n b o t h I R s e n s o r s
d e t e c t s a j u n c ti o n
END - STOP
Summary
• Significance of programming robots for real-
world navigation.
• Basics of handling intersections in line
tracking.
• Reflect on how these skills can apply to larger
robotics projects or real-world automation
challenges.
Written Work 1 – 3rd Quarter