Lesson_04

Project Overview










Introduction & Product Analysis
Drawing & communication
Sensing abilities in robots
Programming Robots
Mechanisms and Systems
Designing new products & Packaging
Presentation and Rendering
Biomimicry
Concept Modelling
Concept presentations
LESSON 04
LESSON 1 STARTER
Learning objective: Learn about programming robots to operate autonomously, making use of time, motion and
sensors. Design a new HEXBUG robot which operates differently to others!
LEARNING ABOUT PROGRAMMING
What is programming?
Some HEXBUG’s are already autonomous. This means they are able to move freely without
any human intervention. They respond to other HEXBUG’s as well as the environment they
are placed in.
Look at these HEXBUG’s, what sort of decisions are they making to make them
autonomous?
New words: autonomous, decision, environment
Programming Your Friends
Activity Part 1
For this activity you will need to work in
pairs.
1.One person will need to be blindfolded
or close their eyes
2.Your partner must give you instructions
on how to get you from one place in the
room to another, ONLY ONE
INSTRUCTION AT A TIME
3.You must use the following “code”:
CODE
START
STOP
FORWARD
REVERSE
TURN CLOCKWISE
TURN ANTICLOCKWISE
Programming Your Friends
Activity Part 2
This time, the code gets a little more complex
CODE
START
STOP
FORWARD
REVERSE
TURN RIGHT
TURN LEFT
MEASUREMENTS
ANGLE DEGREES
SECONDS
STEPS
CLOCKWISE
ANTICLOCKWISE
Programming Your Friends
Activity Part 3
Now you have to program them fully before they set off and you are not
allowed to speak to them while they are in operation.
CODE
START
STOP
FORWARD
REVERSE
TURN RIGHT
TURN LEFT
MEASUREMENTS
ANGLE DEGREES
SECONDS
STEPS
CLOCKWISE
ANTICLOCKWISE
What is Psuedocode?
What is Psuedocode?
You have actually just been
programming using psudocode in your
teams.
Psudocode is ordinary language used by
programmers before they choose a
computer language.
Example: Make a robot turn 360 degrees and end up
where it started:
1.MOVE FORWARD 1 SECOND
2.TURN CLOCKWISE 90 DEGREES
3.MOVE FORWARD 1 SECOND
4.TURN CLOCKWISE 90 DEGREES
5.MOVE FORWARD 1 SECOND
6.TURN CLOCKWISE 90 DEGREES
7.MOVE FORWARD 1 SECOND
Psuedocode is the “starting point” for
programming robots!
New words: psuedocode, computer language, degrees
Sensors?
Sensing: Thinking back to the “Sensors” lesson, which Hexbug was able to sense what?
Programming with Psuedocode
A
Activity
Create psuedocode for the HEXBUG NANO so:
1
Starts in A1
Finishes in E5
2
3
4
5
B
C
D
E
Programming with Psuedocode
A
Activity
Create psuedocode for the HEXBUG LARVA so:
1
Starts in A1
Finishes in A1
Detects the Wall
2
3
4
5
B
C
D
E
Programming with Psuedocode
A
Activity
Create psuedocode for the HEXBUG ANT so:
1
Starts in A1
Detects the Wall
Sticks in a LOOP
2
3
4
5
B
C
D
E
New HEXBUG?
New Hexbug Design Brief
You are required to design your own Hexbug using
whichever and how many sensors you want.
You need to think about where the sensors will be
placed and what the new Hexbug will do?
You will need to produce pseudocode coding to help
you explain this.
LESSON 4 PLENARY
As a class, let us consider the following questions?
A. What is pseudo code?
B. What do we measure angles with?
C. Why do sensors make products more expensive?
D. How does programming and code work together to create a working product?
Summary
Learning objective: Learn about programming robots to operate autonomously, making use of time, motion and
sensors. Design a new HEXBUG robot which operates differently to others!
Today you have:
Learnt what psudocode is and how it can be used by programmers and coders in robotics
Program your “Friends” and other “Hexbug’s” using psuedocode and make them become
autonomous
Develop a new Hexbug that you have yourself programmed selecting the appropriate sensors
you want!