Difference between revisions of "The Use of Sensor"

From Microduino Wiki
Jump to: navigation, search
 
Line 1: Line 1:
{| style="width: 800px;"
+
*'''[[Single-color LED]]'''
|-
+
*'''[[Full-color LED]]'''
|
+
*'''[[Key-press]]'''
=Function of the Module=
+
*'''[[Buzzer Use]]'''
*'''Please refer to: [[Colored LED]]'''
+
*'''[[Microphone Sound Detection]]'''
=Example 1: Lighten the Colored LED =
+
*'''[[Light Intensity Detection]]'''
==Overview==
+
*'''[[Touch Detection]]'''
To light a Colored LED graphically. 
+
*'''[[Vibration Detection]]'''
==Bill of Material==
+
*'''[[PIR Detection]]'''
*Module 
+
*'''[[Grayscale Tracking]]'''
{|class="wikitable"
+
*'''[[Hall Magnetic Detection]]'''
|-
+
*'''[[LM75 Temperature Detection]]'''
|Module||Number||Function
+
*'''[[AM2312 Temp.& Hum Sensor]]'''
|-
+
*'''[[Infrared Signal Receiving]]'''
|[[mCookie-CoreUSB]]||1||Core board
+
*'''[[Infrared Signal Emitting]]'''
|-
+
*'''[[Joystick]]'''
|[[mCookie-Hub]]||1||Sensor pin board 
+
*'''[[Servo]]'''
|-
+
*'''[[Air Quality Detection]]'''
|[[Microduino-Color LED]]||1||Colored LED
+
*'''[[PM2.5 Detection]]'''
|}
+
*'''[[Motor Drive]]'''
*Other Equipment 
+
*'''[[Ultrasonic Distance Measurement]]'''
**One USB cable 
 
**One sensor cable 
 
[[File:color_led-module.jpg|center|600px]]
 
 
 
==Hardware Buildup==
 
*Setup 1:Connect the '''IN''' port with D6 of the Hub, which is the LED control pin. Users can change that on your own. 
 
[[file:mCookie-strandtext-sensor.JPG|600px|center]]
 
*Setup 2:Connect the CoreUSB, Hub and Color LED together to the computer through a USB cable.
 
[[file:mCookie-strandtext-pc.JPG|600px|center]]
 
 
 
==Mixly Programming==
 
*Step1:Open Mixly software and you'll find "Light Control" in "Executer" under the item of "Microduino". 
 
[[file:mixly-colorled.JPG|600px|center]]
 
*Step2:Drag out "Light Preparation". 
 
[[file:mixly-colorled-ready.JPG|600px|center]]
 
*Step3:Drag out "Light Control". 
 
[[file:mixly-colorled-ctrl.JPG|600px|center]]
 
Step4:See the syntax description after buildup. 
 
[[file:mixly-colorled-ok.JPG|600px|center]]
 
 
 
==Debugging==
 
*Step1:Select the right board card(Core USB 32U4) and COM port(Recognized automatically by default). 
 
[[File:mixly_board_COM.jpg|400px|center]]
 
*Step2:After uploading, you can see the light turns red. The color of the light can be changed, but it needs re-upload after changing. 
 
 
 
*The steps above are based on debugging on the computer. The code is inside the core module after uploading, which can also be powered by battery box. 
 
[[file:mCookie-BMPin1.jpg|800px|center]]
 
*Connect the activated battery box with BM module. 
 
[[File:CoreUSB_colorled_steup.jpg|600px|center]]
 
 
 
=Example 2: Colored LED Blinks=
 
==Overview==
 
To make the light blink graphically. 
 
==Mixly Programming==
 
*We need delay time here. So, find "Wait" in the "Control" item, the unit is "ms" and "1000ms=1s". 
 
[[File:mixly_delay.jpg|600px|center]]
 
*See syntax description after buildup. 
 
[[file:mixly-colorledblink-ok.JPG|600px|center]]
 
*Make sure the right board and COM port and then upload. The light can blink every 1s by here. Users can change the color or the time to see what happens by doing that. 
 
 
 
=Experiment 3: "Breathing Light" =
 
==Overview==
 
To let the colored LED light "breath"--to grow bright and then slowly go out, achieving the effect of "breathing". 
 
==Mixly Programming==
 
* Use RGB to represent color. (R:255,G:0,B:0). Thus, we need to gradually change the RGB values to get gradient color change of the light, achieving the effect of "breathing light". 
 
*We also need "Loop", which can be found in "Control" item.
 
[[File:mixly_for.jpg|600px|center]]
 
*Instruction of "Loop".
 
[[File:mixly_for_explain.jpg|600px|center]]
 
*See syntax description after buildup. 
 
[[file:mixly-colorledhuxi-ok.JPG|600px|center]]
 
*Make sure the right board card and COM port, and then upload. You can make the light go on and out every 15ms and within the 15ms, the change is gradually from bright to dark or from dark to bright, which is repeated and therefore, achieve "breathing" effect. 
 
 
 
=Example 4: How to Control Multiple Lights=
 
==Overview==
 
Lighten two lights at the same time and switch to another color every 1s. 
 
==Hardware Connection==
 
*LED cascade(<big>OUT</big>):The former LED is <big>OUT</big> and the next one is <big>IN</big>.
 
[[File: CoreUSB_Ble_steup11.jpg|600px|center]]
 
==Mixly Programming==
 
*Change the light number that needs to be controlled. 
 
*Program writing and syntax description. 
 
[[File: CoreUSB_numberled.jpg|600px|center]]
 
*The two light go on at the same time. The first light goes red and the second goes blue. After 1s, the first one turns green and the second one turns purple. That'll repeat again and again. 
 
*Users can use more lights or DIY more interesting projects, such as traffic light. 
 
|}
 

Latest revision as of 02:39, 23 March 2016