{"id":4169,"date":"2018-01-19T13:53:54","date_gmt":"2018-01-19T10:53:54","guid":{"rendered":"http:\/\/roboromania.ro\/?p=4169"},"modified":"2019-04-08T17:38:28","modified_gmt":"2019-04-08T14:38:28","slug":"robot-2wd-roboromania-comandat-bluetooth-cu-telefonul","status":"publish","type":"post","link":"https:\/\/roboromania.ro\/?p=4169","title":{"rendered":"Robot 2WD Roboromania comandat Bluetooth (cu telefonul)"},"content":{"rendered":"<h3><span style=\"color: #0000ff;\">Robot 2WD Roboromania comandat Bluetooth (cu telefonul)<\/span><\/h3>\n<p><a href=\"http:\/\/roboromania.ro\/wp-content\/uploads\/2018\/01\/default_comp26.gif\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-4200\" src=\"http:\/\/roboromania.ro\/wp-content\/uploads\/2018\/01\/default_comp26.gif\" alt=\"default_comp26\" width=\"38\" height=\"26\" \/><\/a><\/p>\n<p><a href=\"http:\/\/roboromania.ro\/wp-content\/uploads\/2018\/01\/Robot-2WD-bluetooth-roboromania-conectare.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-4170\" src=\"http:\/\/roboromania.ro\/wp-content\/uploads\/2018\/01\/Robot-2WD-bluetooth-roboromania-conectare-300x243.jpg\" alt=\"robot-2wd-bluetooth-roboromania-conectare\" width=\"300\" height=\"243\" srcset=\"https:\/\/roboromania.ro\/wp-content\/uploads\/2018\/01\/Robot-2WD-bluetooth-roboromania-conectare-300x243.jpg 300w, https:\/\/roboromania.ro\/wp-content\/uploads\/2018\/01\/Robot-2WD-bluetooth-roboromania-conectare-1024x830.jpg 1024w, https:\/\/roboromania.ro\/wp-content\/uploads\/2018\/01\/Robot-2WD-bluetooth-roboromania-conectare.jpg 1077w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p>Avem nevoie de :<br \/>\no <span style=\"text-decoration: underline;\"><a href=\"http:\/\/roboromania.ro\/produs\/placa-de-dezvoltare-uno-r3-placa-de-dezvoltare-compatibila-arduino\/\" target=\"_blank\">plac\u0103 de dezvoltare tip Arduino UNO<\/a><\/span> (sau oricare)<br \/>\nun modul <a href=\"http:\/\/roboromania.ro\/produs\/modul-bluetooth-hc-05-compatibil-arduino\/\" target=\"_blank\">Bluetooth HC-05<\/a> (sau HC-06)<br \/>\nun modul <a href=\"http:\/\/roboromania.ro\/produs\/l298n\/\" target=\"_blank\">driver motoare L298N<\/a><br \/>\n<a href=\"http:\/\/roboromania.ro\/produs\/kit-sasiu-2wd-robot-car-chassis-kit-construieste-singur-un-robot\/\" target=\"_blank\">\u0219asiu cu 2 motoare 2WD<\/a><br \/>\n<a href=\"http:\/\/roboromania.ro\/produs\/breadboard-din-plastic-cu-800-contacte-nichelate-65-fire-dupont\/\" target=\"_blank\">cabluri Dupont<\/a><\/p>\n<p>Pute\u021bi folosi orice APK din Play Store (ex. : Arduino Bluetooth Controller) \u0219i nu uita\u021bi sa seta\u021bi butoanele din aplica\u021bie<\/p>\n<p>Cel mai simplu cod :<\/p>\n<p>\/\/&#8211;&#8211;&#8211;&#8211;&#8211;&#8211;&#8211;&#8211;&#8211;&#8211;&#8211;&#8211;&#8211;&#8211;<\/p>\n<p>#include &lt;SoftwareSerial.h&gt;\u00a0 \/\/ nativa ID Arduino<\/p>\n<p>#define in1 5 \/\/L298n Motor Driver pins.<br \/>\n#define in2 6<br \/>\n#define in3 10<br \/>\n#define in4 11<\/p>\n<p>#define SPEED 200<\/p>\n<p>SoftwareSerial blue_serial(3, 4); \/\/ RX, TX<\/p>\n<p>void setup() {<br \/>\npinMode(in1, OUTPUT);<br \/>\npinMode(in2, OUTPUT);<br \/>\npinMode(in3, OUTPUT);<br \/>\npinMode(in4, OUTPUT);<br \/>\nblue_serial.begin(9600);<br \/>\n}<\/p>\n<p>void loop() {<br \/>\nint command = blue_serial.read();<br \/>\nif(command != -1) {<br \/>\nswitch (command) {<br \/>\ncase &#8216;F&#8217;: forward(); break;<br \/>\ncase &#8216;B&#8217;: back(); break;<br \/>\ncase &#8216;L&#8217;: left(); break;<br \/>\ncase &#8216;R&#8217;: right(); break;<br \/>\ncase &#8216;K&#8217;: stop(); break;<br \/>\n}<br \/>\ndelay(10);<br \/>\n}<br \/>\n}<\/p>\n<p>void forward() {<br \/>\nstop();<br \/>\nanalogWrite(in1, SPEED);<br \/>\nanalogWrite(in3, SPEED);<br \/>\n}<\/p>\n<p>void back() {<br \/>\nstop();<br \/>\nanalogWrite(in2, SPEED);<br \/>\nanalogWrite(in4, SPEED);<br \/>\n}<\/p>\n<p>void left() {<br \/>\nstop();<br \/>\nanalogWrite(in3, SPEED);<br \/>\nanalogWrite(in2, SPEED);<br \/>\n}<\/p>\n<p>void right() {<br \/>\nstop();<br \/>\nanalogWrite(in4, SPEED);<br \/>\nanalogWrite(in1, SPEED);<br \/>\n}<\/p>\n<p>void stop() {<br \/>\nanalogWrite(in1, 0);<br \/>\nanalogWrite(in2, 0);<br \/>\nanalogWrite(in3, 0);<br \/>\nanalogWrite(in4, 0);<br \/>\n}<\/p>\n<p>\/\/&#8211;&#8211;&#8211;&#8211;&#8211;&#8211;&#8211;&#8211;&#8211;&#8211;&#8211;&#8211;&#8211;&#8211;<\/p>\n<p>Acum mai trebuie\u0219te instalat\u0103 \u0219i configurat\u0103 aplica\u021bia pentru telefon \u00een Google Play :<\/p>\n<h4 class=\"AHFaub\">Arduino bluetooth controller<\/h4>\n<p><a href=\"http:\/\/roboromania.ro\/wp-content\/uploads\/2017\/06\/ikon.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-full wp-image-5903\" src=\"http:\/\/roboromania.ro\/wp-content\/uploads\/2017\/06\/ikon.png\" alt=\"ikon\" width=\"168\" height=\"92\" \/><\/a><\/p>\n<p><a href=\"http:\/\/roboromania.ro\/wp-content\/uploads\/2017\/06\/set-butoane.png\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-5904\" src=\"http:\/\/roboromania.ro\/wp-content\/uploads\/2017\/06\/set-butoane-300x177.png\" alt=\"set-butoane\" width=\"300\" height=\"177\" srcset=\"https:\/\/roboromania.ro\/wp-content\/uploads\/2017\/06\/set-butoane-300x177.png 300w, https:\/\/roboromania.ro\/wp-content\/uploads\/2017\/06\/set-butoane.png 800w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><\/p>\n<p><a href=\"http:\/\/roboromania.ro\/wp-content\/uploads\/2017\/06\/index.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-5905\" src=\"http:\/\/roboromania.ro\/wp-content\/uploads\/2017\/06\/index-300x168.jpg\" alt=\"index\" width=\"300\" height=\"168\" \/><\/a><\/p>\n<p><span style=\"color: #0000ff;\">Colectivul magazinului <a href=\"http:\/\/roboromania.ro\/\" target=\"_blank\">roboromania.ro<\/a> v\u0103 ureaz\u0103 succes !\u00a0 Dup\u0103 realizare va rugam sa trimite\u021bi poze \u0219i sugestii.<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Robot 2WD Roboromania comandat Bluetooth (cu telefonul) Avem nevoie de : o plac\u0103 de dezvoltare tip Arduino UNO (sau oricare) un modul Bluetooth HC-05 (sau HC-06) un modul driver motoare L298N \u0219asiu cu 2 motoare 2WD cabluri Dupont Pute\u021bi folosi orice APK din Play Store (ex. : Arduino Bluetooth Controller) \u0219i nu uita\u021bi sa seta\u021bi [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[176],"tags":[],"class_list":["post-4169","post","type-post","status-publish","format-standard","hentry","category-tutoriale-arduino"],"_links":{"self":[{"href":"https:\/\/roboromania.ro\/index.php?rest_route=\/wp\/v2\/posts\/4169","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/roboromania.ro\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/roboromania.ro\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/roboromania.ro\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/roboromania.ro\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4169"}],"version-history":[{"count":6,"href":"https:\/\/roboromania.ro\/index.php?rest_route=\/wp\/v2\/posts\/4169\/revisions"}],"predecessor-version":[{"id":5911,"href":"https:\/\/roboromania.ro\/index.php?rest_route=\/wp\/v2\/posts\/4169\/revisions\/5911"}],"wp:attachment":[{"href":"https:\/\/roboromania.ro\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4169"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/roboromania.ro\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4169"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/roboromania.ro\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4169"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}