差别
这里会显示出您选择的修订版和当前版本之间的差别。
后一修订版 | 前一修订版 | ||
wm_wiki:four_digital_dispaly_module:manual [2019/02/20 14:45] wangyueyu 创建 |
wm_wiki:four_digital_dispaly_module:manual [2020/05/12 15:40] (当前版本) juneral [3.1. 图形化编程指南] |
||
---|---|---|---|
行 1: | 行 1: | ||
====== 数码管模块 ====== | ====== 数码管模块 ====== | ||
+ | {{ :wm_wiki:four_digital_dispaly_module:pasted:20200306-162304.png }} | ||
+ | ===== 1. 模块概述 ===== | ||
+ | <html><body> | ||
+ | <p class=MsoNormal style='mso-margin-top-alt:auto;mso-margin-bottom-alt:auto; | ||
+ | text-indent:21.0pt'><span style='font-size:16.0pt;font-family:等线;mso-ascii-theme-font: | ||
+ | minor-fareast;mso-fareast-theme-font:minor-fareast;mso-hansi-theme-font:minor-fareast'>数码管模块是一个用于显示数字的模块,显示数字范围:<span | ||
+ | lang=EN-US>-999~9999</span>,可显示浮点数。可用于数值可视化项目,如温度、湿度、计数等需要数字显示的场景。</span><span | ||
+ | lang=EN-US style='font-family:等线;mso-ascii-theme-font:minor-fareast;mso-fareast-theme-font: | ||
+ | minor-fareast;mso-hansi-theme-font:minor-fareast'><o:p></o:p></span></p> | ||
+ | </body></html> | ||
+ | ===== 2. 模块参数 ===== | ||
+ | |||
+ | <html><body> | ||
+ | <div align=center> | ||
+ | |||
+ | <table class=MsoNormalTable border=1 cellspacing=0 cellpadding=0 | ||
+ | style='border-collapse:collapse;border:none;mso-border-alt:solid #5B9BD5 3.0pt; | ||
+ | mso-border-themecolor:accent5;mso-yfti-tbllook:1184;mso-padding-alt:0cm 5.4pt 0cm 5.4pt'> | ||
+ | <tr style='mso-yfti-irow:0;mso-yfti-firstrow:yes'> | ||
+ | <td width=170 valign=top style='width:127.4pt;border-top:solid #5B9BD5 3.0pt; | ||
+ | mso-border-top-themecolor:accent5;border-left:solid #5B9BD5 3.0pt;mso-border-left-themecolor: | ||
+ | accent5;border-bottom:solid white 2.25pt;mso-border-bottom-themecolor:background1; | ||
+ | border-right:none;background:#5B9BD5;mso-background-themecolor:accent5; | ||
+ | padding:0cm 5.4pt 0cm 5.4pt'> | ||
+ | <p class=MsoNormal align=center style='mso-margin-top-alt:auto;text-align: | ||
+ | center'><span style='font-size:18.0pt;color:white;mso-themecolor:background1'>参数</span><span | ||
+ | lang=EN-US style='color:black;mso-color-alt:windowtext'><u1:p></u1:p></span></p> | ||
+ | </td> | ||
+ | <td width=386 valign=top style='width:289.6pt;border-top:solid #5B9BD5 3.0pt; | ||
+ | mso-border-top-themecolor:accent5;border-left:none;border-bottom:solid white 2.25pt; | ||
+ | mso-border-bottom-themecolor:background1;border-right:solid #5B9BD5 3.0pt; | ||
+ | mso-border-right-themecolor:accent5;background:#5B9BD5;mso-background-themecolor: | ||
+ | accent5;padding:0cm 5.4pt 0cm 5.4pt'> | ||
+ | <p class=MsoNormal align=center style='mso-margin-top-alt:auto;text-align: | ||
+ | center'><span style='font-size:18.0pt;color:white;mso-themecolor:background1'>值<span | ||
+ | lang=EN-US>/</span>描述</span><span lang=EN-US style='color:black;mso-color-alt: | ||
+ | windowtext'><u1:p></u1:p></span></p> | ||
+ | </td> | ||
+ | </tr> | ||
+ | <tr style='mso-yfti-irow:1'> | ||
+ | <td width=170 valign=top style='width:127.4pt;border-top:none;border-left: | ||
+ | solid #5B9BD5 3.0pt;mso-border-left-themecolor:accent5;border-bottom:solid white 1.0pt; | ||
+ | mso-border-bottom-themecolor:background1;border-right:solid white 1.0pt; | ||
+ | mso-border-right-themecolor:background1;mso-border-top-alt:solid white .5pt; | ||
+ | mso-border-top-themecolor:background1;mso-border-alt:solid white .5pt; | ||
+ | mso-border-themecolor:background1;mso-border-left-alt:solid #5B9BD5 3.0pt; | ||
+ | mso-border-left-themecolor:accent5;background:#5B9BD5;mso-background-themecolor: | ||
+ | accent5;padding:0cm 5.4pt 0cm 5.4pt'> | ||
+ | <p class=MsoNormal align=center style='mso-margin-top-alt:auto;text-align: | ||
+ | center'><b><span style='font-size:16.0pt;color:white;mso-themecolor:background1'>工作电压</span></b><span | ||
+ | lang=EN-US style='color:black;mso-color-alt:windowtext'><u1:p></u1:p></span></p> | ||
+ | </td> | ||
+ | <td width=386 valign=top style='width:289.6pt;border-top:none;border-left: | ||
+ | none;border-bottom:solid white 1.0pt;mso-border-bottom-themecolor:background1; | ||
+ | border-right:solid #5B9BD5 3.0pt;mso-border-right-themecolor:accent5; | ||
+ | mso-border-top-alt:solid white .5pt;mso-border-top-themecolor:background1; | ||
+ | mso-border-top-alt:solid white .5pt;mso-border-top-themecolor:background1; | ||
+ | mso-border-bottom-alt:solid white .5pt;mso-border-bottom-themecolor:background1; | ||
+ | mso-border-right-alt:solid #5B9BD5 3.0pt;mso-border-right-themecolor:accent5; | ||
+ | background:#5B9BD5;mso-background-themecolor:accent5;padding:0cm 5.4pt 0cm 5.4pt'> | ||
+ | <p class=MsoNormal align=center style='mso-margin-top-alt:auto;text-align: | ||
+ | center'><span lang=EN-US style='font-size:16.0pt;color:white;mso-themecolor: | ||
+ | background1'>DC 5V<u1:p></u1:p></span></p> | ||
+ | </td> | ||
+ | </tr> | ||
+ | <tr style='mso-yfti-irow:2'> | ||
+ | <td width=170 valign=top style='width:127.4pt;border-top:none;border-left: | ||
+ | solid #5B9BD5 3.0pt;mso-border-left-themecolor:accent5;border-bottom:none; | ||
+ | border-right:solid white 1.0pt;mso-border-right-themecolor:background1; | ||
+ | mso-border-left-alt:solid #5B9BD5 3.0pt;mso-border-left-themecolor:accent5; | ||
+ | mso-border-right-alt:solid white .5pt;mso-border-right-themecolor:background1; | ||
+ | background:#5B9BD5;mso-background-themecolor:accent5;padding:0cm 5.4pt 0cm 5.4pt'> | ||
+ | <p class=MsoNormal align=center style='mso-margin-top-alt:auto;text-align: | ||
+ | center'><b><span style='font-size:16.0pt;color:white;mso-themecolor:background1'>通信方式</span></b><span | ||
+ | lang=EN-US style='color:black;mso-color-alt:windowtext'><u1:p></u1:p></span></p> | ||
+ | </td> | ||
+ | <td width=386 valign=top style='width:289.6pt;border:none;border-right:solid #5B9BD5 3.0pt; | ||
+ | mso-border-right-themecolor:accent5;background:#5B9BD5;mso-background-themecolor: | ||
+ | accent5;padding:0cm 5.4pt 0cm 5.4pt'> | ||
+ | <p class=MsoNormal align=center style='mso-margin-top-alt:auto;text-align: | ||
+ | center'><span lang=EN-US style='font-size:16.0pt;color:white;mso-themecolor: | ||
+ | background1'>WM</span><span style='font-size:16.0pt;color:white;mso-themecolor: | ||
+ | background1'>单总线</span><span lang=EN-US style='color:black;mso-color-alt: | ||
+ | windowtext'><u1:p></u1:p></span></p> | ||
+ | </td> | ||
+ | </tr> | ||
+ | <tr style='mso-yfti-irow:3'> | ||
+ | <td width=170 valign=top style='width:127.4pt;border:solid white 1.0pt; | ||
+ | mso-border-themecolor:background1;border-left:solid #5B9BD5 3.0pt;mso-border-left-themecolor: | ||
+ | accent5;mso-border-alt:solid white .5pt;mso-border-themecolor:background1; | ||
+ | mso-border-left-alt:solid #5B9BD5 3.0pt;mso-border-left-themecolor:accent5; | ||
+ | background:#5B9BD5;mso-background-themecolor:accent5;padding:0cm 5.4pt 0cm 5.4pt'> | ||
+ | <p class=MsoNormal align=center style='mso-margin-top-alt:auto;text-align: | ||
+ | center'><b><span style='font-size:16.0pt;color:white;mso-themecolor:background1'>显数范围</span></b></p> | ||
+ | </td> | ||
+ | <td width=386 valign=top style='width:289.6pt;border-top:solid white 1.0pt; | ||
+ | mso-border-top-themecolor:background1;border-left:none;border-bottom:solid white 1.0pt; | ||
+ | mso-border-bottom-themecolor:background1;border-right:solid #5B9BD5 3.0pt; | ||
+ | mso-border-right-themecolor:accent5;mso-border-top-alt:solid white .5pt; | ||
+ | mso-border-top-themecolor:background1;mso-border-bottom-alt:solid white .5pt; | ||
+ | mso-border-bottom-themecolor:background1;mso-border-right-alt:solid #5B9BD5 3.0pt; | ||
+ | mso-border-right-themecolor:accent5;background:#5B9BD5;mso-background-themecolor: | ||
+ | accent5;padding:0cm 5.4pt 0cm 5.4pt'> | ||
+ | <p class=MsoNormal align=center style='mso-margin-top-alt:auto;text-align: | ||
+ | center'><span lang=EN-US style='font-size:16.0pt;color:white;mso-themecolor: | ||
+ | background1'>-999~9999<o:p></o:p></span></p> | ||
+ | </td> | ||
+ | </tr> | ||
+ | <tr style='mso-yfti-irow:4'> | ||
+ | <td width=170 valign=top style='width:127.4pt;border-top:none;border-left: | ||
+ | solid #5B9BD5 3.0pt;mso-border-left-themecolor:accent5;border-bottom:solid white 1.0pt; | ||
+ | mso-border-bottom-themecolor:background1;border-right:solid white 1.0pt; | ||
+ | mso-border-right-themecolor:background1;mso-border-top-alt:solid white .5pt; | ||
+ | mso-border-top-themecolor:background1;mso-border-alt:solid white .5pt; | ||
+ | mso-border-themecolor:background1;mso-border-left-alt:solid #5B9BD5 3.0pt; | ||
+ | mso-border-left-themecolor:accent5;background:#5B9BD5;mso-background-themecolor: | ||
+ | accent5;padding:0cm 5.4pt 0cm 5.4pt'> | ||
+ | <p class=MsoNormal align=center style='mso-margin-top-alt:auto;text-align: | ||
+ | center'><b><span style='font-size:16.0pt;color:white;mso-themecolor:background1'>工作温度<span | ||
+ | lang=EN-US><o:p></o:p></span></span></b></p> | ||
+ | </td> | ||
+ | <td width=386 valign=top style='width:289.6pt;border-top:none;border-left: | ||
+ | none;border-bottom:solid white 1.0pt;mso-border-bottom-themecolor:background1; | ||
+ | border-right:solid #5B9BD5 3.0pt;mso-border-right-themecolor:accent5; | ||
+ | mso-border-top-alt:solid white .5pt;mso-border-top-themecolor:background1; | ||
+ | mso-border-top-alt:solid white .5pt;mso-border-top-themecolor:background1; | ||
+ | mso-border-bottom-alt:solid white .5pt;mso-border-bottom-themecolor:background1; | ||
+ | mso-border-right-alt:solid #5B9BD5 3.0pt;mso-border-right-themecolor:accent5; | ||
+ | background:#5B9BD5;mso-background-themecolor:accent5;padding:0cm 5.4pt 0cm 5.4pt'> | ||
+ | <p class=MsoNormal align=center style='mso-margin-top-alt:auto;text-align: | ||
+ | center'><span lang=EN-US style='font-size:16.0pt;color:white;mso-themecolor: | ||
+ | background1'>-40</span><span style='font-size:16.0pt;color:white;mso-themecolor: | ||
+ | background1'>℃<span lang=EN-US>~85 </span>℃<span lang=EN-US><o:p></o:p></span></span></p> | ||
+ | </td> | ||
+ | </tr> | ||
+ | <tr style='mso-yfti-irow:5;mso-yfti-lastrow:yes'> | ||
+ | <td width=170 valign=top style='width:127.4pt;border-top:none;border-left: | ||
+ | solid #5B9BD5 3.0pt;mso-border-left-themecolor:accent5;border-bottom:solid white 1.0pt; | ||
+ | mso-border-bottom-themecolor:background1;border-right:solid white 1.0pt; | ||
+ | mso-border-right-themecolor:background1;mso-border-top-alt:solid white .5pt; | ||
+ | mso-border-top-themecolor:background1;mso-border-alt:solid white .5pt; | ||
+ | mso-border-themecolor:background1;mso-border-left-alt:solid #5B9BD5 3.0pt; | ||
+ | mso-border-left-themecolor:accent5;background:#5B9BD5;mso-background-themecolor: | ||
+ | accent5;padding:0cm 5.4pt 0cm 5.4pt'> | ||
+ | <p class=MsoNormal align=center style='mso-margin-top-alt:auto;text-align: | ||
+ | center'><b><span style='font-size:16.0pt;color:white;mso-themecolor:background1'>尺寸大小<span | ||
+ | lang=EN-US><u1:p></u1:p><o:p></o:p></span></span></b></p> | ||
+ | </td> | ||
+ | <td width=386 valign=top style='width:289.6pt;border-top:none;border-left: | ||
+ | none;border-bottom:solid white 1.0pt;mso-border-bottom-themecolor:background1; | ||
+ | border-right:solid #5B9BD5 3.0pt;mso-border-right-themecolor:accent5; | ||
+ | mso-border-top-alt:solid white .5pt;mso-border-top-themecolor:background1; | ||
+ | mso-border-top-alt:solid white .5pt;mso-border-top-themecolor:background1; | ||
+ | mso-border-bottom-alt:solid white .5pt;mso-border-bottom-themecolor:background1; | ||
+ | mso-border-right-alt:solid #5B9BD5 3.0pt;mso-border-right-themecolor:accent5; | ||
+ | background:#5B9BD5;mso-background-themecolor:accent5;padding:0cm 5.4pt 0cm 5.4pt'> | ||
+ | <p class=MsoNormal align=center style='mso-margin-top-alt:auto;text-align: | ||
+ | center'><span lang=EN-US style='font-size:16.0pt;color:white;mso-themecolor: | ||
+ | background1'>55mm * 24mm * 18.5mm</span><span style='font-size:16.0pt; | ||
+ | color:white;mso-themecolor:background1'>(长<span lang=EN-US>*</span>宽<span | ||
+ | lang=EN-US>*</span>高)<span lang=EN-US><u1:p></u1:p><o:p></o:p></span></span></p> | ||
+ | </td> | ||
+ | </tr> | ||
+ | </table> | ||
+ | |||
+ | </div> | ||
+ | </body></html> | ||
+ | |||
+ | ===== 3. 编程指南 ===== | ||
+ | |||
+ | ==== 3.1. 图形化编程指南 ==== | ||
+ | <html><body> | ||
+ | <p class=MsoNormal style='text-indent:36.0pt'><span style='font-size:16.0pt; | ||
+ | font-family:等线'>该模块支持的图形化编程平台有</span><span lang=EN-US style='font-size:16.0pt'>WeeeCode</span><span | ||
+ | style='font-size:16.0pt;font-family:等线'>、编程猫平台、</span><span lang=EN-US | ||
+ | style='font-size:16.0pt'>Mixly_Arduino</span><span style='font-size:16.0pt; | ||
+ | font-family:等线'>、</span><span lang=EN-US style='font-size:16.0pt'>MakeCode</span><span | ||
+ | style='font-size:16.0pt;font-family:等线'>等,其图形化编程大同小异,区别不会很大。</span></p> | ||
+ | |||
+ | <div align=center> | ||
+ | |||
+ | <table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 | ||
+ | style='border-collapse:collapse'> | ||
+ | <tr style='height:24.7pt'> | ||
+ | <td width=244 valign=top style='width:183.3pt;border:solid windowtext 1.0pt; | ||
+ | padding:0cm 5.4pt 0cm 5.4pt;height:24.7pt'> | ||
+ | <p class=MsoNormal align=center style='text-align:center'><b><span | ||
+ | style='font-size:14.0pt;font-family:等线;color:black;background:white'>模块功能</span></b></p> | ||
+ | </td> | ||
+ | <td width=189 valign=top style='width:142.05pt;border:solid windowtext 1.0pt; | ||
+ | border-left:none;padding:0cm 5.4pt 0cm 5.4pt;height:24.7pt'> | ||
+ | <p class=MsoNormal align=center style='text-align:center'><b><span | ||
+ | style='font-size:14.0pt;font-family:等线;color:black;background:white'>需传参数</span></b></p> | ||
+ | </td> | ||
+ | <td width=455 valign=top style='width:341.05pt;border:solid windowtext 1.0pt; | ||
+ | border-left:none;padding:0cm 5.4pt 0cm 5.4pt;height:24.7pt'> | ||
+ | <p class=MsoNormal align=center style='text-align:center'><b><span | ||
+ | style='font-size:14.0pt;font-family:等线;color:black;background:white'>图形化编程块举例</span></b><b | ||
+ | style='box-sizing: border-box;font-variant-ligatures: normal;font-variant-caps: normal; | ||
+ | orphans: 2;widows: 2;-webkit-text-stroke-width: 0px;text-decoration-style: initial; | ||
+ | text-decoration-color: initial;word-spacing:0px'><span style='box-sizing: border-box'><span | ||
+ | lang=EN-US style='font-size:14.0pt;font-family:"Helvetica",sans-serif; | ||
+ | color:black;background:white'>(</span></span></b><b style='box-sizing: border-box; | ||
+ | font-variant-ligatures: normal;font-variant-caps: normal;orphans: 2; | ||
+ | widows: 2;-webkit-text-stroke-width: 0px;text-decoration-style: initial; | ||
+ | text-decoration-color: initial;word-spacing:0px'><span style='box-sizing: border-box'><span | ||
+ | style='font-size:14.0pt;font-family:等线;color:black;background:white'>其他平台图形化编程块大同小异</span></span></b><b | ||
+ | style='box-sizing: border-box;font-variant-ligatures: normal;font-variant-caps: normal; | ||
+ | orphans: 2;widows: 2;-webkit-text-stroke-width: 0px;text-decoration-style: initial; | ||
+ | text-decoration-color: initial;word-spacing:0px'><span style='box-sizing: border-box'><span | ||
+ | lang=EN-US style='font-size:14.0pt;font-family:"Helvetica",sans-serif; | ||
+ | color:black;background:white'>)</span></span></b></p> | ||
+ | </td> | ||
+ | </tr> | ||
+ | <tr style='height:54.4pt'> | ||
+ | <td width=244 style='width:183.3pt;border:solid windowtext 1.0pt;border-top: | ||
+ | none;padding:0cm 5.4pt 0cm 5.4pt;height:54.4pt'> | ||
+ | <p class=MsoNormal align=center style='text-align:center'><span | ||
+ | style='font-size:14.0pt;font-family:等线;color:black;background:white'>设置显示的数字</span></p> | ||
+ | </td> | ||
+ | <td width=189 style='width:142.05pt;border-top:none;border-left:none; | ||
+ | border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt; | ||
+ | padding:0cm 5.4pt 0cm 5.4pt;height:54.4pt'> | ||
+ | <p class=MsoNormal><span style='font-size:14.0pt;color:black;background:white'>(</span><span | ||
+ | lang=EN-US style='font-size:14.0pt;font-family:"Helvetica",sans-serif; | ||
+ | color:black;background:white'>2</span><span style='font-size:14.0pt; | ||
+ | color:black;background:white'>个参数)端口、数字(<span lang=EN-US>-999~9999</span>)</span></p> | ||
+ | </td> | ||
+ | <td width=455 valign=top style='width:341.05pt;border-top:none;border-left: | ||
+ | none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt; | ||
+ | padding:0cm 5.4pt 0cm 5.4pt;height:54.4pt'> | ||
+ | <p class=MsoNormal align=center style='text-align:center'><span lang=EN-US><img | ||
+ | width=360 height=67 id="图片 1" src="lib/exe/fetch.php?media=wm_wiki:four_digital_dispaly_module:pasted:20200303-111729.png"></span></p> | ||
+ | </td> | ||
+ | </tr> | ||
+ | </table> | ||
+ | |||
+ | </div> | ||
+ | |||
+ | <p class=MsoNormal><span lang=EN-US style='color:white'> </span></p> | ||
+ | |||
+ | <p class=MsoNormal style='text-indent:32.0pt'><span style='font-size:16.0pt; | ||
+ | font-family:等线'>图形化编程示例:</span></p> | ||
+ | </body></html> | ||
+ | |||
+ | {{ :wm_wiki:four_digital_dispaly_module:pasted:20200303-113130.png }} | ||
+ | ==== 3.2. 文本代码编程指南 ==== | ||
+ | <html><body> | ||
+ | <p class=MsoNormal style='text-indent:32.0pt'><span style='font-size:16.0pt; | ||
+ | font-family:等线'>Arduino编程示例:</span></p> | ||
+ | </body></html> | ||
+ | |||
+ | <sxh cpp; first-line: 1;highlight: [3,13,20,21,22,23]; title: we_7segment_display_test.ino> | ||
+ | |||
+ | #include "WeELF328P.h" | ||
+ | |||
+ | We7SegmentDisplay Display(PORT_A); | ||
+ | int8_t NumTab[] = {0x0A,0x0B,0x0C,0x0D,0x0E,0x0F,0x10,0x20,0x21,0x22,0x40}; //A,B,C,D,E,F,-,0.,1.,2.,NULL | ||
+ | int i=0; | ||
+ | void setup() | ||
+ | { | ||
+ | } | ||
+ | |||
+ | void loop() | ||
+ | { | ||
+ | |||
+ | Display.showNumber(i); | ||
+ | delay(100); | ||
+ | i++; | ||
+ | if(i>200) | ||
+ | { | ||
+ | for(unsigned char j=0;j<6;j++) | ||
+ | { | ||
+ | Display.showChar(1,NumTab[j]); | ||
+ | Display.showChar(2,NumTab[j]); | ||
+ | Display.showChar(3,NumTab[j]); | ||
+ | Display.showChar(4,NumTab[j]); | ||
+ | delay(1000); | ||
+ | } | ||
+ | i=0; | ||
+ | } | ||
+ | } | ||
+ | </sxh> |