{"id":831,"date":"2017-12-19T17:38:41","date_gmt":"2017-12-19T17:38:41","guid":{"rendered":"https:\/\/zhutarduino.wordpress.com\/?page_id=831"},"modified":"2019-03-28T21:11:58","modified_gmt":"2019-03-28T21:11:58","slug":"learning-arduino-for-beginners-ep20-android-bluetooth-control","status":"publish","type":"page","link":"https:\/\/thezhut.com\/?page_id=831","title":{"rendered":"Learning Arduino for beginners EP#20 Android Bluetooth control"},"content":{"rendered":"<h2>In this episode we will take a look at how you can use an Android device with a Bluetooth module (HC-06 or HC-05) to control your Arduino project&#8230;<\/h2>\n<h2><a href=\"https:\/\/thezhut.com\/?page_id=380\">How to connect a HC-05 or HC-06<\/a><\/h2>\n<h2><a href=\"https:\/\/www.amazon.com\/gp\/search\/ref=as_li_qf_sp_sr_il_tl?ie=UTF8&amp;tag=zhut01-20&amp;keywords=hc-06&amp;index=aps&amp;camp=1789&amp;creative=9325&amp;linkCode=xm2&amp;linkId=eb3e89127224057ac0acaafd08c877d0\" target=\"_blank\" rel=\"noopener noreferrer\">Click here to buy a HC-05 or HC-06<\/a><\/h2>\n<p><iframe loading=\"lazy\" title=\"Learning Arduino for beginners EP#20 Android Bluetooth control\" width=\"640\" height=\"360\" src=\"https:\/\/www.youtube.com\/embed\/aUGT52EkTeE?feature=oembed\" frameborder=\"0\" allow=\"accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen><\/iframe><\/p>\n<h1><strong><a href=\"https:\/\/www.facebook.com\/zarduino\/\">Check us out on Facebook!<\/a><\/strong><\/h1>\n<p><a href=\"https:\/\/thezhut.com\/wp-content\/uploads\/2017\/12\/blocks.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone  wp-image-834\" src=\"https:\/\/thezhut.com\/wp-content\/uploads\/2017\/12\/blocks.png?w=300\" alt=\"\" width=\"638\" height=\"351\" srcset=\"https:\/\/thezhut.com\/wp-content\/uploads\/2017\/12\/blocks.png 767w, https:\/\/thezhut.com\/wp-content\/uploads\/2017\/12\/blocks-300x165.png 300w\" sizes=\"auto, (max-width: 638px) 100vw, 638px\" \/><\/a><\/p>\n<h1>ARDUINO CODE:<\/h1>\n<p>#define led 13<\/p>\n<p>void setup() {<br \/>\nSerial.begin(9600);<br \/>\npinMode(led,OUTPUT);<br \/>\n}<\/p>\n<p>void loop() {<br \/>\nif (Serial.available() &gt;= 2 )<br \/>\n{<br \/>\nunsigned int a = Serial.read();<br \/>\nunsigned int b = Serial.read();<br \/>\nunsigned int val = (b * 256) + a;<\/p>\n<p>if (val == 100)<br \/>\n{<br \/>\ndigitalWrite(led,HIGH);<br \/>\n}<\/p>\n<p>else if (val == 200)<br \/>\n{<br \/>\ndigitalWrite(led,LOW);<br \/>\n}<br \/>\n}<\/p>\n<p>delay(250);<br \/>\n}<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In this episode we will take a look at how you can use an Android device with a Bluetooth module (HC-06 or HC-05) to control your Arduino project&#8230; How to connect a HC-05 or HC-06 Click here to buy a &hellip; <a href=\"https:\/\/thezhut.com\/?page_id=831\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":2,"featured_media":0,"parent":809,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_monsterinsights_skip_tracking":false,"_monsterinsights_sitenote_active":false,"_monsterinsights_sitenote_note":"","_monsterinsights_sitenote_category":0,"footnotes":"","_links_to":"","_links_to_target":""},"class_list":["post-831","page","type-page","status-publish","hentry"],"_links":{"self":[{"href":"https:\/\/thezhut.com\/index.php?rest_route=\/wp\/v2\/pages\/831","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/thezhut.com\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/thezhut.com\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/thezhut.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/thezhut.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=831"}],"version-history":[{"count":1,"href":"https:\/\/thezhut.com\/index.php?rest_route=\/wp\/v2\/pages\/831\/revisions"}],"predecessor-version":[{"id":1287,"href":"https:\/\/thezhut.com\/index.php?rest_route=\/wp\/v2\/pages\/831\/revisions\/1287"}],"up":[{"embeddable":true,"href":"https:\/\/thezhut.com\/index.php?rest_route=\/wp\/v2\/pages\/809"}],"wp:attachment":[{"href":"https:\/\/thezhut.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=831"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}