{"id":23681,"date":"2023-07-20T00:00:20","date_gmt":"2023-07-19T16:00:20","guid":{"rendered":"https:\/\/techclass.wfjydl.com\/?p=23681"},"modified":"2026-05-19T16:24:55","modified_gmt":"2026-05-19T08:24:55","slug":"%e7%94%a8spresense%e6%89%a9%e5%a4%a7%e7%94%b5%e5%ad%90%e5%88%b6%e4%bd%9c%e7%9a%84%e5%b9%bf%e5%ba%a6%ef%bc%81-%e7%ac%ac3%e7%af%87%ef%bc%9a%e4%bd%bf%e7%94%a8rohm%e9%99%84%e5%8a%a0%e6%9d%bf%ef%bc%8c","status":"publish","type":"post","link":"https:\/\/techclass.wfjydl.com\/knowledge\/tech-info\/arduino\/hobby\/spresense-03","title":{"rendered":"\u7528Spresense\u6269\u5927\u7535\u5b50\u5236\u4f5c\u7684\u5e7f\u5ea6\uff01\u3010\u7b2c3\u7bc7\u3011"},"content":{"rendered":"<h3>\u4f7f\u7528极悦娱乐\u9644\u52a0\u677f\uff0c\u901a\u8fc7Spresense\u8f7b\u677e\u5b9e\u73b0\u4f20\u611f\u5668\u68c0\u6d4b\uff01<\/h3>\n<p>&nbsp;<\/p>\n<p>\u7b2c1\u56de\uff1a<a href=\"https:\/\/techclass.wfjydl.com\/knowledge\/tech-info\/arduino\/hobby\/spresense-01\/\">\u4ec0\u4e48\u662fSpresense\uff1f<\/a><br \/>\n\u7b2c2\u56de\uff1a<a href=\"https:\/\/techclass.wfjydl.com\/knowledge\/tech-info\/arduino\/hobby\/spresense-02\/\">\u4f7f\u7528Spresense\u5236\u4f5c\u9ad8\u5206\u8fa8\u7387\u97f3\u4e50\u64ad\u653e\u5668\uff01<\/a><\/p>\n<p>&nbsp;<\/p>\n<p>\u5927\u5bb6\u597d\uff0c\u6211\u662f\u5409\u7530\uff01<br \/>\n\u8fd9\u662f\u4f7f\u7528\u7d22\u5c3c\u63a8\u51fa\u7684Spresense\u8fdb\u884c\u7535\u5b50\u5236\u4f5c\u7684\u7b2c3\u7bc7\uff0c\u8fd9\u6b21\u6211\u5c06\u5229\u7528\u8be5\u5f00\u53d1\u677f\u662f\u57fa\u4e8e\u5f00\u653e\u5f0f\u4f53\u7cfb\u7ed3\u6784\u8fd9\u4e00\u7279\u70b9\uff0c\u4f7f\u7528\u9644\u52a0\u677f\u6dfb\u52a0\u4e00\u4e9b\u529f\u80fd\uff01<br \/>\n极悦娱乐\u5df2\u7ecf\u63a8\u51fa\u4e86\u8ddfSpresense\u5b8c\u5168\u5339\u914d\u7684\u9644\u52a0\u677f\uff0c\u6211\u5c06\u4f7f\u7528极悦娱乐\u7684\u9644\u52a0\u677f\uff0c\u5728\u77ed\u65f6\u95f4\u5185\u7b80\u5355\u5730\u5236\u4f5c\u4e00\u4e2a\u53ef\u4ee5\u8fdb\u884c\u4f20\u611f\u5668\u68c0\u6d4b\u7684\u8bbe\u5907\uff01<\/p>\n<div class=\"box-red-01\">\n<h4>\u672c\u9879\u76ee\u6240\u9700\u90e8\u4ef6<\/h4>\n<p><a href=\"https:\/\/developer.sony.com\/ja\/develop\/spresense\/buy-now\" target=\"_blank\" rel=\"noopener\"><strong>\u30fbSONY Spresense \u4e3b\u677f<\/strong><\/a><br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-30201 alignnone\" src=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2023\/07\/Spresense-2.png\" alt=\"Spresense\" width=\"300\" height=\"300\" \/><\/p>\n<p><a href=\"https:\/\/www.rohm.co.jp\/support\/spresense-add-on-board\" target=\"_blank\" rel=\"noopener\"><strong>\u30fb极悦娱乐 \u4f20\u611f\u5668\u9644\u52a0\u677f<\/strong><\/a><br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-30202 alignnone\" src=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2023\/07\/Spresense-2-2.jpg\" alt=\"SPRESENSE-SENSOR-EVK-701\" width=\"250\" height=\"131\" \/><\/p>\n<p><a href=\"https:\/\/www.sengoku.co.jp\/mod\/sgk_cart\/detail.php?code=EEHD-4YZL\" target=\"_blank\" rel=\"noopener\"><strong>\u30fb\u5c0f\u578b\u9502\u805a\u5408\u7269\u7535\u6c60\uff08400mAh\uff09\u548c\u7535\u6e90\u63d2\u5ea7<\/strong><\/a><br \/>\n\uff08\u203b\u6ce8\uff1a\u8bf7\u5c0f\u5fc3\u5904\u7406\uff0c\u4f7f\u7528\u98ce\u9669\u81ea\u8d1f\uff09<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-30203 alignnone\" src=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2023\/07\/Spresense-3-2.png\" alt=\"3-1\" width=\"300\" height=\"223\" \/><\/p>\n<p><strong>\u30fbMicro USB \u6570\u636e\u7ebf<\/strong><br \/>\n<strong>\u30fbMicro SD \u5361<\/strong><br \/>\n<strong>\u30fb\u65e5\u672c\u767e\u5143\u5e97\u5c31\u80fd\u4e70\u5230\u7684\u5916\u58f3<\/strong><\/p>\n<p>&nbsp;<\/p>\n<h4>\u672c\u9879\u76ee\u7684\u6d41\u7a0b<\/h4>\n<p><strong>1. 极悦娱乐\u9644\u52a0\u677f\u4ecb\u7ecd<\/strong><br \/>\n<strong>2. \u4f7f\u7528\u4f20\u611f\u5668\u9644\u52a0\u677f\u6d4b\u91cf\u6c14\u6e29\u548c\u6d77\u62d4<\/strong><br \/>\n<strong>3. \u5236\u4f5c\u6c14\u6e29\u3001\u6d77\u62d4\u6d4b\u91cf\u8bbe\u5907<\/strong><br \/>\n<strong>4. \u603b\u7ed3<\/strong><\/p>\n<\/div>\n<h2>1.极悦娱乐\u9644\u52a0\u677f\u4ecb\u7ecd<\/h2>\n<p>\u6240\u8c13\u7684\u9644\u52a0\u677f\uff0c\u5c31\u662f\u4e00\u7c7b\u4ec5\u901a\u8fc7\u63d2\u5165Spresense\u7684GPIO\u5f15\u811a\u548c\u7aef\u53e3\uff0c\u5c31\u80fd\u5b9e\u73b0\u529f\u80fd\u6dfb\u52a0\u7684\u7535\u8def\u677f\u7684\u603b\u79f0\u3002极悦娱乐\u5df2\u7ecf\u63a8\u51fa\u4e86\u652f\u6301\u4f20\u611f\u5668\u76f8\u5173\u90e8\u4ef6\u7684\u9644\u52a0\u677fSENSOR-EVK-701\u548c\u652f\u6301Bluetooth Low Energy\u7684\u9644\u52a0\u677fBLE-EVK-701\u3002<\/p>\n<p>\u6211\u4eec\u5148\u6765\u770b\u770b\u8fd9\u4e00\u5757\u4f20\u611f\u5668\u9644\u52a0\u677f\u3002\u8be5\u9644\u52a0\u677f\u5df2\u7ecf\u5185\u7f6e\u4e863\u4e2a\u4f20\u611f\u5668\uff0c\u5b83\u4eec\u5206\u522b\u662f\u52a0\u901f\u5ea6\u4f20\u611f\u5668\u3001\u6c14\u538b\u4f20\u611f\u5668\u3001\u5730\u78c1\u4f20\u611f\u5668\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-30204 aligncenter\" src=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2023\/07\/2-9.png\" alt=\"2\" width=\"550\" height=\"299\" \/><\/p>\n<p>\u56e0\u4e3a\u5df2\u7ecf\u5185\u7f6e\u4e86\u8fd9\u4e9b\u4f20\u611f\u5668\uff0c\u6240\u4ee5\u53ea\u9700\u8981\u8fde\u63a5Spresense\uff0c\u518d\u8fd0\u7528极悦娱乐\u63d0\u4f9b\u7684\u5e93\u6587\u4ef6\uff0c\u5c31\u53ef\u4ee5\u5f00\u59cb\u4f7f\u7528\u4e86\u3002<\/p>\n<p>\u53e6\u5916\uff0c\u8be5\u9644\u52a0\u677f\u4e0a\u4e5f\u8bbe\u6709GPIO\u5f15\u811a\uff0c\u6240\u4ee5\u53ea\u9700\u8981\u5728\u5f15\u811a\u4e0a\u63d2\u5165极悦娱乐\u63a8\u51fa\u7684<a href=\"https:\/\/www.wfjydl.com\/sensor-shield-support\" target=\"_blank\" rel=\"noopener\">\u4f20\u611f\u5668\u8bc4\u4f30\u5957\u4ef6<\/a>\u7b49\uff0c\u5c31\u53ef\u4ee5\u8f7b\u8f7b\u677e\u677e\u5730\u5b8c\u6210\u4f20\u611f\u5668\u7684\u6dfb\u52a0\u3002<\/p>\n<p>\u8bdd\u4e0d\u591a\u8bf4\uff0c\u63a5\u4e0b\u6765\u6211\u4eec\u5c31\u6765\u4f53\u9a8c\u4e00\u4e0b\u8fd9\u4e00\u5757\u4f20\u611f\u5668\u9644\u52a0\u677f\u3002<br \/>\n\u5148\u5c06\u4f20\u611f\u5668\u9644\u52a0\u677f\u63d2\u5165Spresense\u7684\u4e3b\u677f\u4e0a\u7684GPIO\u5f15\u811a\uff0c\u5177\u4f53\u4f4d\u7f6e\u89c1\u4e0b\u8ff0\u56fe\u7247\u3002\uff08\u5982\u56fe\u6240\u793a\uff0c\u9644\u52a0\u677f\u76845\u4e2a\u5f15\u811a\u8981\u5728GPIO\u7684\u4e0b\u65b9\uff09<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-30205 aligncenter\" src=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2023\/07\/3-3-1.png\" alt=\"3\" width=\"400\" height=\"455\" \/><\/p>\n<p>\u4ec5\u4ec5\u8fd9\u4e00\u6b65\uff0c\u5c31\u53ef\u4ee5\u4f7f\u7528Spresense\u5b9e\u73b0\u4f20\u611f\u5668\u68c0\u6d4b\u4e86\u3002<br \/>\n\u63a5\u4e0b\u6765\uff0c\u5728\u4e0b\u8ff0极悦娱乐\u5b98\u7f51\u4e0a\uff0c\u4e0b\u8f7d\u4f20\u611f\u5668\u7684\u5e93\u6587\u4ef6\u3002<br \/>\n<a href=\"https:\/\/github.com\/RohmSemiconductor\/Arduino\" target=\"_blank\" rel=\"noopener\">https:\/\/github.com\/RohmSemiconductor\/Arduino<\/a><\/p>\n<p>\u5c06\u4e0b\u8f7d\u4e0b\u6765\u7684\u5e93\u6587\u4ef6\u7fa4\u7ec4\u4fdd\u5b58\u5728Arduino\u6587\u4ef6\u5939\u4e0b\u3002<br \/>\n\u6211\u4eec\u5148\u8fdb\u884c\u521d\u6b65\u6d4b\u8bd5\u3002\u53cc\u51fb\u6c14\u538b\u4f20\u611f\u5668\u7684BM1383AGLV.ino\uff0c\u8fd9\u6837Arduino IDE\u5c31\u4f1a\u81ea\u52a8\u542f\u52a8\uff0c\u7136\u540e\u5c06Spresense\u8fde\u4e0a\u7535\u8111\uff0c\u52a0\u8f7dSketch\u3002<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-30206 aligncenter\" src=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2023\/07\/4-3.png\" alt=\"4\" width=\"550\" height=\"131\" \/><\/p>\n<p>\u4e4b\u540e\uff0c\u6253\u5f00\u4e32\u53e3\u76d1\u89c6\u5668\uff0c\u600e\u4e48\u6837\uff1f\u754c\u9762\u4e0a\u663e\u793a\u51fa\u6c14\u538b\uff08hPa\uff09\u548c\u6c14\u6e29\uff08Celsius\uff09\u7684\u6570\u503c\u4e86\u5427\uff1f\u5b9e\u73b0\u6c14\u538b\u548c\u6e29\u5ea6\u7684\u6d4b\u91cf\uff0c\u5c31\u662f\u5982\u6b64\u7b80\u5355\u3002<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-30207 aligncenter\" src=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2023\/07\/5-3-1.png\" alt=\"5\" width=\"700\" height=\"406\" \/><\/p>\n<h2>2. \u4f7f\u7528\u4f20\u611f\u5668\u9644\u52a0\u677f\u6d4b\u91cf\u6d77\u62d4<\/h2>\n<p>\u901a\u8fc7\u521d\u6b65\u6d4b\u8bd5\uff0c\u6211\u4eec\u5df2\u7ecf\u786e\u8ba4\u5230\u4f20\u611f\u5668\u9644\u52a0\u677f\u8fde\u63a5\u6210\u529f\uff0c\u53ef\u4ee5\u6b63\u5e38\u5de5\u4f5c\u4e86\u3002\u63a5\u4e0b\u6765\u5c31\u8981\u7528\u5230\u5404\u7c7b\u4f20\u611f\u5668\uff0c\u8fdb\u884c\u7a0d\u5fae\u5177\u4f53\u4e00\u70b9\u7684\u6d4b\u91cf\u3002<br \/>\n\u9996\u5148\uff0c\u57fa\u4e8e\u521a\u521a\u7528\u5230\u7684\u6c14\u538b\u4f20\u611f\u5668\uff0c\u7b80\u6613\u5730\u6d4b\u91cf\u4e00\u4e0b\u5f53\u524d\u6240\u5728\u5730\u7684\u6d77\u62d4\u3002<br \/>\n\u53ef\u4ee5\u5229\u7528\u4e0b\u8ff0\u516c\u5f0f\uff0c\u6839\u636e\u6c14\u538b\u8ba1\u7b97\u6d77\u62d4\uff0c\u6211\u4eec\u5148\u8981\u5c06\u76f8\u5e94\u7684\u503c\u4ee3\u5165\u516c\u5f0f\u3002<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"wp-image-30208 aligncenter\" src=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2023\/07\/6-3-1.png\" alt=\"6\" width=\"283\" height=\"53\" \/><\/p>\n<p>\u5728Arduino IDE\u4e2d\u7f16\u8f91\u4e0b\u8ff0\u5185\u5bb9\u3002<\/p>\n<p class=\"box-black\" style=\"padding: 2px 5px; background-color: #333; color: #fff; display: inline-block;\">altitude (m) = ((pow((\u6807\u51c6\u5927\u6c14\u538b \/\u5b9e\u6d4b\u5927\u6c14\u538b), (1 \/ 5.257)) \u2013 1) * (\u6807\u51c6\u6e29\u5ea6 + 273.15)) \/ 0.0065<\/p>\n<p>\u8fd9\u91cc\u7528\u5230\u7684\u6807\u51c6\u5927\u6c14\u538b\u662f1013.15hPa\uff0c\u6807\u51c6\u6e29\u5ea6\u662f15\u2103\u3002\u6240\u4ee5\uff0c\u8981\u5728\u521a\u521a\u8fd0\u884c\u7684BM1383AGLV Sketch\u7684\u57fa\u7840\u4e0a\uff0c\u5728loop\u4e2d\u6dfb\u52a0\u4e0b\u8ff0\u9ec4\u8272\u90e8\u5206\u5185\u5bb9\u3002<\/p>\n<pre class=\"crayon-plain-tag\">\/** altitude\u8a08\u7b97\u3092loop\u5185\u306b\u8ffd\u52a0 **\/ \r\n   void loop() { \r\n byte rc; \r\n float press = 0, temp = 0, altitude = 0; \r\n   volatile float refPress = 1013.15;\/\/\u9ad8\u5ea6\u8a08\u7b97\u306b\u4f7f\u7528\u3059\u308b\u57fa\u6e96\u9ad8\u5ea6\u3067\u306e\u5927\u6c17\u5727[hPa] \r\n volatile float refTemp = 15.0;\/\/\u9ad8\u5ea6\u8a08\u7b97\u306b\u4f7f\u7528\u3059\u308b\u57fa\u6e96\u6e29\u5ea6[C] \r\n rc = bm1383aglv.get_val(&amp;press, &amp;temp); \r\n altitude = ((pow((refPress \/ press), (1 \/ 5.257)) - 1) * (refTemp + 273.15)) \/ 0.0065; \r\n   if ( rc == 0 ) { \r\n Serial.print(\"ALT: \"); \r\n Serial.print(altitude);  \r\n Serial.println(\" [m]\"); \r\n Serial.print(\"TEMP: \"); \r\n Serial.print(temp); \r\n Serial.println(\" [C]\");  \r\n } \r\n   delay(500); \r\n } \r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>\u5c06\u8fd9\u4e00Sketch\u52a0\u8f7d\u81f3Spresense\uff0c\u542f\u52a8\u4e32\u53e3\u76d1\u89c6\u5668\uff0c\u5c31\u53ef\u4ee5\u5f00\u59cb\u6d4b\u91cf\u6d77\u62d4\u548c\u6c14\u6e29\u4e86\u3002\u8fd9\u65f6\uff0c\u6211\u4eec\u4e5f\u53ef\u4ee5\u628aSpresense\u6362\u4e2a\u4f4d\u7f6e\uff0c\u786e\u8ba4\u6d77\u62d4\u7b49\u6d4b\u91cf\u7ed3\u679c\u662f\u5426\u4f1a\u56e0\u6b64\u53d1\u751f\u53d8\u5316\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-30209 aligncenter\" src=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2023\/07\/7-3-1.png\" alt=\"7\" width=\"700\" height=\"253\" \/><\/p>\n<h2>3. \u5236\u4f5c\u6c14\u6e29\u3001\u6d77\u62d4\u6d4b\u91cf\u8bbe\u5907<\/h2>\n<p>\u63a5\u4e0b\u6765\uff0c\u8ba9\u6211\u4eec\u7528Spresense\uff0c\u5236\u4f5c\u6210\u4e00\u4e2a\u53ef\u4ee5\u6d4b\u91cf\u6c14\u6e29\u3001\u6d77\u62d4\u7b49\u4fe1\u606f\u7684\u53ef\u7a7f\u6234\u5f0f\u8bbe\u5907\u5427\u3002<br \/>\n\u56e0\u4e3a\u53ea\u9700\u8981\u901a\u8fc7Spresense\u7684\u4e3b\u677f\u548c\u7535\u6c60\u5c31\u80fd\u6d4b\u91cf\uff0c\u6240\u4ee5\u7528\u65e5\u672c\u767e\u5143\u5e97\u5c31\u80fd\u4e70\u5230\u7684\u5916\u58f3\u4e5f\u53ef\u4ee5\u88c5\u5f97\u4e0b\u3002\u5f53\u7136\uff0c\u4e5f\u9700\u8981\u7559\u610f\uff0c\u786e\u4fdd\u653e\u8fdb\u5916\u58f3\u4e4b\u540e\uff0c\u4ece\u58f3\u4f53\u5916\u9762\u80fd\u591f\u770b\u5230\u7eff\u8272\u7684LED\u3002<br \/>\n<img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-30210 aligncenter\" src=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2023\/07\/9-3-1.png\" alt=\"8\" width=\"666\" height=\"435\" \/><\/p>\n<p>\u518d\u52a0\u4e0a\u94a5\u5319\u6263\u6216\u5939\u5b50\u7b49\u9644\u4ef6\uff0c\u5c31\u80fd\u628a\u5b83\u6302\u5728\u8863\u670d\u6216\u88e4\u5b50\u7b49\u4e0a\u9762\u4e86\u3002\u8fd9\u6837\uff0c\u722c\u5c71\u65f6\u5e26\u7740\u8fd9\u4e2a\u8bbe\u5907\uff0c\u5c31\u80fd\u968f\u65f6\u968f\u5730\u6d4b\u91cf\u6c14\u6e29\u548c\u5f53\u524d\u6240\u5728\u4f4d\u7f6e\u7684\u6d77\u62d4\u7b49\u4fe1\u606f\u4e86\u3002<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"size-full wp-image-30211 aligncenter\" src=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2023\/07\/10-3-1.png\" alt=\"9\" width=\"607\" height=\"292\" \/><\/p>\n<p>\u5728\u672c\u9879\u76ee\u91cc\uff0c\u6211\u8fd8\u5c06Spresense\u7684LED\u505a\u6210\u4e86\u5206\u6bb5\u53d1\u5149\u7684\u5f0f\u6837\uff0c\u8fd9\u6837\u5c31\u53ef\u4ee5\u5728\u722c\u5c71\u7b49\u4f7f\u7528\u573a\u666f\u4e0b\uff0c\u80fd\u591f\u77e5\u9053\u81ea\u5df1\u7684\u6240\u5728\u4f4d\u7f6e\u662f\u4e0d\u662f\u5230\u4e86\u4e00\u5b9a\u7684\u6d77\u62d4\u9ad8\u5ea6\u3002\u6211\u8fd9\u6b21\u5236\u4f5c\u51fa\u6765\u7684\u8bbe\u5907\uff0c\u5f53\u6d77\u62d4\u8fbe\u5230\u6216\u8005\u8d85\u51fa200m\uff0c\u5c31\u4f1a\u6709\u4e24\u4e2aLED\u53d1\u5149\u3002<\/p>\n<p>\u6700\u7ec8\u5b8c\u6210\u7684Sketch\u5982\u4e0b\uff0c\u5176\u4e2d\u6d45\u84dd\u8272\u90e8\u5206\uff0c\u4e5f\u5c31\u662f\u63a7\u5236LED\u53d1\u5149\u7684\u547d\u4ee4\uff0c\u8fd8\u53ef\u4ee5\u6539\u6210\u5f53\u6e29\u5ea6\u4e0a\u5347\u5230\u67d0\u4e00\u6570\u503c\u65f6\uff0c\u5c31\u8fdb\u884c\u663e\u793a\u7684\u547d\u4ee4\u3002\u8bf7\u6839\u636e\u60a8\u81ea\u5df1\u60f3\u6d4b\u91cf\u7684\u5185\u5bb9\u548c\u60f3\u663e\u793a\u7684\u4fe1\u606f\u8fdb\u884c\u8c03\u6574\u3002<\/p>\n<pre class=\"crayon-plain-tag\">#include  \r\n #include \"BM1383AGLV.h\" \r\n BM1383AGLV bm1383aglv; \r\n   void setup() { \r\n byte rc; \r\n   Serial.begin(115200); \r\n while (!Serial); \r\n Wire.begin(); \r\n   rc = bm1383aglv.init(); \r\n if (rc != 0) { \r\n Serial.println(\"BM1383AGLV initialization failed\"); \r\n Serial.flush(); \r\n } \r\n pinMode(LED0, OUTPUT); \r\n pinMode(LED1, OUTPUT); \r\n pinMode(LED2, OUTPUT); \r\n pinMode(LED3, OUTPUT); \r\n } \r\n   void loop() { \r\n byte rc; \r\n float press = 0, temp = 0, altitude = 0; \r\n volatile float refPress = 1013.15;\/\/\u9ad8\u5ea6\u8a08\u7b97\u306b\u4f7f\u7528\u3059\u308b\u57fa\u6e96\u9ad8\u5ea6\u3067\u306e\u5927\u6c17\u5727[hPa] \r\n volatile float refTemp = 15.0;\/\/\u9ad8\u5ea6\u8a08\u7b97\u306b\u4f7f\u7528\u3059\u308b\u57fa\u6e96\u6e29\u5ea6[C] \r\n rc1 = bm1383aglv.get_val(&amp;press, &amp;temp); \r\n altitude = ((pow((refPress \/ press), (1 \/ 5.257)) - 1) * (refTemp + 273.15)) \/ 0.0065; \r\n   Serial.print(\"ALT: \"); \r\n Serial.print(altitude);  \r\n Serial.println(\" [m]\"); \r\n Serial.print(\"TEMP: \"); \r\n Serial.print(temp); \r\n Serial.println(\" [C]\");  \r\n Serial.println(); \r\n delay(50); \r\n   if ( (altitude &gt; 50) &amp;&amp; (altitude &lt; 200) ) { digitalWrite(LED0, HIGH); } else if ( (altitude &gt;= 200) &amp;&amp; (altitude &lt; 300) ) { digitalWrite(LED1, HIGH); } else if ( (altitude &gt;= 300) &amp;&amp; (altitude &lt; 400) ) { digitalWrite(LED2, HIGH); } else if (altitude &gt;= 400) { \r\n digitalWrite(LED3, HIGH); \r\n } else { \r\n digitalWrite(LED0, LOW); \r\n digitalWrite(LED1, LOW); \r\n digitalWrite(LED2, LOW); \r\n digitalWrite(LED3, LOW); \r\n } \r\n } \r\n<\/pre>\n<p>&nbsp;<\/p>\n<p>\u5373\u4f7f\u662f\u672c\u9879\u76ee\u91cc\u9762\u7528\u5230\u7684\u5c0f\u7535\u6c60\uff0c\u4e5f\u80fd\u7528\u4e0a\u597d\u51e0\u4e2a\u5c0f\u65f6\u3002\u56e0\u6b64\uff0c\u5f3a\u70c8\u5efa\u8bae\u5728\u6625\u5149\u70c2\u6f2b\u7684\u5b63\u8282\u91cc\uff0c\u5e26\u4e0a\u81ea\u5df1\u4eb2\u81ea\u5236\u4f5c\u7684\u5c0f\u8bbe\u5907\uff0c\u5728\u786e\u8ba4\u6c14\u6e29\u548c\u6d77\u62d4\u7b49\u4fe1\u606f\u7684\u540c\u65f6\uff0c\u95f2\u60c5\u6563\u6b65\uff0c\u4e3a\u60a8\u7684\u5065\u5eb7\u7ba1\u7406\u6dfb\u7816\u52a0\u74e6\uff01<\/p>\n<h2>4. \u603b\u7ed3<\/h2>\n<p>\u5728\u672c\u9879\u76ee\u91cc\u9762\uff0c\u6211\u4eec\u7528\u5230\u4e86极悦娱乐\u63a8\u51fa\u7684\u9644\u52a0\u677f\u3002<br \/>\n\u53ea\u8981\u5c06\u9644\u52a0\u677f\u63d2\u5165Spresense\uff0c\u5c31\u80fd\u6d4b\u91cf\u52a0\u901f\u5ea6\u3001\u6c14\u538b\u3001\u5730\u78c1\u7684\u6570\u503c\uff0c\u975e\u5e38\u65b9\u4fbf\u3002极悦娱乐\u63a8\u51fa\u7684\u5176\u4ed6\u4f20\u611f\u5668\u4e5f\u4e0d\u9700\u8981\u710a\u63a5\uff0c\u5c31\u53ef\u4ee5\u76f4\u63a5\u4f7f\u7528\u3002\u6709\u4e86\u5b83\u4eec\uff0c\u4f7f\u7528Spresense\u8fdb\u884c\u7535\u5b50\u5236\u4f5c\u7684\u95e8\u69db\u4e00\u4e0b\u5b50\u5c31\u4f4e\u4e86\u5f88\u591a\uff0c\u5bf9\u5427\uff1f<br \/>\n\u6b64\u5916\uff0c\u8fd9\u6b3e\u5f00\u53d1\u677f\u7684\u529f\u8017\u975e\u5e38\u4f4e\uff0c\u5373\u4f7f\u662f\u5c0f\u578b\u7535\u6c60\uff0c\u4e5f\u80fd\u957f\u65f6\u95f4\u4f7f\u7528\uff0c\u5bf9\u4e8e\u5236\u4f5c\u79fb\u52a8\u8bbe\u5907\u6765\u8bf4\uff0c\u7b80\u76f4\u662f\u518d\u5408\u9002\u4e0d\u8fc7\u4e86\u3002<\/p>\n<p>\u4e0b\u6b21\uff0c\u6211\u5c06\u8fdb\u4e00\u6b65\u6dfb\u52a0\u4f20\u611f\u5668\u7b49\u90e8\u4ef6\uff0c\u5236\u4f5c\u66f4\u591a\u7684\u6709\u8da3\u7684\u7535\u5b50\u4f5c\u54c1\u3002<br \/>\n\u656c\u8bf7\u671f\u5f85\uff01<\/p>\n<p>(\u5409\u7530)<\/p>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n<p><span style=\"font-size: 14pt;\"><strong>\u672c\u7cfb\u5217\u8fde\u8f7d\u7684\u5185\u5bb9<\/strong><\/span><\/p>\n<p>\u7b2c1\u7bc7\uff1a<a href=\"https:\/\/techclass.wfjydl.com\/knowledge\/tech-info\/arduino\/hobby\/spresense-01\/\">\u4ec0\u4e48\u662fSpresense\uff1f<\/a><br \/>\n\u7b2c2\u7bc7\uff1a<a href=\"https:\/\/techclass.wfjydl.com\/knowledge\/tech-info\/arduino\/hobby\/spresense-02\/\">\u4f7f\u7528Spresense\u5236\u4f5c\u9ad8\u5206\u8fa8\u7387\u97f3\u4e50\u64ad\u653e\u5668\uff01<\/a><br \/>\n\u7b2c3\u7bc7\uff1a\u4f7f\u7528极悦娱乐\u9644\u52a0\u677f\uff0c\u901a\u8fc7Spresense\u8f7b\u677e\u5b9e\u73b0\u4f20\u611f\u5668\u68c0\u6d4b\uff01\uff08\u672c\u6587\uff09<br \/>\n\u7b2c4\u7bc7\uff1a<a href=\"https:\/\/techclass.wfjydl.com\/knowledge\/tech-info\/arduino\/hobby\/spresense-04\/\">\u4f7f\u7528极悦娱乐\u7684BLE\u9644\u52a0\u677f\uff0c\u901a\u8fc7\u667a\u80fd\u624b\u673a\u73a9\u8f6c\u9ad8\u5206\u8fa8\u7387\u97f3\u4e50\u64ad\u653e\u5668\uff01<\/a><br \/>\n\u7b2c5\u7bc7\uff1a<a href=\"https:\/\/techclass.wfjydl.com\/knowledge\/tech-info\/arduino\/hobby\/spresense-05\/\">\u4f7f\u7528Spresense\u76f8\u673a\u677f\u5236\u4f5c\u6570\u7801\u76f8\u673a\uff01<\/a><\/p>\n<div class=\"author-box-wrapper\">\n<div class=\"avatar-wrapper\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-30212\" src=\"https:\/\/techclass.wfjydl.com\/wp-content\/uploads\/2023\/07\/Yoshiken.png\" alt=\"\" width=\"83\" height=\"90\" \/><\/div>\n<div class=\"desc-wrapper\">\n<h5>\u5409\u7530\u3000\u663e\u4e00\uff08Yoshiken\uff09<\/h5>\n<div class=\"desc\">\n<p>\u5728\u666e\u901a\u516c\u53f8\u5de5\u4f5c\u7684\u4e0a\u73ed\u65cf\uff0c\u975e\u5e38\u559c\u6b22\u521b\u4f5c\u7684\u5468\u672b\u521b\u5ba2\uff0c\u51fa\u7248\u4e86\u7535\u5b50\u4e66MESHBOOK\uff0c\u5e73\u65f6\u4e5f\u5199\u5199\u535a\u5ba2\u3002<br \/>\nhttp:\/\/blog.ktrips.net<\/p>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"\u4f7f\u7528极悦娱乐\u9644\u52a0\u677f\uff0c\u901a\u8fc7Spresense\u8f7b\u677e\u5b9e\u73b0\u4f20\u611f\u5668\u68c0\u6d4b\uff01 &nbsp; \u7b2c1\u56de\uff1a\u4ec0\u4e48\u662fSpresense\uff1f \u7b2c2\u56de\uff1a\u4f7f\u7528Spresense\u5236\u4f5c\u9ad8\u5206\u8fa8\u7387\u97f3\u4e50\u64ad\u653e\u5668\uff01 &nbsp; \u5927\u5bb6\u597d\uff0c\u6211\u662f\u5409\u7530\uff01 \u8fd9\u662f\u4f7f\u7528\u7d22\u5c3c\u63a8\u51fa [&hellip;]","protected":false},"author":4,"featured_media":23853,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[2060],"tags":[],"class_list":["post-23681","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-hobby"],"acf":[],"wps_subtitle":"","_links":{"self":[{"href":"https:\/\/techclass.wfjydl.com\/wp-json\/wp\/v2\/posts\/23681","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/techclass.wfjydl.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/techclass.wfjydl.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/techclass.wfjydl.com\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/techclass.wfjydl.com\/wp-json\/wp\/v2\/comments?post=23681"}],"version-history":[{"count":15,"href":"https:\/\/techclass.wfjydl.com\/wp-json\/wp\/v2\/posts\/23681\/revisions"}],"predecessor-version":[{"id":30260,"href":"https:\/\/techclass.wfjydl.com\/wp-json\/wp\/v2\/posts\/23681\/revisions\/30260"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/techclass.wfjydl.com\/wp-json\/wp\/v2\/media\/23853"}],"wp:attachment":[{"href":"https:\/\/techclass.wfjydl.com\/wp-json\/wp\/v2\/media?parent=23681"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/techclass.wfjydl.com\/wp-json\/wp\/v2\/categories?post=23681"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/techclass.wfjydl.com\/wp-json\/wp\/v2\/tags?post=23681"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}