07 Mission Instructions
Your mission is to create a robot that counts how many times the lights are turned off and on each day for later analysis.
7. Code: LED Report Back State Changes
What if we want to provide feedback to people in the same room as the robot? They might be interested to know whether they are the first person to flip the light switch, or whether they are adding to a much larger pattern.
Let's use the LED to report back how many state changes occurred using blinks. If the lights were turned on 7 times, the LED should blink 7 times.
The blocks to control the LED are found under Actuators. Which one are you going to use?
Remember that you can use a variable in a repeat loop, so you can tell Bloxter to do something “counter” times. You will also want to think about how to turn on the light, wait (not long, maybe half a second?), turn it off, and then wait again. Use a count block to tell the program to wait for a specified amount of time.