Difference between revisions of "Constellation Projection Lamp"

From Microduino Wiki
Jump to: navigation, search
(Created page with "{| style="width: 1000px;" |- | ==Outline== 600px|center Let’s make a constellation projection lamp whose color can be switched with two...")
 
 
Line 6: Line 6:
 
[[File:anywhere_constellation.jpg|600px|center]]
 
[[File:anywhere_constellation.jpg|600px|center]]
  
Let’s make a constellation projection lamp whose color can be switched with two touch buttons, and implement the effect of breathing lamp through keeping pressing the touch button all the time.  
+
Let's make a constellation projection lamp whose color can be switched with two touch buttons, and implement the effect of breathing lamp through keeping pressing the touch button all the time.  
 
<br>
 
<br>
 
Suitable kits: mCookie302, IBC
 
Suitable kits: mCookie302, IBC
Line 45: Line 45:
 
==Programming==
 
==Programming==
 
===Required Program Blocks===
 
===Required Program Blocks===
*[[“ColorLED prepare” program block]]
+
*[["ColorLED prepare" program block]]
*[[“ColorLED control adjust RGB” program block]]
+
*[["ColorLED control adjust RGB" program block]]
*[[“Every time” program block]]
+
*[["Every time" program block]]
*[[“If-do” program block]]
+
*[["If-do" program block]]
*[[“Delay” program block]]
+
*[["Delay" program block]]
  
 
===Programming Thought===
 
===Programming Thought===
Line 58: Line 58:
 
'''ColorLED prepare, control the green breathing effect through touching the touch button 4.'''
 
'''ColorLED prepare, control the green breathing effect through touching the touch button 4.'''
 
<br>
 
<br>
If touch sensor 4 is pressed, “every time” will be used to make the green LED change from weaker to the brightest gradually, implementing the effect of breathing lamp. If the touch sensor keeps being pressed down, the green light repeat breathing in cycle.  
+
If touch sensor 4 is pressed, "every time" will be used to make the green LED change from weaker to the brightest gradually, implementing the effect of breathing lamp. If the touch sensor keeps being pressed down, the green light repeat breathing in cycle.  
 
[[File:mixly-ctrl-constellation-code.jpg|600px|center]]
 
[[File:mixly-ctrl-constellation-code.jpg|600px|center]]
 
'''Effect of blue breathing lamp'''
 
'''Effect of blue breathing lamp'''
 
<br>
 
<br>
If touch button 2 is pressed, “every time” will be used to make the blue LED change from the brightest to weaker, implementing the effect of breathing lamp. If the touch button keeps being pressed down, the blue light will repeat breathing in cycle.  
+
If touch button 2 is pressed, "every time" will be used to make the blue LED change from the brightest to weaker, implementing the effect of breathing lamp. If the touch button keeps being pressed down, the blue light will repeat breathing in cycle.  
 
[[File:mixly-ctrl-constellation-code1.jpg|600px|center]]
 
[[File:mixly-ctrl-constellation-code1.jpg|600px|center]]
 
<br>
 
<br>
Line 86: Line 86:
 
==Q&A==
 
==Q&A==
 
*Q: Why does it breath in cycle only when the touch button keeps being pressed down?  
 
*Q: Why does it breath in cycle only when the touch button keeps being pressed down?  
**A: Because after press, the state of release has only one, and the “every time” will be executed once, if keep pressing, it can breath in cycle.
+
**A: Because after press, the state of release has only one, and the "every time" will be executed once, if keep pressing, it can breath in cycle.
 
|}
 
|}

Latest revision as of 09:46, 9 October 2016

Outline

Anywhere constellation.jpg

Let's make a constellation projection lamp whose color can be switched with two touch buttons, and implement the effect of breathing lamp through keeping pressing the touch button all the time.
Suitable kits: mCookie302, IBC


Module Bill

Module

Module Number Function
mCookie-Core 1 Core board
Battery box 1 Program download and power supply
mCookie-Hub 1 Sensor adapter plate
Touch button 2 Detect the touch
ColorLED 1 Color LED

Other Equipment

  • USB cable*1
  • Sensor cable*3
  • Sensor shell*1
  • Lego or other fixation structure
Anywhere constellation-module.jpg

Module Setup

Setup

Anywhere constellation-step.jpg
  • Assemble the modules and sensors:
    • 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 2 crash button to pin 4/5 and 2/3 of Hub respectively;
    • Insert one end of USB cable into the battery base, and connect the other to computer;

Programming

Required Program Blocks

Programming Thought

Press the touch button 2, and you will see the effect of green breathing lamp; press the touch sensor 2, and you will see the effect of blue breathing lamp.

Mixly-ctrl-constellation.jpg

Start to Program

ColorLED prepare, control the green breathing effect through touching the touch button 4.
If touch sensor 4 is pressed, "every time" will be used to make the green LED change from weaker to the brightest gradually, implementing the effect of breathing lamp. If the touch sensor keeps being pressed down, the green light repeat breathing in cycle.

Mixly-ctrl-constellation-code.jpg

Effect of blue breathing lamp
If touch button 2 is pressed, "every time" will be used to make the blue LED change from the brightest to weaker, implementing the effect of breathing lamp. If the touch button keeps being pressed down, the blue light will repeat breathing in cycle.

Mixly-ctrl-constellation-code1.jpg



Test the result
Keep holding touch button 4, and you will see the effect of green breathing lamp. Keep holding touch button 2, and you will see the effect of blue breathing lamp.
Set up a constellation projection lamp with lego. Draw your own constellation diagram and stellar map on the paper, with circles representing the stars; Poke the stars with scissor or nib, letting the light in.

Anywhere constellation.jpg

Technical Specification

  • The produce number of color LED: MSDL11
  • API library is required to drive.
  • For details about color LED, please refer to Sensor-Color LED
  • For details about touch button, please refer to Sensor-Touch Button

Related Cases

Q&A

  • Q: Why does it breath in cycle only when the touch button keeps being pressed down?
    • A: Because after press, the state of release has only one, and the "every time" will be executed once, if keep pressing, it can breath in cycle.