Professional Documents
Culture Documents
ICT G8 Worksheet 5 (Revised)
ICT G8 Worksheet 5 (Revised)
Grade 8 worksheet 5
To understand branching,
consider the following
examples:
Example
We want to test if a number
is odd or even. To
accomplish this, we draw a
flowchart following the
steps given in the algorithm.
This flowchart is shown in
Figure.
Branching in scratch
Page 2 of 6
• Easy script changes — if a variable equals a certain value, one thing
happens, and if the variable does not equal the value, a different
thing happens
Output blocks
1-Motor(move)
2-Sound
3- Display
4-Send message
5-Color lamp
6- Lamp
Page 3 of 6
Input blocks (senseors)
1-Touch
2-Sound
3- Light
4-Ultra sonic
5-NXT buttons
6- Rotation sensor
7- Timer
8- Receive message
9- Temperature
10-Color
What are NXT Sensors?
Sensors are input devices that collect and gather physical
data surrounding us, send data to computer
Touch Sensor
The Touch Sensor gives your robot a sense of
touch. The Touch Sensor detects when it is being
pressed by something and when it is released
again.
Sound Sensor
The Sound Sensor can detect both decibels [dB]
and adjusted decibel [dBA]. A decibel is a
measurement of sound pressure.
Page 4 of 6
Light Sensor
The Light Sensor is one of the two sensors that give
your robot vision [The Ultrasonic Sensor is the other].
The Light Sensor enables your robot to distinguish
between light and dark. It can read the light intensity
in a room and measure the light intensity of colored
surfaces.
Ultrasonic Sensor
The Ultrasonic Sensor is one of the two sensors that give your robot “vision”
[The Light Sensor is the other]. The Ultrasonic Sensor enables your robot to
see and detect objects. You can also use it to make your robot avoid
obstacles, sense and measure distance, and
detect movement.
Page 5 of 6
Flow blocks
1-Wait
2-Loop
3- Switch
4-Stop
Page 6 of 6