显示页面修订记录反向链接回到顶部 本页面只读。您可以查看源文件,但不能更改它。如果您觉得这是系统错误,请联系管理员。 ====== 电子指南针模块 ====== {{ :wm_wiki:compass_sensor:pasted:20190511-122900.png }} ===== 1. 模块介绍 ===== <html><body> <p class=MsoNormal style='text-indent:.5in'><span lang=ZH-CN style='font-size: 16.0pt;font-family:宋体;color:#222222;background:white'>电子指南针传感器是基于高精度三轴磁传感器芯片 </span><b><span style='font-size:16.0pt;font-family:宋体;color:#222222;background:white'><a href="http://www.qstcorp.com/productinfo/153108.html" title=点击查看QMC5883L芯片更详细信息><span style='text-decoration:none;text-underline: none'>QMC5883L</span></a></span></b><span lang=ZH-CN style='font-size:16.0pt; font-family:宋体;color:#222222;background:white'>,它采用第三代</span><span style='font-size:16.0pt;font-family:宋体;color:#222222;background:white'>AMR<span lang=ZH-CN>磁传感技术,具有高精度、低功耗、高可靠性等特点,该芯片可应用于这些领域:</span></span><span style='font-family:宋体'><o:p></o:p></span></p> <p class=MsoListParagraph style='margin-left:78.0pt;text-indent:-.25in'><span style='font-size:16.0pt;font-family:宋体;color:#222222'>·<span lang=ZH-CN style='background:white'>实现无人机等移动终端的高精度定位导航需求;</span></span><span style='font-family:宋体'><o:p></o:p></span></p> <p class=MsoListParagraph style='margin-left:78.0pt;text-indent:-.25in'><span style='font-size:16.0pt;font-family:宋体;color:#222222'>·<span lang=ZH-CN style='background:white'>实现无人停车场的高可靠性自动停车监测功能;</span></span><span style='font-family:宋体'><o:p></o:p></span></p> <p class=MsoListParagraph style='margin-left:78.0pt;text-indent:-.25in'><span style='font-size:16.0pt;font-family:宋体;color:#222222'>·<span lang=ZH-CN style='background:white'>满足其他高精度工业控制和汽车电子要求;</span></span><span style='font-family:宋体'><o:p></o:p></span></p> <p class=MsoNormal style='text-indent:.5in'><span lang=ZH-CN style='font-size: 16.0pt;font-family:宋体;color:#222222;background:white'>本模块可以检测周围的磁场强度,使运动的装置或设备转动到指定的方向,比如安装在小车上,可以控制小车转动到指定方向或沿着指定方向行走。</span><span style='font-family:宋体'><o:p></o:p></span></p> <p class=MsoNormal style='text-indent:.5in'><span lang=ZH-CN style='font-size: 16.0pt;font-family:宋体;color:#222222;background:white'>三轴方向参考:</span><span style='font-family:宋体'><o:p></o:p></span></p> <p class=MsoNormal align=center style='text-align:center'><span style='mso-no-proof:yes'><img border=0 width=448 height=447 id="_x0000_i1026" src="https://www.weeemake.com.cn/wiki/lib/exe/fetch.php?media=wm_wiki:compass_sensor:pasted:20190511-154735.png" title="定向方向参考"></span></p> </body></html> ===== 2. 参数规格 ===== <html><body> <div align=center> <table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 style='border-collapse:collapse;mso-yfti-tbllook:1184;mso-padding-alt:0in 0in 0in 0in'> <tr style='mso-yfti-irow:0;mso-yfti-firstrow:yes'> <td width=172 valign=top style='width:129.0pt;border-top:solid #5B9BD5 3.0pt; border-left:solid #5B9BD5 3.0pt;border-bottom:solid white 2.25pt;border-right: none;background:#5B9BD5;padding:0in 5.4pt 0in 5.4pt'> <p class=MsoNormal align=center style='text-align:center'><span lang=ZH-CN style='font-size:18.0pt;font-family:宋体;mso-bidi-font-family:Calibri; color:white;mso-themecolor:background1'>参数</span><span style='font-size:18.0pt; font-family:宋体;mso-bidi-font-family:Calibri;color:white;mso-themecolor:background1'><o:p></o:p></span></p> </td> <td width=462 valign=top style='width:346.5pt;border-top:solid #5B9BD5 3.0pt; border-left:none;border-bottom:solid white 2.25pt;border-right:solid #5B9BD5 3.0pt; background:#5B9BD5;padding:0in 5.4pt 0in 5.4pt'> <p class=MsoNormal align=center style='text-align:center'><span lang=ZH-CN style='font-size:18.0pt;font-family:宋体;mso-bidi-font-family:Calibri; color:white;mso-themecolor:background1'>值</span><span style='font-size:18.0pt; font-family:宋体;mso-bidi-font-family:Calibri;color:white;mso-themecolor:background1'>/<span lang=ZH-CN>描述</span><o:p></o:p></span></p> </td> </tr> <tr style='mso-yfti-irow:1'> <td width=172 valign=top style='width:129.0pt;border-top:none;border-left: solid #5B9BD5 3.0pt;border-bottom:solid white 1.0pt;border-right:solid white 1.0pt; background:#5B9BD5;padding:0in 5.4pt 0in 5.4pt'> <p class=MsoNormal align=center style='text-align:center'><span lang=ZH-CN style='font-size:18.0pt;font-family:宋体;mso-bidi-font-family:Calibri; color:white;mso-themecolor:background1'>工作电压</span><span style='font-size: 18.0pt;font-family:宋体;mso-bidi-font-family:Calibri;color:white;mso-themecolor: background1'><o:p></o:p></span></p> </td> <td width=462 valign=top style='width:346.5pt;border-top:none;border-left: none;border-bottom:solid white 1.0pt;border-right:solid #5B9BD5 3.0pt; background:#5B9BD5;padding:0in 5.4pt 0in 5.4pt'> <p class=MsoNormal align=center style='text-align:center'><span style='font-size:18.0pt;font-family:宋体;mso-bidi-font-family:Calibri; color:white;mso-themecolor:background1'>DC 5V<o:p></o:p></span></p> </td> </tr> <tr style='mso-yfti-irow:2'> <td width=172 valign=top style='width:129.0pt;border-top:none;border-left: solid #5B9BD5 3.0pt;border-bottom:none;border-right:solid white 1.0pt; background:#5B9BD5;padding:0in 5.4pt 0in 5.4pt'> <p class=MsoNormal align=center style='text-align:center'><span lang=ZH-CN style='font-size:18.0pt;font-family:宋体;mso-bidi-font-family:Calibri; color:white;mso-themecolor:background1'>接口类型</span><span style='font-size: 18.0pt;font-family:宋体;mso-bidi-font-family:Calibri;color:white;mso-themecolor: background1'><o:p></o:p></span></p> </td> <td width=462 valign=top style='width:346.5pt;border:none;border-right:solid #5B9BD5 3.0pt; background:#5B9BD5;padding:0in 5.4pt 0in 5.4pt'> <p class=MsoNormal align=center style='text-align:center'><span style='font-size:18.0pt;font-family:宋体;mso-bidi-font-family:Calibri; color:white;mso-themecolor:background1'>RJ11<o:p></o:p></span></p> </td> </tr> <tr style='mso-yfti-irow:3'> <td width=172 valign=top style='width:129.0pt;border:solid white 1.0pt; border-left:solid #5B9BD5 3.0pt;background:#5B9BD5;padding:0in 5.4pt 0in 5.4pt'> <p class=MsoNormal align=center style='text-align:center'><span lang=ZH-CN style='font-size:18.0pt;font-family:宋体;mso-bidi-font-family:Calibri; color:white;mso-themecolor:background1'>通信方式</span><span style='font-size: 18.0pt;font-family:宋体;mso-bidi-font-family:Calibri;color:white;mso-themecolor: background1'><o:p></o:p></span></p> </td> <td width=462 valign=top style='width:346.5pt;border-top:solid white 1.0pt; border-left:none;border-bottom:solid white 1.0pt;border-right:solid #5B9BD5 3.0pt; background:#5B9BD5;padding:0in 5.4pt 0in 5.4pt'> <p class=MsoNormal align=center style='text-align:center'><span style='font-size:18.0pt;font-family:宋体;mso-bidi-font-family:Calibri; color:white;mso-themecolor:background1'>WM<span lang=ZH-CN>单总线</span><o:p></o:p></span></p> </td> </tr> <tr style='mso-yfti-irow:4'> <td width=172 valign=top style='width:129.0pt;border-top:none;border-left: solid #5B9BD5 3.0pt;border-bottom:none;border-right:solid white 1.0pt; background:#5B9BD5;padding:0in 5.4pt 0in 5.4pt'> <p class=MsoNormal align=center style='text-align:center'><span lang=ZH-CN style='font-size:18.0pt;font-family:宋体;mso-bidi-font-family:Calibri; color:white;mso-themecolor:background1'>工作温度</span><span style='font-size: 18.0pt;font-family:宋体;mso-bidi-font-family:Calibri;color:white;mso-themecolor: background1'><o:p></o:p></span></p> </td> <td width=462 valign=top style='width:346.5pt;border:none;border-right:solid #5B9BD5 3.0pt; background:#5B9BD5;padding:0in 5.4pt 0in 5.4pt'> <p class=MsoNormal align=center style='text-align:center'><span style='font-size:18.0pt;font-family:宋体;mso-bidi-font-family:Calibri; color:white;mso-themecolor:background1'>-40<span lang=ZH-CN>℃</span>~+85<span lang=ZH-CN>℃</span><o:p></o:p></span></p> </td> </tr> <tr style='mso-yfti-irow:5'> <td width=172 valign=top style='width:129.0pt;border:solid white 1.0pt; border-left:solid #5B9BD5 3.0pt;background:#5B9BD5;padding:0in 5.4pt 0in 5.4pt'> <p class=MsoNormal align=center style='text-align:center'><span lang=ZH-CN style='font-size:18.0pt;font-family:宋体;mso-bidi-font-family:Calibri; color:white;mso-themecolor:background1'>定向精度</span><span style='font-size: 18.0pt;font-family:宋体;mso-bidi-font-family:Calibri;color:white;mso-themecolor: background1'><o:p></o:p></span></p> </td> <td width=462 valign=top style='width:346.5pt;border-top:solid white 1.0pt; border-left:none;border-bottom:solid white 1.0pt;border-right:solid #5B9BD5 3.0pt; background:#5B9BD5;padding:0in 5.4pt 0in 5.4pt'> <p class=MsoNormal align=center style='text-align:center'><span style='font-size:18.0pt;font-family:宋体;mso-bidi-font-family:Calibri; color:white;mso-themecolor:background1'>1° ~ 2°<o:p></o:p></span></p> </td> </tr> <tr style='mso-yfti-irow:6;mso-yfti-lastrow:yes'> <td width=172 valign=top style='width:129.0pt;border-top:none;border-left: solid #5B9BD5 3.0pt;border-bottom:solid #5B9BD5 3.0pt;border-right:solid white 1.0pt; background:#5B9BD5;padding:0in 5.4pt 0in 5.4pt'> <p class=MsoNormal align=center style='text-align:center'><span lang=ZH-CN style='font-size:18.0pt;font-family:宋体;mso-bidi-font-family:Calibri; color:white;mso-themecolor:background1'>尺寸大小</span><span style='font-size: 18.0pt;font-family:宋体;mso-bidi-font-family:Calibri;color:white;mso-themecolor: background1'><o:p></o:p></span></p> </td> <td width=462 valign=top style='width:346.5pt;border-top:none;border-left: none;border-bottom:solid #5B9BD5 3.0pt;border-right:solid #5B9BD5 3.0pt; background:#5B9BD5;padding:0in 5.4pt 0in 5.4pt'> <p class=MsoNormal align=center style='text-align:center'><span style='font-size:18.0pt;font-family:宋体;mso-bidi-font-family:Calibri; color:white;mso-themecolor:background1'>55mm*24mm*18.5mm(<span lang=ZH-CN>长</span>*<span lang=ZH-CN>宽</span>*<span lang=ZH-CN>高</span>)<o:p></o:p></span></p> </td> </tr> </table> </div> </body></html> ===== 3. 编程指南 ===== ==== 3.1. 模块功能及编程指南 ==== <html><body> <p class=MsoTitleCxSpLast><span style='font-size:18.0pt'>3</span><span style='font-size:18.0pt;font-family:等线'>.</span><span style='font-size:18.0pt'>1</span><span style='font-size:18.0pt;font-family:等线'>.</span><span style='font-size:18.0pt'>1</span><span style='font-size:18.0pt;font-family:等线'>.</span><span style='font-size:18.0pt'> </span><span lang=ZH-CN style='font-size:18.0pt;font-family:宋体'>功能模块及</span><span style='font-size:18.0pt;font-family:宋体'>WeeeCode<span lang=ZH-CN>图形化编程指南</span></span></p> <p class=MsoNormal style='text-indent:21.0pt'><span style='font-size:16.0pt; font-family:华文楷体;color:#222222;background:white'> </span><span lang=ZH-CN style='font-size:16.0pt;font-family:宋体;color:#222222;background: white'>该模块支持的图形化编程平台有</span><span class=SpellE><span style='box-sizing: border-box; font-variant-ligatures: normal;font-variant-caps: normal;orphans: 2;text-align: start;widows: 2;-webkit-text-stroke-width: 0px;text-decoration-style: initial; text-decoration-color: initial;word-spacing:0px'><span style='font-size:16.0pt; font-family:宋体;color:#222222;background:white'>WeeeCode</span></span></span><span lang=ZH-CN style='font-size:16.0pt;font-family:宋体;color:#222222;background: white'><span style='box-sizing: border-box;font-variant-ligatures: normal; font-variant-caps: normal;orphans: 2;text-align:start;widows: 2;-webkit-text-stroke-width: 0px; text-decoration-style: initial;text-decoration-color: initial;word-spacing: 0px'>、编程猫平台、</span></span><span class=SpellE><span style='box-sizing: border-box; font-variant-ligatures: normal;font-variant-caps: normal;orphans: 2;text-align: start;widows: 2;-webkit-text-stroke-width: 0px;text-decoration-style: initial; text-decoration-color: initial;word-spacing:0px'><span style='font-size:16.0pt; font-family:宋体;color:#222222;background:white'>Mixly_Arduino</span></span></span><span lang=ZH-CN style='font-size:16.0pt;font-family:宋体;color:#222222;background: white'><span style='box-sizing: border-box;font-variant-ligatures: normal; font-variant-caps: normal;orphans: 2;text-align:start;widows: 2;-webkit-text-stroke-width: 0px; text-decoration-style: initial;text-decoration-color: initial;word-spacing: 0px'>、</span></span><span class=SpellE><span style='box-sizing: border-box; font-variant-ligatures: normal;font-variant-caps: normal;orphans: 2;text-align: start;widows: 2;-webkit-text-stroke-width: 0px;text-decoration-style: initial; text-decoration-color: initial;word-spacing:0px'><span style='font-size:16.0pt; font-family:宋体;color:#222222;background:white'>MakeCode</span></span></span><span lang=ZH-CN style='font-size:16.0pt;font-family:宋体;color:#222222;background: white'><span style='box-sizing: border-box;font-variant-ligatures: normal; font-variant-caps: normal;orphans: 2;text-align:start;widows: 2;-webkit-text-stroke-width: 0px; text-decoration-style: initial;text-decoration-color: initial;word-spacing: 0px'>等,其图形化编程大同小异,区别不会很大。</span></span><span style='font-family:宋体'><o:p></o:p></span></p> <div align=center> <table class=MsoNormalTable border=0 cellspacing=0 cellpadding=0 style='border-collapse:collapse;mso-yfti-tbllook:1184;mso-padding-alt:0in 0in 0in 0in'> <tr style='mso-yfti-irow:0;mso-yfti-firstrow:yes'> <td width=257 valign=top style='width:192.65pt;border:solid windowtext 1.0pt; padding:0in 5.4pt 0in 5.4pt'> <p class=MsoNormal align=center style='text-align:center'><b><span lang=ZH-CN style='font-size:14.0pt;font-family:华文楷体;color:windowtext; background:white'>模块功能</span></b><span style='font-family:华文楷体;color:windowtext'><o:p></o:p></span></p> </td> <td width=223 valign=top style='width:166.95pt;border:solid windowtext 1.0pt; border-left:none;padding:0in 5.4pt 0in 5.4pt'> <p class=MsoNormal align=center style='text-align:center'><span class=GramE><b><span lang=ZH-CN style='font-size:14.0pt;font-family:华文楷体;color:windowtext; background:white'>需传参数</span></b></span><span style='font-family:华文楷体; color:windowtext'><o:p></o:p></span></p> </td> <td width=462 valign=top style='width:346.5pt;border:solid windowtext 1.0pt; border-left:none;padding:0in 5.4pt 0in 5.4pt'> <p class=MsoNormal align=center style='text-align:center'><b><span lang=ZH-CN style='font-size:14.0pt;font-family:华文楷体;color:windowtext; 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 style='font-size:14.0pt;font-family:华文楷体;mso-bidi-font-family:Helvetica; color:windowtext;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=ZH-CN style='font-size:14.0pt;font-family:华文楷体;color:windowtext; 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:华文楷体;mso-bidi-font-family:Helvetica; color:windowtext;background:white'>)</span></span></b><span style='font-family: 华文楷体;color:windowtext'><o:p></o:p></span></p> </td> </tr> <tr style='mso-yfti-irow:1;mso-yfti-lastrow:yes'> <td width=257 style='width:192.65pt;border:solid windowtext 1.0pt;border-top: none;padding:0in 5.4pt 0in 5.4pt'> <p class=MsoNormal><span lang=ZH-CN style='font-size:14.0pt;font-family:华文楷体; mso-bidi-font-family:Helvetica;color:windowtext;background:white'>获取<span 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></span><span style='font-family:华文楷体;color:windowtext'><o:p></o:p></span></p> </td> <td width=223 style='width:166.95pt;border-top:none;border-left:none; border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt; padding:0in 5.4pt 0in 5.4pt'> <p class=MsoNormal><span style='font-size:14.0pt;font-family:华文楷体;mso-bidi-font-family: Helvetica;color:windowtext;background:white'>(2</span><span lang=ZH-CN style='font-size:14.0pt;font-family:华文楷体;color:windowtext;background:white'><span 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></span><span style='font-size:14.0pt;font-family:华文楷体;color:windowtext;background:white'><o:p></o:p></span></p> </td> <td width=462 valign=top style='width:346.5pt;border-top:none;border-left: none;border-bottom:solid windowtext 1.0pt;border-right:solid windowtext 1.0pt; padding:0in 5.4pt 0in 5.4pt'> <p class=MsoNormal align=center style='text-align:center'><span style='color:windowtext'><span style='mso-no-proof:yes'><img border=0 width=393 height=168 id="_x0000_i1025" src="lib/exe/fetch.php?media=wm_wiki:compass_sensor:pasted:20190511-161322.png" alt="lib/exe/fetch.php?media=wm_wiki:compass_sensor:pasted:20190511-161322.png"></span></span></p> </td> </tr> </table> </div> <p class=MsoNormal style='text-indent:21.0pt'><span style='font-size:16.0pt; font-family:华文楷体'> <o:p></o:p></span></p> <p class=MsoTitle><span style='font-size:18.0pt'>3</span><span style='font-size:18.0pt;font-family:等线'>.</span><span style='font-size:18.0pt'>1</span><span style='font-size:18.0pt;font-family:等线'>.</span><span style='font-size:18.0pt'>2</span><span style='font-size:18.0pt;font-family:等线'>.</span><span style='font-size:18.0pt'> </span><span lang=ZH-CN style='font-size:18.0pt;font-family:宋体'>文本代码编程指南</span><span style='font-size:18.0pt;font-family:宋体'><o:p></o:p></span></p> <p class=MsoNormal align=left style='margin-bottom:7.9pt;text-align:left; text-indent:.5in;background:white'><span lang=ZH-CN style='font-size:16.0pt; font-family:宋体;mso-bidi-font-family:Helvetica;color:#222222'>直接使用文本代码编程,就涉及到相关编程</span><span style='font-size:16.0pt;font-family:宋体;mso-bidi-font-family:Helvetica; color:#222222'>API:<o:p></o:p></span></p> <p class=MsoNormal align=left style='margin-bottom:7.9pt;text-align:left; text-indent:.5in;background:white'><span style='font-size:16.0pt;font-family: 宋体;mso-bidi-font-family:Helvetica;color:#222222'>Arduino-C/C++ API<span lang=ZH-CN>:</span><b><a href="doku.php?id=wm_wiki:arduino_ide:api_document#%E7%94%B5%E5%AD%90%E6%8C%87%E5%8D%97%E9%92%88%E4%BC%A0%E6%84%9F%E5%99%A8api"><span lang=ZH-CN style='color:#008CBA;text-decoration:none;text-underline:none'>查看相关</span><span style='color:#008CBA;text-decoration:none;text-underline:none'>API</span></a></b><o:p></o:p></span></p> </body></html> ==== 3.2. 编程示例 ==== ===== 4. 注意事项 ===== <html><body> <p class=MsoNormal style='text-indent:.5in'><span lang=ZH-CN style='font-size: 16.0pt;font-family:宋体;color:#222222;background:white'>(</span><span style='font-size:16.0pt;font-family:宋体;color:#222222;background:white'>1<span lang=ZH-CN>)由于磁传感器是感应地磁的,所以该模块使用时,周围不宜有强磁性的物体;</span><o:p></o:p></span></p> <p class=MsoNormal style='text-indent:.5in'><span lang=ZH-CN style='font-size: 16.0pt;font-family:宋体;color:#222222;background:white'>(</span><span style='font-size:16.0pt;font-family:宋体;color:#222222;background:white'>2<span lang=ZH-CN>)模块上的</span>8<span lang=ZH-CN>颗蓝色</span>LED<span lang=ZH-CN>灯环对应的是</span>X<span lang=ZH-CN>轴的变化,且亮灯指示的是南方。</span><o:p></o:p></span></p> </body></html>