“Main Page”的版本间的差异

来自Microduino Wikipedia
跳转至: 导航搜索
下载程序
 
第1行: 第1行:
{{Language|Microduino Lattice clock}}
+
{{Language|Main Page}}
  
{| style="width: 800px;"
+
{| class="titlebox" width="800px" style="border:2px solid #000000; -moz-border-radius:5px 5px 5px 5px; -webkit-border-radius:5px 5px 5px 5px;" cellspacing=0 cellpadding=0
 +
! style="background:#000000; border-radius:2px; padding:5px; color:#ffffff;" | <div style="font-size:180%;text-align:center;">Welcome to the Microduino Wiki</div>
 
|-
 
|-
 
|
 
|
==概述==
+
{|  
*项目名称:Microduino 点阵级联时钟
 
*目的:级联四个[[Microduino-Module Dot Matrix/zh]]模块
 
**通过蓝牙与android手机通讯
 
**实现实时显示电子时钟
 
*难度:中级
 
*耗时:2小时
 
*制作者:peng
 
 
 
==材料清单==
 
*Microduino设备
 
{|class="wikitable"
 
 
|-
 
|-
|模块||数量||功能
+
|[[file:wiki.jpg|800px|left]]
 +
|}
 
|-
 
|-
|[[Microduino-Core/zh]]||1||核心板
+
|
 +
{|  
 
|-
 
|-
|[[Microduino-USBTTL/zh]] ||1||下载程序
+
|     Small size, great power! Microduino and mCookie bring powerful, small, stackable electronic hardware to makers, designers, engineers, students and curious tinkerers of all ages. Build open-source projects or create innovative new ones.
|-
+
<br>
|[[Microduino-RTC/zh]]||1||读取时间
+
All Microduino and mCookie boards are Arduino-compatible. Experienced makers can write their own programs in the Arduino IDE and upload their code to the hardware via USB, while novices can take advantage of open-source Scratch programming to drag and drop pre-written code.
|-
 
|[[Microduino-BT/zh]]||1||手机与Core通讯
 
|-
 
|[[Microduino-Module Dot Matrix/zh]]||4||显示
 
|-
 
|[[Microduino-Cube-S1/zh]]||1||扩展
 
|}
 
*其他设备
 
{|class="wikitable"
 
|-
 
|USB数据线||1||供电,下载
 
|}
 
  
==程序下载==
+
<br>
 +
Microduino dramatically decreases the size and cost of design prototyping, improves flexibility of Arduino-compatible boards, and enhances the user experience for any age or skill level.
 +
<br>
  
请保持更新下载Microduino官方最新的IDE
 
  
从下面链接下载程序:
+
Microduino and mCookie modules, sensors and accessories are perfect for idea realization, prototype development, low-volume production and old-fashioned fun.
[https://github.com/wasdpkj/Dot_Maxtrix_Clock Dot-Matrix-Clock.ino]
 
===堆叠模块===
 
*将microduino模块叠在一块([[Microduino-Core/zh]]+[[Microduino-USBTTL/zh]]  +[[Microduino-RTC/zh]]1 +[[Microduino-BT/zh]] + [[Microduino-Cube-S1/zh]])
 
*然后[[Microduino-Module Dot Matrix/zh]]用传感器线与[[Microduino-Cube-S1/zh]]连接。
 
*注意:最好不要将所有模块堆叠在一起之后再上传程序
 
  
===配置环境===
+
|}
*打开Arduino IDE for Microduino,环境,(搭建参考:'''[[AVR核心:Getting started/zh]]''')
+
|}
*确认“板卡([[Microduino-Core/zh]])”与“处理器(Atmega328P@16M,5V)”选择无误,并选中对应端口号(COMX)
 
  
===下载程序===
+
<br>
*打开你所下载的项目中“Dot-Matrix-Clock.ino”程序
 
*点击"→"按钮下载程序到开发板上
 
  
如果成功在点阵屏上就可以显示时间了。
+
=Microduino Upin27 Series=
[[File:DotMatrix1.jpg|600px|center|thumb]]
+
{| style="width: 800px;"| colspan="2" |
 +
|-
 +
| style="width:400px" align="left"|
 +
=='''[[Microduino Series]]'''==
 +
<br>
 +
[[file:Microduino-CoreList-rect.jpg|200px|left]]
  
===蓝牙下载===
+
| style="width:400px" align="left"|
通过蓝牙调整时间,如果RTC长时间不供电的话,时间将会出错,但是为了避免每次需要通过下载程序的办法来调整时间,我们采用BT(4.0)结合Android设备来调节时间。使用手机切换显示界面。客户端在程序文件夹里面 '''[[File:blueclock.zip]]'''
+
=='''[[Microduino Tutorials and Projects]]'''==
*打开手机蓝牙
+
<br>
*打开应用程序,搜索蓝牙设备,连接到你的蓝牙设备。连接成功就可以控制,否则进行重新连接。
+
[[file:Microduino-Projects.png|400px|left]]
*成功就可以通过button来控制。需要长按按钮,等界面切换就可以松开botton。可以显示日期、星期。等界面显示完毕又返回现实时间。
+
|-
[[File:DcolorMatrix ble.jpg|400px|center|thumb]]
+
|}
 +
<br><br>
  
==拼装过程(IIC地址设置)==
+
=mCookie UPin27 Series=
 +
{| style="width: 800px;" | colspan="2" |
 +
|-
 +
| style="width:400px" align="left"|
 +
=='''[[mCookie Series]]'''==
 +
<br>
 +
[[file:mCookie-rect.jpg|200px|left]]
  
步骤一:Microduino-Module Dot Matrix采用IIC驱动,由于在I2C总线上的每个设备都必须有一个唯一的地址,因此需要更改,否则你会得到很多奇怪的现象。
+
| style="width:400px" align="left"|
 +
== '''[[mCookie Tutorials and Projects]]'''==
 +
<br>
 +
[[file:mCookie-Projects.jpg|400px|left]]
 +
|-
 +
|}
 +
<br><br>
  
如何更改IIC地址,在《开源LED点阵屏幕》教程中有介绍怎么设置Dot Matrix模块的IIC地址,在这里再简单说下。
+
{| style="width: 800px;" | colspan="2" |
  
*先按着模块背面的按键,再接上电源,待屏幕变白色后应立即放开按键,屏幕有多少个白格子代表iic地址就是多少。
+
=MicroWrt HPin44 Series=
 +
|-
 +
| style="width:400px" align="left"|
 +
=='''[[MicroWrt Series]]'''==
 +
<br>
 +
[[file:MicroWRT-rect.jpg|200px|left]]
  
*慢按背面按键是地址加一
+
| style="width:400px" align="left"|
 +
=='''[[MicroWrt Tutorials and Projects]]'''==
 +
<br>
 +
[[file:MicroWrt-Extension-rect.jpg|200px|left]]
 +
|-
 +
|
 +
|}
 +
<br>
 +
<br>
  
*快按背面按键是地址减一
+
{| style="width: 800px;" | colspan="2" |
  
按住不放待屏幕变灭或有变化即可设置成功
+
=MicroPi HPin88 Series=
 +
|-
 +
| style="width:400px" align="left"|
 +
=='''[[MicroPi Series]]'''==
 +
<br>
 +
[[file:MicroCookie-Zen-rect.jpg|200px|left]]
  
如果所有格子都亮白色也不可认为此模块的iic地址就是64,最好手动调到64
+
| style="width:400px" align="left"|
 +
=='''[[MicroPi Tutorials and Projects]]'''==
 +
<br>
 +
[[file:MicroCookie-Nux-rect.jpg|200px|left]]
 +
|-
 +
|}
 +
<br><br>
  
程序实现:
+
{| style="width: 800px;" | colspan="2" |
  uint8_t Addr[MatrixPix_X][MatrixPix_Y] = {               
 
{ 64, 63, 62, 61}};       //1x4
 
  
定义了四个Dot Matrix模块的IIC地址是64,63,62,61,排列方式是1x4。
+
=Microduino Sensor Series=
 +
|-
 +
| style="width:400px" align="left"|
 +
=='''[[Microduino Sensor Series]]'''==
 +
<br>
 +
[[file:Microduino-sensors.jpg|200px|left]]
  
步骤二:将更改了IIC的地址底板级联,只有按定义的地址顺序从左往右连接好Dot Matrix模块就行。
+
| style="width:400px" align="left"|
  
步骤三:接上核心模块(Microduino Core+Microduino USBTTL+Microduino RTC+Microduino BT)
+
=='''[[Microduino Sensor Tutorials and Projects]]'''==
注意:因为一块控制板最多能叠加两块Microduino模块。BT采用软串口mySerial,玩家可根据情况更改蓝牙模块跳线来改变串口。
+
<br>
 +
[[file:Microduino-sensors.jpg|200px|left]]
 +
|}
 +
<br><br>
  
==代码说明==
 
下载:[[File:Dot Maxtrix Clock.zip]]
 
库函数分析:
 
  
*'''蓝牙''':
+
=Additional Information=
  
  while (mySerial.available()) {...}
+
Fritzing: '''[[File:Microduino-Fritzing.zip]]'''<br>
当串口有数据时有效。
+
Microduino Community Projects: https://www.microduino.cc/project <br>
  mySerial.read()
+
Microduino IDE Github Repository: [[https://github.com/wasdpkj/Microduino-IDE Microduino-IDE]]<br>
读取软串口传输的数据
+
Microduino Getting Started: '''[[AVR Core: Getting Started]]''' <br/>
    if (c == 't' && buffer_num == 0 && !buffer_sta_d)
+
mCookie Frequently Asked Questions: [[mCookie Frequently Asked Questions|FAQ]]
      buffer_sta_t = true;
 
    if (c == 'm' && buffer_num == 0 && !buffer_sta_t)
 
      buffer_sta_d = true;
 
判断是日期数据还是时间数据
 
  strstr((char *)buffer, "t")
 
返回buffer中第一次出现"t"字符的地址
 
  sscanf((char *)strstr((char *)buffer, "t"), "t%d,%d,%d,%d,%d,%d", &sta[0], &sta[1], &sta[2], &sta[3], &sta[4], &sta[5]);
 
从buffer中"t"字符第一次出现的地址起,按%d格式读取数值写入到sta[]中
 
  bleUpdata()
 
通过软串口传输数据,手机上按钮只有在按下 情况下发送指定字符,如果松开就就发送“0”字符,这样在没有按下情况下,将会一直显示时间。 
 
  
*'''RTC''':
+
<br>
 
+
<br>
  rtc.getDate();
 
  rtc.getTime();
 
  setTime(rtc.getHour(), rtc.getMinute(), rtc.getSecond(),  rtc.getDay(), rtc.getMonth(), rtc.getYear())
 
获得rtc的日期时间数据
 
  rtc.setDate(day(), weekday() , month(), 0, year() - 2000); //day, weekday, month, century(1=1900, 0=2000), year(0-99)
 
  rtc.setTime(hour(), minute() , second()); //hr, min, sec
 
按时,分,秒,日,月,年设置
 
 
 
*'''display:'''
 
 
 
  display.print(second() % 2 ? " " : ":");
 
闪速的秒钟,用过判断秒是否能被2整除,如果能就显示,否者不显示
 
  display.getDeviceAddr(a)
 
获得设备IIC地址
 
  display.getWidth(),display.getHeight()
 
返回X,Y坐标
 
  display.setLedColor(x, y, random(0, 255), random(0, 255), random(0, 255))
 
随机设置每个LED的颜色
 
  display.clearDisplay()
 
清理屏幕显示
 
  display.setColor(X,Y,Z)
 
设置全屏颜色 X:红色  Y:绿色  Z:蓝色
 
  display.writeString("string", MODE, time ,z)
 
string:任意字符串, MODE:MODE_H横向显示字符/MODE_V竖向显示字符, time:显示的时间(字符在屏幕流动速度) ,z:X/Y坐标
 
 
 
通过读取RTC时钟,将特定的数值以坐标形式显示出来就行。
 
注意:你需要将BT模块和Core核心模块叠加在同一个板子上进行调试,因为LED点阵级联的是电源、地、IIC四个引脚,而BT默认的则是软串口(D4、D5),因此需要将BT模块和Core核心模块叠加在一起。
 
 
 
通过Android设备来调试,前提是要4.3以上的系统才能支持BT(4.0)模块,同时你可以下载一个蓝牙串口助手来进行调试。
 
*教程中下载blueclock APP。
 
*点击sync time按键同步手机时间。
 
*可以在输入栏写上"hello microduino",点击发送会在屏幕上显示出来
 
 
 
==FAQ==
 
*Q:怎么知道IIC地址
 
**A:先按着模块背面的按键,再接上电源,待屏幕变白色后应立即放开按键,屏幕有多少个白格子代表iic地址就是多少
 
*Q:点阵安装的方向
 
**A:按Dot Matrix模块定义的地址顺序从左往右连接好模块就行
 
*Q:蓝牙串口连接需要跳线吗
 
**A:蓝牙模块采用软串口mySerial(4,5)是蓝牙模块硬件默认的,不需要跳线。可参考蓝模块配置[[Microduino-Module BLE/zh]]。
 
  
 +
{| class="wikitable" style="width:800px;border:2px solid #000000; -moz-border-radius:5px 5px 5px 5px; -webkit-border-radius:5px 5px 5px 5px;" cellspacing=0 cellpadding=0
 +
|
 +
This Wiki was built on '''June 11, 2013'''. There are '''[[Special:SpecialPages|{{NUMBEROFARTICLES}} pages]]''', '''[[Special:NewFiles|{{NUMBEROFFILES}} files uploaded]]''' and '''[[Special:Statistics|{{NUMBEROFEDITS}} revisions]]'''. <br>To learn more information, please visit '''[[Special:RecentChanges|Recent Changes]]'''.
 +
<br>
 +
<br>Technical Support: support@microduino.cc
 +
<br>Business Inquiries: sales@microduino.cc
 
|}
 
|}

2016年3月11日 (五) 03:43的最新版本

Language English


Welcome to the Microduino Wiki
Small size, great power! Microduino and mCookie bring powerful, small, stackable electronic hardware to makers, designers, engineers, students and curious tinkerers of all ages. Build open-source projects or create innovative new ones.


All Microduino and mCookie boards are Arduino-compatible. Experienced makers can write their own programs in the Arduino IDE and upload their code to the hardware via USB, while novices can take advantage of open-source Scratch programming to drag and drop pre-written code.


Microduino dramatically decreases the size and cost of design prototyping, improves flexibility of Arduino-compatible boards, and enhances the user experience for any age or skill level.


Microduino and mCookie modules, sensors and accessories are perfect for idea realization, prototype development, low-volume production and old-fashioned fun.


Microduino Upin27 Series

Microduino Series


Microduino Tutorials and Projects




mCookie UPin27 Series

mCookie Series


mCookie Tutorials and Projects




MicroWrt HPin44 Series

MicroWrt Series


MicroWrt Tutorials and Projects




MicroPi HPin88 Series

MicroPi Series


MicroCookie-Zen-rect.jpg

MicroPi Tutorials and Projects


MicroCookie-Nux-rect.jpg



Microduino Sensor Series

Microduino Sensor Series


Microduino Sensor Tutorials and Projects





Additional Information

Fritzing: 文件:Microduino-Fritzing.zip
Microduino Community Projects: https://www.microduino.cc/project
Microduino IDE Github Repository: [Microduino-IDE]
Microduino Getting Started: AVR Core: Getting Started
mCookie Frequently Asked Questions: FAQ



This Wiki was built on June 11, 2013. There are 1,708 pages, 26,539 files uploaded and 43,324 revisions.
To learn more information, please visit Recent Changes.

Technical Support: support@microduino.cc
Business Inquiries: sales@microduino.cc