Difference between revisions of "Open Source LED Dot Matrix Clock"
(Created page with "{{Language|Microduino Lattice clock}} {| style="width: 1000px;" |- | ==Outline== *Project:Microduino dot matrix cascade clock *Objective:Real-time display clocks and char...") |
|||
Line 11: | Line 11: | ||
*Maker:peng | *Maker:peng | ||
*Introduction: | *Introduction: | ||
− | **Cascade the four [[Microduino- | + | **Cascade the four [[Microduino- Dot Matrix]] module. |
**Use a Bluetooth module to calibrate the time that the dot matrix displays through the mobile APP. | **Use a Bluetooth module to calibrate the time that the dot matrix displays through the mobile APP. | ||
**You can also send any character to dot matrix module to display through APP. | **You can also send any character to dot matrix module to display through APP. | ||
Line 52: | Line 52: | ||
==Principle of the Experiment== | ==Principle of the Experiment== | ||
− | *Features of the '''[[Microduino- | + | *Features of the '''[[Microduino- Dot Matrix]]''' module: |
**The module is 8x8 dot matrix, and the size is 60mm*60mm; | **The module is 8x8 dot matrix, and the size is 60mm*60mm; | ||
**The color display quality of each dot is 24 bits, and the color display effect is 32k; | **The color display quality of each dot is 24 bits, and the color display effect is 32k; | ||
**Support the IIC communication protocol. The IIC address can be set(1~64). The dot matrix sequence adopts the plane rectangular coordinate system, which is easy to control; | **Support the IIC communication protocol. The IIC address can be set(1~64). The dot matrix sequence adopts the plane rectangular coordinate system, which is easy to control; | ||
− | *Use '''[[Microduino- | + | *Use '''[[Microduino- BLE]]''' Bluetooth module to communicate with the mobile phone: |
**The mobile APP sends the string to '''core module''' through the '''Bluetooth module''', and display on the '''dot matrix module'''. | **The mobile APP sends the string to '''core module''' through the '''Bluetooth module''', and display on the '''dot matrix module'''. | ||
Line 120: | Line 120: | ||
|width="50%" valign="top" align="left"| | |width="50%" valign="top" align="left"| | ||
*'''Step5''': | *'''Step5''': | ||
− | **Use the double-sided adhesive to stick the bottom side of the '''[[Microduino- | + | **Use the double-sided adhesive to stick the bottom side of the '''[[Microduino- Dot Matrix]]''' module, '''and the face of the module which has letters on it faces down'''. Stick inside the shell in turn. |
|width="50%" valign="top" align="left"| | |width="50%" valign="top" align="left"| | ||
[[File:DotMatrixjiegou4.jpg|500px|center|thumb]] | [[File:DotMatrixjiegou4.jpg|500px|center|thumb]] | ||
Line 135: | Line 135: | ||
***'''[[Microduino-RTC]]''' | ***'''[[Microduino-RTC]]''' | ||
***'''[[Microduino-BT]]''' | ***'''[[Microduino-BT]]''' | ||
− | **Connect the '''[[Microduino- | + | **Connect the '''[[Microduino- Dot Matrix]]''' module to the '''IIC port''' of '''[[Microduino-Cube-S1]]'''. |
**Use doubled-sided adhesive to stick '''[[Microduino-Cube-S1]]'''on the back shell. | **Use doubled-sided adhesive to stick '''[[Microduino-Cube-S1]]'''on the back shell. | ||
Line 229: | Line 229: | ||
**A:Refer to '''[[https://www.microduino.cn/wiki/index.php/Microduino-Module_Dot_Matrix/zh#.E7.82.B9.E9.98.B5.E5.9C.B0.E5.9D.80.E8.AE.BE.E7.BD.AE.E6.96.B9.E6.B3.95 The method of setting the IIC address of the dot matrix module]]''' tutorial. | **A:Refer to '''[[https://www.microduino.cn/wiki/index.php/Microduino-Module_Dot_Matrix/zh#.E7.82.B9.E9.98.B5.E5.9C.B0.E5.9D.80.E8.AE.BE.E7.BD.AE.E6.96.B9.E6.B3.95 The method of setting the IIC address of the dot matrix module]]''' tutorial. | ||
*Q:'''What order do the lattice modules connect according to?''' | *Q:'''What order do the lattice modules connect according to?''' | ||
− | **A:Connect from left to right according to the IIC address order that is set for '''[[Microduino- | + | **A:Connect from left to right according to the IIC address order that is set for '''[[Microduino- Dot Matrix]]''' module . |
*Q:'''How to know whether the mobile phone has been connected with the Bluetooth module?''' | *Q:'''How to know whether the mobile phone has been connected with the Bluetooth module?''' | ||
**A:When there is connected displayed on the top left in the APP interface, it is connected successfully. | **A:When there is connected displayed on the top left in the APP interface, it is connected successfully. | ||
*Q:'''What is the meaning of the jumper of the Bluetooth module?''' | *Q:'''What is the meaning of the jumper of the Bluetooth module?''' | ||
− | **A:The Bluetooth module used in this tutorial is the default soft serial port mySerial(4,5), so don’t need to jump line. You can refer to the blue module configuration for in-depth knowledge of the Bluetooth. [https://www.microduino.cn/wiki/index.php/Microduino-Module_BLE/zh#.E5.BC.95.E8.84.9A.E8.AF.B4.E6.98.8E Microduino- | + | **A:The Bluetooth module used in this tutorial is the default soft serial port mySerial(4,5), so don’t need to jump line. You can refer to the blue module configuration for in-depth knowledge of the Bluetooth. [https://www.microduino.cn/wiki/index.php/Microduino-Module_BLE/zh#.E5.BC.95.E8.84.9A.E8.AF.B4.E6.98.8E Microduino- BLE pin elucidation]. |
|} | |} |
Revision as of 04:23, 7 April 2016
Language: | English • 中文 |
---|
ContentsOutline
Bill of Materials
Principle of the Experiment
Program Download
Programming
**Note:Please upload programs before stacking all modules together.
Installation
Operating Instruction
Bluetooth Connection
Display Text
Code InstructionCode to loading:File:Dot Maxtrix Clock.zip Dot Matrix Cascadeuint8_t Addr[MatrixPix_X][MatrixPix_Y] = { { 64, 63, 62, 61}}; Define the IIC addresses of the four Dot Matrix modules as 64, 63, 62, and 61, and the arrangement type is 1x4. Bluetoothwhile (mySerial.available()) {...} It is effective when there is a serial port data. mySerial.read() Red the data which is transferred by the UART. if (c == 't' && buffer_num == 0 && !buffer_sta_d) buffer_sta_t = true; if (c == 'm' && buffer_num == 0 && !buffer_sta_t) buffer_sta_d = true; Judge it is date or time data. strstr((char *)buffer, "t") Return the address where the "t" character first appears in buffer. 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]); From the address where the "t" character first appears in buffer, read the value according to the %d type, and write into sta[]. bleUpdata() Transfer data through UART, only by clicking the button on your mobile phone to send the specified character. If loosing, it will send character“0”. So without press, it will always show time. RTCrtc.getDate(); rtc.getTime(); setTime(rtc.getHour(), rtc.getMinute(), rtc.getSecond(), rtc.getDay(), rtc.getMonth(), rtc.getYear()) Get the date and time data of 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 Set by hour, minute, second, day, month, and year format. Displaydisplay.print(second() % 2 ? " " : ":"); The second flashes, after being used justify whether the second can be exactly divided by 2. If it can, show it. If not, don’t show. display.getDeviceAddr(a) Get the IIC address of the device. display.getWidth(),display.getHeight() Return the X,Y coordinates. display.setLedColor(x, y, random(0, 255), random(0, 255), random(0, 255)) Set the color of each LED randomly. display.clearDisplay() Clean up the screen. display.setColor(X,Y,Z) Set the color of the full screen X:Red Y:Green Z:Blue display.writeString("string", MODE, time ,z) string:any string. MODE:MODE_H displays characters horizontally. /MODE_V displays characters vertically. time:The displayed time(the flow velocity of the characters on the screen). z:X/Y coordinate. Through reading the RTC color, display the specific values in the form of coordinates. FAQ
|