Difference between revisions of "Night Lamp"
(Created page with " {| style="width: 1000px;" |- | ==Outline== 600px|center Make a night lamp which can adjust the brightness automatically according to...") |
|||
Line 26: | Line 26: | ||
|[[Sensor-Light-A1|Light sensor]]||1||Detect the strength of light | |[[Sensor-Light-A1|Light sensor]]||1||Detect the strength of light | ||
|- | |- | ||
− | |[[Sensor-Color LED| | + | |[[Sensor-Color LED|Color LED]]||1||Color LED. |
|} | |} | ||
Line 50: | Line 50: | ||
==Programming== | ==Programming== | ||
===Required Program Blocks=== | ===Required Program Blocks=== | ||
− | *[[ | + | *[["ColorLED prepare" program block]] |
− | *[[ | + | *[["ColorLED control adjust RGB" program block]] |
− | *[[ | + | *[["Light sensor" program block]] |
===Programming Thought=== | ===Programming Thought=== | ||
Line 60: | Line 60: | ||
'''The color LED goes on without light, and off with light.''' | '''The color LED goes on without light, and off with light.''' | ||
<br> | <br> | ||
− | LED prepare, set the LED number to 1, and pin to 6. Use | + | LED prepare, set the LED number to 1, and pin to 6. Use "if-do" program block. If the light sensor detects the light, it will execute color LED off program, and set the RGB value to 0. If the light sensor detects no light, the color LED will be turned on, and the RGB value will be set randomly and the color of the color LED will change. |
[[File:mixly-ctrl-colorled-light-code.jpg|600px|center]] | [[File:mixly-ctrl-colorled-light-code.jpg|600px|center]] | ||
'''Test the result''' | '''Test the result''' |
Latest revision as of 02:46, 9 October 2016
ContentsOutlineMake a night lamp which can adjust the brightness automatically according to the surroundings. When the environment is bright, the night lamp is off. When the environment is dark, the lamp is on.
Module BillModule
Other Equipment
Module SetupLearn about the New SensorLight Sensor
Setup
ProgrammingRequired Program Blocks
Programming ThoughtWhen the light sensor detects the darker environment, the color LED will emit light; when detects bright environment, the color LED will go off. In this way, the function of night light has been implemented.ProgrammingThe color LED goes on without light, and off with light.
Test the result
Technical Specification
Related CasesFAQ
|