查看“MWatch”的源代码
←
MWatch
跳转至:
导航
、
搜索
因为以下原因,您没有权限编辑本页:
您所请求的操作仅限于该用户组的用户使用:
用户
您可以查看与复制此页面的源代码。
{{Language| mWatch }} {| style="width: 800px;" |- | ==Objective== Use mCookie to build a simple watch. [[File:mWatch-ok.jpg|400px|center]] ==Principle== Acquire time via RTC module and display time on the OLED screen. [[File: mWatch-sch.jpg|600px|center]] ==Equipment== {|class="wikitable" |- |Module||Number||Function |- |[[mCookie-CoreUSB]]||1||Core board |- |[[mCookie-RTC]]||1||Clock module |- | [[mCookie-OLED]]||1||Display screen |- | [[Microduino-BM]]||1||Battery management |} [[File: mWatch-module.jpg|600px|center]] ==Preparation== *Setup 1:Connect CoreUSB with your PC/MAC with a USB cable and open Arduino IDE. [[File:CoreUSB_Ble_pc.jpg|600px|center]] *Setup 2:Click file > Examples > mCookie > _202_mWatch and load program. [[File: l mWatch-ino.jpg|600px|center]] * Setup 3:Load the code and copy the program code to IDE. Select the right board and COM port for program download after compiling. [[File: mWatch-com.jpg|600px|center]] ==Program Description== *" draw()" function is OLED display interface and it displays characters with a few steps: **Set font **Set font coordinate place **Print characters to be displayed *setRtcTime() is time setting function. For example setRtcTime(15, 5, 18, 1, 10, 22, 33) presents 33 seconds at 10: 22 on Monday, 18, May, 2015. <source lang="cpp"> void setRtcTime (byte _year, byte _month, byte _day, byte _week, byte _hour, byte _minute, byte _sec) { //clear out all the registers rtc.initClock(); rtc.setDate(_day, _week, _month, 0, _year); rtc.setTime(_hour, _minute, _sec); } </source> ==Code Debugging== Find this code section and set the initial time of the RTC module. Re-load the code to CoreUSB after setting. <source lang="cpp"> setRtcTime(15, 5, 18, 1, 00, 00, 00); </source> Enter "//" before this code section after loading the program, the whole section will turn gray and then re-load the program and you'll see RTC can time automatically. ("//" means "comment out the program code and do not perform ". In this way, you needn't run the program after calibration or the system will need re-set time after power-fail and re-start. ) <source lang="cpp"> //setRtcTime(15, 5, 18, 1, 00, 00, 00); </source> ==Hardware Buildup == *Setup 1:Connect the activated battery box and BM module. [[File:CoreUSB_Ble_steup2.jpg|600px|center]] *Setup 2:Stack all modules together without fixed order and finish circuit buildup. [[File:mWatch_steup3.jpg|600px|center]] ==Result== The first line shows data and week. The second line displays: time and the third displays custom text. [[File:legao_mWatch.jpg|600px|center]] ==Video== |}
该页面使用的模板:
模板:Language
(
查看源代码
)
模板:Nmbox
(
查看源代码
)
返回至
MWatch
。
导航菜单
个人工具
创建账户
登录
名字空间
页面
讨论
变种
视图
阅读
查看源代码
查看历史
更多
搜索
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
帮助
常见问题
帮助
工具
链入页面
相关更改
特殊页面
页面信息