<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh-CN">
		<id>http:///https//wiki.microduino.cn/index.php?action=history&amp;feed=atom&amp;title=Bluetooth_Night_Light</id>
		<title>Bluetooth Night Light - 版本历史</title>
		<link rel="self" type="application/atom+xml" href="http:///https//wiki.microduino.cn/index.php?action=history&amp;feed=atom&amp;title=Bluetooth_Night_Light"/>
		<link rel="alternate" type="text/html" href="https//wiki.microduino.cn/index.php?title=Bluetooth_Night_Light&amp;action=history"/>
		<updated>2026-04-21T07:58:34Z</updated>
		<subtitle>本wiki的该页面的版本历史</subtitle>
		<generator>MediaWiki 1.30.0</generator>

	<entry>
		<id>https//wiki.microduino.cn/index.php?title=Bluetooth_Night_Light&amp;diff=9167&amp;oldid=prev</id>
		<title>1304410487@qq.com：Created page with &quot;{{Language| Bluetooth Night Light }} {| style=&quot;width: 800px;&quot; |- | ==Purpose== When ambient light becomes dark, the night light turns on automatically. Using Bluetooth to acce...&quot;</title>
		<link rel="alternate" type="text/html" href="https//wiki.microduino.cn/index.php?title=Bluetooth_Night_Light&amp;diff=9167&amp;oldid=prev"/>
				<updated>2015-08-11T08:13:52Z</updated>
		
		<summary type="html">&lt;p&gt;Created page with &amp;quot;{{Language| Bluetooth Night Light }} {| style=&amp;quot;width: 800px;&amp;quot; |- | ==Purpose== When ambient light becomes dark, the night light turns on automatically. Using Bluetooth to acce...&amp;quot;&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新页面&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{Language| Bluetooth Night Light }}&lt;br /&gt;
{| style=&amp;quot;width: 800px;&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|&lt;br /&gt;
==Purpose==&lt;br /&gt;
When ambient light becomes dark, the night light turns on automatically. Using Bluetooth to access the light, you can control the color. &lt;br /&gt;
&lt;br /&gt;
==Principle==&lt;br /&gt;
&lt;br /&gt;
==Equipment==&lt;br /&gt;
{|class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
|Module||Number||Function &lt;br /&gt;
|-&lt;br /&gt;
|[[Microduino-CoreUSB]]||1||Core board &lt;br /&gt;
|-&lt;br /&gt;
|[[Microduino-Sensorhub]]||1||Sensor pinboard &lt;br /&gt;
|-&lt;br /&gt;
|[[Microduino-BT]]||1||Bluetooth module&lt;br /&gt;
|-&lt;br /&gt;
| [[Microduino-Light]]||1||Photosensitive sensor &lt;br /&gt;
|-&lt;br /&gt;
| [[Microduino-Lantern]]||1||Colored light &lt;br /&gt;
|-&lt;br /&gt;
| [[Microduino-BM]]||1||Battery management  &lt;br /&gt;
|}&lt;br /&gt;
 [[File:ble_lamp_light.jpg|600px|center|thumb]]&lt;br /&gt;
&lt;br /&gt;
==Document==&lt;br /&gt;
Android Clinet: &lt;br /&gt;
Note: The new 4.0 version BT needs to be supported by Android version 4.3 and higher. Here we offer Android APP.  &lt;br /&gt;
&lt;br /&gt;
APP download：'''[[File:Microduino-LAMP-APP.zip]]''&lt;br /&gt;
&lt;br /&gt;
==Hardware Buildup==&lt;br /&gt;
*Setup 1：Stack CoreUSB, BT and Sensorhub.&lt;br /&gt;
[[File:CoreUSB_Ble_Sensorhub.jpg|600px|center|thumb]]&lt;br /&gt;
*Setup 2：Connect the lantern to Sensorhub’s D6 pin and photosensitive sensor to A0. &lt;br /&gt;
[[file:mCookie-sensorhub_rule.JPG|thumb|800px|center]]&lt;br /&gt;
[[File:light_colorled_ble.jpg|600px|center|thumb]]&lt;br /&gt;
&lt;br /&gt;
==Software Debugging==&lt;br /&gt;
*Setup 1：Build IDE, connect CoreUSB to your PC and download program code. &lt;br /&gt;
[https://github.com/Microduino/Microduino_Tutorials/blob/master/MCookie_Tutorial/ble_led_light/ble_led_light.ino ble_led_light]&lt;br /&gt;
*Setup 2：Download Android client, and then decompress, install and open it. It will remind you to open Bluetooth device if you don’t open Bluetooth.   &lt;br /&gt;
[[File:Microduino_BT_Serial_1.png||300px|center|thumb]]&lt;br /&gt;
*Setup 3：Click SCAN on top right, select Microduino and connect. &lt;br /&gt;
[[File:Microduino_BT_Serial_2.png||300px|center|thumb]]&lt;br /&gt;
*Setup 4：You’ll see Serial Present on top right in default and when it turns to Seerial Ready, you can have normal communication.  &lt;br /&gt;
[[File:Microduino_BT_Serial_3.png||300px|center|thumb]]&lt;br /&gt;
&lt;br /&gt;
*APP description: &lt;br /&gt;
**If you have multiple colored lights, you can switch to Multi Color mode to adjust. You can connect six lights to the most. For Single Color mode, no matter how many lights you connect, it shows the same color.&lt;br /&gt;
**You can adjust the brightness via the circular ring. &lt;br /&gt;
**and control the light via the bottom switch. &lt;br /&gt;
[[File:Microduino_BT_Serial_5.png||300px|center|thumb]]&lt;br /&gt;
&lt;br /&gt;
Code description: &lt;br /&gt;
*Choose to adopt Bluetooth control when it is connected. &lt;br /&gt;
The use of BT serial port needs to be choosed accoding to wire jumpers oon the board. The default serial port is 0：Serial. &lt;br /&gt;
“ble()”function is for Bluetooth recieving data and lantern controlling. &lt;br /&gt;
*Ambient light pre-set value—by changing the light value, you can choose under which brightness can turn on the light. &lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
#define Light    100&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
*Read brightness function  &lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
ightValue = analogRead(Light_PIN);&lt;br /&gt;
&amp;lt;/source&amp;gt;&lt;br /&gt;
*Under the circumstance of no Bluetooth connection, the lantern will turn on when the ambient light brightness is less than the pre-set value otherwise it will turn off.  &lt;br /&gt;
&amp;lt;source lang=&amp;quot;cpp&amp;quot;&amp;gt;&lt;br /&gt;
if (!color_en &amp;amp;&amp;amp; lightValue &amp;lt; Light)&lt;br /&gt;
  {&lt;br /&gt;
    rainbowCycle(10, 255, 0, 0, 0);&lt;br /&gt;
    rainbowCycle(10, 255, 0, 0, 1);&lt;br /&gt;
&lt;br /&gt;
    rainbowCycle(10, 0, 255, 0, 0);&lt;br /&gt;
    rainbowCycle(10, 0, 255, 0, 1);&lt;br /&gt;
&lt;br /&gt;
    rainbowCycle(10, 0, 0, 255, 0);&lt;br /&gt;
    rainbowCycle(10, 0, 0, 255, 1);&lt;br /&gt;
&lt;br /&gt;
    rainbowCycle(10, 255, 0, 225, 0);&lt;br /&gt;
    rainbowCycle(10, 255, 0, 225, 1);&lt;br /&gt;
&lt;br /&gt;
    rainbowCycle(10, 247, 139, 5, 0);&lt;br /&gt;
    rainbowCycle(10, 247, 139, 5, 1);&lt;br /&gt;
&lt;br /&gt;
    rainbowCycle(10, 255, 255, 0, 0);&lt;br /&gt;
    rainbowCycle(10, 255, 255, 0, 1);&lt;br /&gt;
&lt;br /&gt;
    rainbowCycle(10, 0, 255, 255, 0);&lt;br /&gt;
    rainbowCycle(10, 0, 255, 255, 1);&lt;br /&gt;
&lt;br /&gt;
    for (int i = 0; i &amp;lt; 3; i++)&lt;br /&gt;
      rainbow(30);&lt;br /&gt;
  }&lt;br /&gt;
  else if (!color_en)&lt;br /&gt;
    colorSet(strip.Color(0, 0, 0));&amp;lt;/source&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==Result==&lt;br /&gt;
When there is Bluetooth connection, the lantern is controlled via the Bluetooth. While no Bluetooth connection, the lantern will go on when the ambient light brightness is less than the pre-set light value otherwise, it will go off. You can use LEGO to stack with our mCookie sensor to build a beautiful frame. &lt;br /&gt;
&lt;br /&gt;
==Video==&lt;br /&gt;
&lt;br /&gt;
|}&lt;/div&gt;</summary>
		<author><name>1304410487@qq.com</name></author>	</entry>

	</feed>