Lesson 9 Worksheet 9.2 – Light alarm
Write the following program to have the Edison robot sound an alarm when the lights in the room are turned on.
The sense light icon reads the light level from the left light sensor and places the reading into the variable called Light_Level.
The first loop uses mathematics to determine what to do.
Loop until the value in the variable called ‘Light_Level’ is ‘greater than’ (>) 100.
When the value in Light_Level is greater than 100 the loop is exited and goes to the next loop that sounds the alarm.
Place the Edison robot in the dark and press the play button. When the lights are turned on, the robot raises the alarm.
Can you think of a real life situation where this type of alarm would be useful?
What changes need to be made to the program to make it a dark alarm?