ROBOTICS COMPETITION 3
ROBOTICS COMPETITION
3
THE SMART CAR CHALLENGE
PRACTICE PROJECT 3Avoid collision with the Ultrasonic sensors
SCENARIONavigate your smart car along the roads and intersections of a smart city using the
Ultrasonic sensors.
MISSION
In this Practice Scenario we will create code to allow your FlipRobot to
detect objects and avoid collision using ultrasonic sensors.
Part 1 of this project will focus on two smart cars moving towards each
other from opposite ends of the street and avoiding collision.
Part 2 of this project will focus on four smart cars moving towards each
other from different directions and avoiding collision.
LEARNING OUTCOMES
• Learn to use FlipCode to control DC
motors’ movements.
• Learn to use If/Do/Else logic in FlipCode.
• Learn to create and apply programming
functions.
• Learn to program Ultrasonic sensors for
distance recognition.
WHAT YOU'LL NEED
DC MotorMotor block
UltrasoundSensor block
If and Then Logic block
To do something Functions block
EQUIPMENT FLIPCODE BLOCKS
NumberMath block
EqualsLogic block
• FlipRobot E310+
• Laptop
• Charging/Connection cable
• White Cardboard Sheets
• Black Electrician’s Tape
• Red Electrician’s Tape
PART 1Ultrasonic Sensor (2 smart cars)
ONEFlipRobots travel forward.
TWOFlipRobots turn.
THREEFlipRobots continue forward
and then stop.
A B A B AB
WORKFLOW SEQUENCE 1
Make FlipRobot A move forward and turn left to avoid crashing into
another car
Move forward Turn left
Does your vehicle sense an object ahead within 20cm?
NO YES
Make FlipRobot B move forward and turn right to avoid crashing into
another car
Move forward Turn right
Does your vehicle sense an object ahead within 20cm?
NO YES
PART 2Ultrasonic Sensor (4 Smart Cars)
A C
A C
B D
B D
C
B D
A
WORKFLOW SEQUENCE 2.1
Make FlipRobot A move forward and turn right to avoid crashing into
another car
Move forward Turn right
Does your vehicle sense an object ahead within 20cm?
NO YES
Make FlipRobot B move forward and turn left to avoid crashing into
another car
Move forward Turn left
Does your vehicle sense an object ahead within 20cm?
NO YES
WORKFLOW SEQUENCE 2.2
Make FlipRobot C move forward and turn left to avoid crashing into
another car
Move forward Turn left
Does your vehicle sense an object ahead within 20cm?
NO YES
Make FlipRobot D move forward and turn right to avoid crashing into
another car
Move forward Turn right
Does your vehicle sense an object ahead within 20cm?
NO YES