{"id":827,"date":"2019-12-31T18:28:39","date_gmt":"2019-12-31T09:28:39","guid":{"rendered":"https:\/\/dalomo.net\/blog\/?p=827"},"modified":"2019-12-31T18:28:39","modified_gmt":"2019-12-31T09:28:39","slug":"bluetooth%e3%83%a2%e3%82%b8%e3%83%a5%e3%83%bc%e3%83%ab%e3%81%aehc-06%e3%82%92%e4%bd%bf%e3%81%84%e3%81%9f%e3%81%84-arduinohc-06","status":"publish","type":"post","link":"https:\/\/dalomo.net\/blog\/2019\/12\/31\/827\/","title":{"rendered":"Bluetooth\u30e2\u30b8\u30e5\u30fc\u30eb\u306eHC-06\u3092\u4f7f\u3044\u305f\u3044 Arduino+HC-06"},"content":{"rendered":"<h1>HC-06<\/h1>\n<p>Bluetooth\u3067\u81ea\u52d5\u8d70\u884c\u8eca\u3092\u64cd\u4f5c\u3057\u305f\u3044\u3002\u3053\u308c\u3067\u30e9\u30b8\u30b3\u30f3\u3068\u3044\u3048\u308b\u3093\u3058\u3083\u306a\u304b\u308d\u3046\u304b\u3002\u305d\u306e\u524d\u306bHC-06\u306e\u4f7f\u3044\u65b9\u3092\u78ba\u8a8d\u3057\u3066\u3044\u304f\u3002\u3068\u3044\u3063\u3066\u3082\u53c2\u8003\u30b5\u30a4\u30c8\u306e\u30b3\u30fc\u30c9\u3092\u4f7f\u3063\u305f\u3060\u3051\u3060\u3002<\/p>\n<h2>\u30b9\u30b1\u30c3\u30c1<\/h2>\n<pre><code class=\"cpp\">#include &lt;SoftwareSerial.h&gt;\r\nSoftwareSerial mySerial(16, 14);\/\/RX, TX\r\n\r\nvoid setup() {\r\n  pinMode(LED_BUILTIN, OUTPUT);\r\n  mySerial.begin(9600);\r\n}\r\n\r\nvoid loop() {\r\n  if (mySerial.available() &gt; 0) {\r\n    char c = mySerial.read();\r\n    if (c == 'n') {\r\n      digitalWrite(LED_BUILTIN, HIGH);\r\n    } else if (c == 'f') {\r\n      digitalWrite(LED_BUILTIN, LOW);\r\n    }\r\n  }\r\n}<\/code><\/pre>\n<p>DMMicro\u306eRX, TX\u30d4\u30f3\u3092\u4f7f\u3063\u3066\u3082\u4e0a\u624b\u304f\u3044\u304b\u306a\u304b\u3063\u305f\u3002\u306a\u306e\u3067\u9069\u5f53\u306a\u30d4\u30f3\u3092\u6307\u5b9a\u3057\u3066SoftwareSerial\u3092\u4f7f\u3046\u3068\u4e0a\u624b\u304f\u3044\u3063\u305f\u3002\u3053\u3053\u307e\u3067\u9577\u304b\u3063\u305f\u2026\u3002Android\u30a2\u30d7\u30ea\u4f7f\u3046\u3068\u5199\u771f\u304c\u64ae\u308c\u306a\u3044\u3002\u3002\u3002\u3042\u3068\u306f\u52d5\u304d\u3092\u4f5c\u308c\u3070\u30e9\u30b8\u30b3\u30f3\u304c\u3067\u304d\u308b\u305e\u3002<\/p>\n<p>Android\u30a2\u30d7\u30ea\u306b\u306f<\/p>\n<p><a href=\"https:\/\/play.google.com\/store\/apps\/details?id=de.kai_morich.serial_bluetooth_terminal\">https:\/\/play.google.com\/store\/apps\/details?id=de.kai_morich.serial_bluetooth_terminal<\/a><\/p>\n<p>\u3092\u4f7f\u7528\u3057\u305f\u3002<\/p>\n<p>\u307e\u305f\u3001\u8ad6\u7406\u30ec\u30d9\u30eb\u5909\u63db\u306b\u306f<\/p>\n<p><a href=\"http:\/\/akizukidenshi.com\/catalog\/g\/gK-13837\/\">http:\/\/akizukidenshi.com\/catalog\/g\/gK-13837\/<\/a><\/p>\n<p>\u3053\u3061\u3089\u3092\u4f7f\u7528\u3057\u305f\u3002<\/p>\n<h2>\u53c2\u8003<\/h2>\n<p><a href=\"http:\/\/robozak.jugem.jp\/?eid=1053969\">http:\/\/robozak.jugem.jp\/?eid=1053969<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>HC-06 Bluetooth\u3067\u81ea\u52d5\u8d70\u884c\u8eca\u3092\u64cd\u4f5c\u3057\u305f\u3044\u3002\u3053\u308c\u3067\u30e9\u30b8\u30b3\u30f3\u3068\u3044\u3048\u308b\u3093\u3058\u3083\u306a\u304b\u308d\u3046\u304b\u3002\u305d\u306e\u524d\u306bHC-06\u306e\u4f7f\u3044\u65b9\u3092\u78ba\u8a8d\u3057\u3066\u3044\u304f\u3002\u3068\u3044\u3063\u3066\u3082\u53c2\u8003\u30b5\u30a4\u30c8\u306e\u30b3\u30fc\u30c9\u3092\u4f7f\u3063\u305f\u3060\u3051\u3060\u3002 \u30b9\u30b1\u30c3\u30c1 #include &lt; &hellip; <a href=\"https:\/\/dalomo.net\/blog\/2019\/12\/31\/827\/\">\u7d9a\u304d\u3092\u8aad\u3080 <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[8],"tags":[69,77,78,76,54],"class_list":{"0":"post-827","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"hentry","6":"category-8","7":"tag-arduino","8":"tag-bluetooth","10":"tag-hc-06","11":"tag-54"},"_links":{"self":[{"href":"https:\/\/dalomo.net\/blog\/wp-json\/wp\/v2\/posts\/827","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/dalomo.net\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/dalomo.net\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/dalomo.net\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/dalomo.net\/blog\/wp-json\/wp\/v2\/comments?post=827"}],"version-history":[{"count":1,"href":"https:\/\/dalomo.net\/blog\/wp-json\/wp\/v2\/posts\/827\/revisions"}],"predecessor-version":[{"id":828,"href":"https:\/\/dalomo.net\/blog\/wp-json\/wp\/v2\/posts\/827\/revisions\/828"}],"wp:attachment":[{"href":"https:\/\/dalomo.net\/blog\/wp-json\/wp\/v2\/media?parent=827"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/dalomo.net\/blog\/wp-json\/wp\/v2\/categories?post=827"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/dalomo.net\/blog\/wp-json\/wp\/v2\/tags?post=827"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}