Imagine you're a spy who needs to send an urgent message to someone on a distant hilltop in the dead of night. One way you might do that is by blinking a flashlight. One flash might mean "all is well", two flashes "danger!", three flashes "send money", etc.
This project lets you use a flashight to send messages to a micro:bit. The "message" is simply the number of times you blink the flashlight. That may seem boring at first, but you can do cool things with numbers. For example, the number might be used to make the micro:bit do something like play a song or display a face. Numbers can also be used to encode letters so you can send text messages.
Build the scripts or download the project. Plug in a micro:bit and click the start button to start the scripts. Open the graph so you can see the light level.
Point a flashlight at the light sensor (on a micro:bit, the entire display is the light sensor) and turn the flashlight on and off. The number "1" should be displayed. Flash different numbers of times to see different numbers.
If the micro:bit doesn't show the number of times you flashed or if it doesn't show anything, try putting the flashlight closer to the micro:bit. In a brightly lit room it may help to shade the micro:bit with your hand, making sure you don't block the flashlight beam.
If you don't have a flashlight you can cover and uncover the micro:bit with your hand to create flashes of light. Notice how the light changes in the graph. You may need to adjust the threshold in the flash count script. A good value is about halfway between the normal light level in the room and the light level with the flashlight shining on the light sensor.
You might extend this project to send text messages by assigning a different number to each letter of the alphablet. For exmample, A might be 1, B might be 2, and so forth up to Z, which would be 26.
Wikipedia has fascinating articles on the history of signal lamps and optical communications. The British navy began using flashing lanterns to send messages between ships at sea starting around 1867 and signal lamps are still used on naval ships to this day.