Difference between revisions of "Sound Control Lamp"
m (Fengfeng moved page Sound and Light Control Lamp to Sound Control Lamp) |
|||
Line 6: | Line 6: | ||
[[File:anywhere_mic light.jpg|600px|center]] | [[File:anywhere_mic light.jpg|600px|center]] | ||
− | Make a sound and light control lamp, which can only be activated when the two conditions | + | Make a sound and light control lamp, which can only be activated when the two conditions "no light" and "sound" both are matched. |
<br> | <br> | ||
Suitable kits: mCookie302, IBC | Suitable kits: mCookie302, IBC | ||
Line 20: | Line 20: | ||
|- | |- | ||
|[[mCookie-Battery|Battery box]]||1||Program download and power supply | |[[mCookie-Battery|Battery box]]||1||Program download and power supply | ||
+ | |- | ||
|[[mCookie-Hub|mCookie-Hub]]||1||Sensor adapter plate | |[[mCookie-Hub|mCookie-Hub]]||1||Sensor adapter plate | ||
|- | |- | ||
Line 40: | Line 41: | ||
[[File:anywhere_mic light-step.jpg|600px|center]] | [[File:anywhere_mic light-step.jpg|600px|center]] | ||
*Assemble modules and sensors: | *Assemble modules and sensors: | ||
− | **Stick the red core module, battery base and green extension module | + | **Stick the red core module, battery base and green extension module together; |
**Connect the color LED cable to pin 6/7 of Hub; | **Connect the color LED cable to pin 6/7 of Hub; | ||
**Connect the light sensor cable to pin 4/5 of Hub; | **Connect the light sensor cable to pin 4/5 of Hub; | ||
Line 47: | Line 48: | ||
==Programming== | ==Programming== | ||
===Required Program Blocks=== | ===Required Program Blocks=== | ||
− | *[[ | + | *[["ColorLED prepare" program block]] |
− | *[[ | + | *[["ColorLED control" program block]] |
− | *[[ | + | *[["Light sensor" program block]] |
− | *[[ | + | *[["Mic sensor" program block]] |
− | *[[ | + | *[["Delay" program block]] |
− | *[[ | + | *[["And", "or" program block] |
===Programming Thought=== | ===Programming Thought=== | ||
− | Only the two conditions | + | Only the two conditions "no light" and "sound" are all matched can it be activated. |
[[File:mixly-ctrl-mic light.jpg|600px|center]] | [[File:mixly-ctrl-mic light.jpg|600px|center]] | ||
Line 63: | Line 64: | ||
ColorLED prepare, the LED number is 1, and the pin is 6. | ColorLED prepare, the LED number is 1, and the pin is 6. | ||
<br> | <br> | ||
− | Use | + | Use "if-do" program block, if the light sensor detects no light, and the Mic sensor detects sound, the colorLED on program will be executed. Delay 2s, and then the color LED goes off, waiting for the next activating. |
[[File:mixly-ctrl-mic light-code.jpg|600px|center]] | [[File:mixly-ctrl-mic light-code.jpg|600px|center]] | ||
'''Test the result''' | '''Test the result''' | ||
<br> | <br> | ||
− | After upload, when cry to the Mic sensor within strong light, the LED | + | After upload, when cry to the Mic sensor within strong light, the LED won't light up. If you cover the light sensor with your hand, and then cry, the color LED will be activated. |
[[File:anywhere_mic light.jpg|600px|center]] | [[File:anywhere_mic light.jpg|600px|center]] | ||
<br> | <br> | ||
Line 77: | Line 78: | ||
'''Add a touch sensor, when there is no light, pressing the touch button or detecting sound can activate the color LED.''' | '''Add a touch sensor, when there is no light, pressing the touch button or detecting sound can activate the color LED.''' | ||
<br> | <br> | ||
− | Use two | + | Use two "if-do" program block nested. First, judge whether there is light, and then judge whether the touch button is pressed or whether there is sound. |
[[File:mixly-ctrl-mic light-code1.jpg|600px|center]] | [[File:mixly-ctrl-mic light-code1.jpg|600px|center]] | ||
Revision as of 03:30, 10 October 2016
ContentsOutlineMake a sound and light control lamp, which can only be activated when the two conditions "no light" and "sound" both are matched.
Module BillModule
Other Equipment
Module SetupSetup
ProgrammingRequired Program Blocks
Programming ThoughtOnly the two conditions "no light" and "sound" are all matched can it be activated. Start to ProgramIf there is no light but sound, the LED will be activated.
Test the result
Technical Specification
Related Case
FAQ
|