Night-Light Pennant with LilyMini ProtoSnap
Understanding Your Circuit
The LilyMini is a small computer that can store information and commands to control different sensors and boards connected to it. Programmable boards like the LilyMini are called microcontrollers. The LilyMini has been programmed in advance with a set of behaviors called code.
Press the small button between tabs 3 and 4 to turn on your LilyMini on and off. Notice that in this circuit on the LilyMini LEDs behave in a different way. Unlike in our previous circuits, LEDs are not connected directly to the battery. These LEDs are connected to the LilyMini, which uses code to send power to each of its numbered tabs at different times – this is how the light patterns are created. The LEDs are outputs – components that receive information from a microcontroller and send it out into the world.
Other examples of outputs in circuits are motors, sound creators (such as a buzzer), and displays (e.g., monitors, LCD displays).
The light sensor and button are inputs – components that gather information from the world and relay it to the microcontroller. The LilyMini reads information from the inputs connected to it and makes decisions in the code based on the values it receives. The LilyMini switches modes when the button is pressed. In modes 2 and 3, when the light value from the light sensor falls below a certain level, the LilyMini tells the LEDs to twinkle. When the light level rises again, the LilyMini tells the LEDs to return to the original behavior.