{"id":7638,"date":"2017-01-26T07:50:45","date_gmt":"2017-01-25T23:50:45","guid":{"rendered":"http:\/\/www.ifroglab.com\/?p=7638"},"modified":"2017-01-26T07:50:45","modified_gmt":"2017-01-25T23:50:45","slug":"1-arduino-%e7%9a%84api-%e4%bb%8b%e7%b4%b9","status":"publish","type":"post","link":"https:\/\/www.ifroglab.com\/tw\/?p=7638","title":{"rendered":"1 Arduino \u7684API \u4ecb\u7d39"},"content":{"rendered":"<p>\u6211\u5011\u7528Github Arduino \u7684\u7bc4\u4f8b\u4f86\u4ecb\u7d39\uff0c<br \/>\n\u539f\u59cb\u7a0b\u5f0f\u53ef\u4ee5\u5728<a href=\"https:\/\/github.com\/iFrogLab\/iFrogLab_F-60_UART\/tree\/master\/Sample04-iOS-Arduino-UART\/iFrogLABArduino_UART\">\u6b64\u53d6<\/a>\u5f97\uff0c<\/p>\n<p><code><br \/>\n\/*<br \/>\n* iFrogLab F-60 UART Example Code<br \/>\n* www.ifroglab.com<br \/>\n*<br \/>\n* \u529f\u80fd, ARDUINO , iFrogLabF-60<br \/>\n* \u96fb\u6e90, 5V ,VCC<br \/>\n* \u63a5\u5730, GND ,GND<br \/>\n* UART, Pin 10 ,TX<br \/>\n* UART, Pin 11 ,RX<\/code><\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-medium wp-image-7639\" src=\"http:\/\/www.ifroglab.com\/wp-content\/uploads\/2017\/01\/Screen-Shot-2017-01-25-at-3.45.35-PM-300x225.png\" alt=\"Screen Shot 2017-01-25 at 3.45.35 PM\" width=\"300\" height=\"225\" srcset=\"https:\/\/www.ifroglab.com\/tw\/wp-content\/uploads\/2017\/01\/Screen-Shot-2017-01-25-at-3.45.35-PM-300x225.png 300w, https:\/\/www.ifroglab.com\/tw\/wp-content\/uploads\/2017\/01\/Screen-Shot-2017-01-25-at-3.45.35-PM-600x451.png 600w, https:\/\/www.ifroglab.com\/tw\/wp-content\/uploads\/2017\/01\/Screen-Shot-2017-01-25-at-3.45.35-PM-768x577.png 768w, https:\/\/www.ifroglab.com\/tw\/wp-content\/uploads\/2017\/01\/Screen-Shot-2017-01-25-at-3.45.35-PM-650x488.png 650w, https:\/\/www.ifroglab.com\/tw\/wp-content\/uploads\/2017\/01\/Screen-Shot-2017-01-25-at-3.45.35-PM-633x475.png 633w, https:\/\/www.ifroglab.com\/tw\/wp-content\/uploads\/2017\/01\/Screen-Shot-2017-01-25-at-3.45.35-PM-489x367.png 489w, https:\/\/www.ifroglab.com\/tw\/wp-content\/uploads\/2017\/01\/Screen-Shot-2017-01-25-at-3.45.35-PM-420x315.png 420w, https:\/\/www.ifroglab.com\/tw\/wp-content\/uploads\/2017\/01\/Screen-Shot-2017-01-25-at-3.45.35-PM-434x326.png 434w, https:\/\/www.ifroglab.com\/tw\/wp-content\/uploads\/2017\/01\/Screen-Shot-2017-01-25-at-3.45.35-PM-70x53.png 70w, https:\/\/www.ifroglab.com\/tw\/wp-content\/uploads\/2017\/01\/Screen-Shot-2017-01-25-at-3.45.35-PM.png 841w\" sizes=\"(max-width: 300px) 100vw, 300px\" \/><\/p>\n<p>&nbsp;<\/p>\n<p>created 25 Jan 2017<br \/>\nby Powen Ko, www.iFrogLab.com<br \/>\nThis example code is in the public domain.<br \/>\n*\/<\/p>\n<p>&nbsp;<br \/>\n#include \u3000&lt;SoftwareSerial&gt;<br \/>\nSoftwareSerial mySerial(10, 11); \/\/ RX, TX<br \/>\nvoid setup()<br \/>\n{<\/p>\n<p>Serial.begin(9600);\/\/\u6253\u958b\u4e32\u53e3\u901a\u8a0a\u4e26\u7b49\u5f85\u7aef\u53e3\u6253\u958b\uff1a<br \/>\nwhile (!Serial) {<br \/>\n; \/\/\u7b49\u5f85\u4e32\u53e3\u9023\u63a5<br \/>\n}<br \/>\nSerial.println(&#8220;www.ifroglab.com&#8221;); \/\/\u986f\u793a\u5b57\u4e32<br \/>\nmySerial.begin(9600); \u00a0 \u00a0 \u00a0\u00a0\/\/ \u8a2d\u7f6eSoftwareSerial\u7aef\u53e3\u7684\u6578\u64da\u901f\u7387<br \/>\nmySerial.print(&#8220;Hello, iFrgoLab f-60 BLE&#8221;);\u3000\/\/ \u628a\u5b57\u4e32\u9001\u5230Pin 11<br \/>\n}<\/p>\n<p>void loop() \/\/ \u904b\u884c\u4e00\u904d\u53c8\u4e00\u904d<br \/>\n{<br \/>\nif (mySerial.available()) \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\/\/ \u770bArduino Pin 10 \u6709\u6c92\u6709\u8cc7\u6599<br \/>\nSerial.write(mySerial.read());\u3000\u3000\u3000\u3000\u3000\u3000\/\/\u6709\u7684\u8a71\u50b3\u7d66Pin 1 Tx, \u986f\u793a\u5728\u756b\u9762\u4e0a<br \/>\nif (Serial.available())\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0\/\/ \u770bArduino Pin 1 \u6709\u6c92\u6709\u8cc7\u6599<br \/>\nmySerial.write(Serial.read());\u3000\u3000\u3000\u3000\u3000\/\/\u6709\u7684\u8a71\u3000\u50b3\u7d66\u50b3\u7d66F-60<br \/>\n}<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u6211\u5011\u7528Github Arduino \u7684\u7bc4\u4f8b\u4f86\u4ecb\u7d39\uff0c \u539f\u59cb\u7a0b\u5f0f\u53ef\u4ee5\u5728\u6b64\u53d6\u5f97\uff0c \/* [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":7639,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-7638","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.ifroglab.com\/tw\/index.php?rest_route=\/wp\/v2\/posts\/7638"}],"collection":[{"href":"https:\/\/www.ifroglab.com\/tw\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.ifroglab.com\/tw\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.ifroglab.com\/tw\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.ifroglab.com\/tw\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=7638"}],"version-history":[{"count":1,"href":"https:\/\/www.ifroglab.com\/tw\/index.php?rest_route=\/wp\/v2\/posts\/7638\/revisions"}],"predecessor-version":[{"id":7640,"href":"https:\/\/www.ifroglab.com\/tw\/index.php?rest_route=\/wp\/v2\/posts\/7638\/revisions\/7640"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.ifroglab.com\/tw\/index.php?rest_route=\/wp\/v2\/media\/7639"}],"wp:attachment":[{"href":"https:\/\/www.ifroglab.com\/tw\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=7638"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.ifroglab.com\/tw\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=7638"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.ifroglab.com\/tw\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=7638"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}