查看“Bluetooth Night Light”的源代码
←
Bluetooth Night Light
跳转至:
导航
、
搜索
因为以下原因,您没有权限编辑本页:
您所请求的操作仅限于该用户组的用户使用:
用户
您可以查看与复制此页面的源代码。
{{Language| Bluetooth Night Light }} {| style="width: 800px;" |- | ==Purpose== When ambient light becomes dark, the night light turns on automatically. Using Bluetooth to access the light, you can control the color. ==Principle== ==Equipment== {|class="wikitable" |- |Module||Number||Function |- |[[Microduino-CoreUSB]]||1||Core board |- |[[Microduino-Sensorhub]]||1||Sensor pinboard |- |[[Microduino-BT]]||1||Bluetooth module |- | [[Microduino-Light]]||1||Photosensitive sensor |- | [[Microduino-Lantern]]||1||Colored light |- | [[Microduino-BM]]||1||Battery management |} [[File:ble_lamp_light.jpg|600px|center|thumb]] ==Document== Android Clinet: Note: The new 4.0 version BT needs to be supported by Android version 4.3 and higher. Here we offer Android APP. APP download:'''[[File:Microduino-LAMP-APP.zip]]'' ==Hardware Buildup== *Setup 1:Stack CoreUSB, BT and Sensorhub. [[File:CoreUSB_Ble_Sensorhub.jpg|600px|center|thumb]] *Setup 2:Connect the lantern to Sensorhub’s D6 pin and photosensitive sensor to A0. [[file:mCookie-sensorhub_rule.JPG|thumb|800px|center]] [[File:light_colorled_ble.jpg|600px|center|thumb]] ==Software Debugging== *Setup 1:Build IDE, connect CoreUSB to your PC and download program code. [https://github.com/Microduino/Microduino_Tutorials/blob/master/MCookie_Tutorial/ble_led_light/ble_led_light.ino ble_led_light] *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. [[File:Microduino_BT_Serial_1.png||300px|center|thumb]] *Setup 3:Click SCAN on top right, select Microduino and connect. [[File:Microduino_BT_Serial_2.png||300px|center|thumb]] *Setup 4:You’ll see Serial Present on top right in default and when it turns to Seerial Ready, you can have normal communication. [[File:Microduino_BT_Serial_3.png||300px|center|thumb]] *APP description: **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. **You can adjust the brightness via the circular ring. **and control the light via the bottom switch. [[File:Microduino_BT_Serial_5.png||300px|center|thumb]] Code description: *Choose to adopt Bluetooth control when it is connected. The use of BT serial port needs to be choosed accoding to wire jumpers oon the board. The default serial port is 0:Serial. “ble()”function is for Bluetooth recieving data and lantern controlling. *Ambient light pre-set value—by changing the light value, you can choose under which brightness can turn on the light. <source lang="cpp"> #define Light 100 </source> *Read brightness function <source lang="cpp"> ightValue = analogRead(Light_PIN); </source> *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. <source lang="cpp"> if (!color_en && lightValue < Light) { rainbowCycle(10, 255, 0, 0, 0); rainbowCycle(10, 255, 0, 0, 1); rainbowCycle(10, 0, 255, 0, 0); rainbowCycle(10, 0, 255, 0, 1); rainbowCycle(10, 0, 0, 255, 0); rainbowCycle(10, 0, 0, 255, 1); rainbowCycle(10, 255, 0, 225, 0); rainbowCycle(10, 255, 0, 225, 1); rainbowCycle(10, 247, 139, 5, 0); rainbowCycle(10, 247, 139, 5, 1); rainbowCycle(10, 255, 255, 0, 0); rainbowCycle(10, 255, 255, 0, 1); rainbowCycle(10, 0, 255, 255, 0); rainbowCycle(10, 0, 255, 255, 1); for (int i = 0; i < 3; i++) rainbow(30); } else if (!color_en) colorSet(strip.Color(0, 0, 0));</source> ==Result== 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. ==Video== |}
该页面使用的模板:
模板:Language
(
查看源代码
)
模板:Nmbox
(
查看源代码
)
返回至
Bluetooth Night Light
。
导航菜单
个人工具
创建账户
登录
名字空间
页面
讨论
变种
视图
阅读
查看源代码
查看历史
更多
搜索
Welcome
首页
创客大赛
大赛详情
3D打印
安装月球车
图形化编程
操控月球车
升级月球车
编程工具下载
软件下载
Arduino
Processing
Mixly
Scratch
模块套件
Microduino 102
mCookie 102
mCookie 202
mCookie 302
IBC
其他
应用套件
四轴飞行器
平衡车
小车CUBE
音乐播放器
刷卡音乐播放器
wifi气象站
彩虹音乐触摸灯
分贝检测仪
迎门汇报
LED点阵时钟
LED点阵屏幕
硬件
mCookie
Sensor
Microduino
MicroWrt
MicroNux
MicroRobot-Core
MicroRobot-CoreESP
ideaBoard
ideaBox
MicroMV
MicroAI
帮助
常见问题
帮助
工具
链入页面
相关更改
特殊页面
页面信息