{"id":4804,"date":"2018-05-17T19:55:56","date_gmt":"2018-05-17T16:55:56","guid":{"rendered":"http:\/\/roboromania.ro\/?p=4804"},"modified":"2018-10-13T13:05:24","modified_gmt":"2018-10-13T10:05:24","slug":"robot-4wd-roboromania-autonom-ocolire-obstacole-realizat-de-mers-robotica-pentru-copii-mihai-dascaliuc","status":"publish","type":"post","link":"https:\/\/roboromania.ro\/?p=4804","title":{"rendered":"Robot 4WD Roboromania autonom ocolire obstacole realizat de MERS Robotica pentru copii &#8211; Mihai Dasc\u0103liuc &#8211; Constan\u0163a"},"content":{"rendered":"<h3><span style=\"color: #0000ff;\">Robot 4WD Roboromania autonom ocolire obstacole realizat de MERS Robotica pentru copii &#8211; Mihai Dasc\u0103liuc<\/span><\/h3>\n<p><span style=\"color: #0000ff;\">MERS Robotica pentru copii &#8211; Constan\u0163a<\/span>\u00a0 https:\/\/www.facebook.com\/roboticaconstanta\/<\/p>\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\/05\/3.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-4805\" src=\"http:\/\/roboromania.ro\/wp-content\/uploads\/2018\/05\/3-300x225.jpg\" alt=\"3\" width=\"300\" height=\"225\" srcset=\"https:\/\/roboromania.ro\/wp-content\/uploads\/2018\/05\/3-300x225.jpg 300w, https:\/\/roboromania.ro\/wp-content\/uploads\/2018\/05\/3.jpg 960w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><a href=\"http:\/\/roboromania.ro\/wp-content\/uploads\/2018\/05\/2.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-4806\" src=\"http:\/\/roboromania.ro\/wp-content\/uploads\/2018\/05\/2-300x225.jpg\" alt=\"2\" width=\"300\" height=\"225\" srcset=\"https:\/\/roboromania.ro\/wp-content\/uploads\/2018\/05\/2-300x225.jpg 300w, https:\/\/roboromania.ro\/wp-content\/uploads\/2018\/05\/2-1024x768.jpg 1024w, https:\/\/roboromania.ro\/wp-content\/uploads\/2018\/05\/2.jpg 2016w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><a href=\"http:\/\/roboromania.ro\/wp-content\/uploads\/2018\/05\/1.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone size-medium wp-image-4807\" src=\"http:\/\/roboromania.ro\/wp-content\/uploads\/2018\/05\/1-300x225.jpg\" alt=\"1\" width=\"300\" height=\"225\" srcset=\"https:\/\/roboromania.ro\/wp-content\/uploads\/2018\/05\/1-300x225.jpg 300w, https:\/\/roboromania.ro\/wp-content\/uploads\/2018\/05\/1-1024x768.jpg 1024w, https:\/\/roboromania.ro\/wp-content\/uploads\/2018\/05\/1.jpg 2016w\" sizes=\"auto, (max-width: 300px) 100vw, 300px\" \/><\/a><a href=\"http:\/\/roboromania.ro\/wp-content\/uploads\/2018\/05\/4wd.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-5228\" src=\"http:\/\/roboromania.ro\/wp-content\/uploads\/2018\/05\/4wd-300x216.jpg\" alt=\"4wd\" width=\"313\" height=\"225\" srcset=\"https:\/\/roboromania.ro\/wp-content\/uploads\/2018\/05\/4wd-300x216.jpg 300w, https:\/\/roboromania.ro\/wp-content\/uploads\/2018\/05\/4wd.jpg 758w\" sizes=\"auto, (max-width: 313px) 100vw, 313px\" \/><\/a><a href=\"http:\/\/roboromania.ro\/wp-content\/uploads\/2018\/05\/2wd.jpg\"><img loading=\"lazy\" decoding=\"async\" class=\"alignnone wp-image-5229\" src=\"http:\/\/roboromania.ro\/wp-content\/uploads\/2018\/05\/2wd-300x184.jpg\" alt=\"2wd\" width=\"302\" height=\"185\" srcset=\"https:\/\/roboromania.ro\/wp-content\/uploads\/2018\/05\/2wd-300x184.jpg 300w, https:\/\/roboromania.ro\/wp-content\/uploads\/2018\/05\/2wd.jpg 816w\" sizes=\"auto, (max-width: 302px) 100vw, 302px\" \/><\/a><\/p>\n<p>Aveti nevoie de :<br \/>\n<a href=\"http:\/\/roboromania.ro\/categorie-produs\/placi-de-dezvoltare\/\" target=\"_blank\">o Plac\u0103 de dezvoltare tip Arduino UNO (oricare)<\/a><br \/>\n<a href=\"http:\/\/roboromania.ro\/produs\/motor-drive-module-l293d\/\" target=\"_blank\">un Modul driver motoare L293D<\/a><br \/>\n<a href=\"http:\/\/roboromania.ro\/produs\/senzorul-cu-ultrasunete-hc-sr04\/\" target=\"_blank\">un <span id=\"result_box\" class=\"\" lang=\"ro\"><span class=\"hps\">Senzor<\/span> <span class=\"hps\">cu ultrasunete<\/span> <span class=\"hps\">HC<\/span><span class=\"atn\">\u2013<\/span>SR04<\/span><\/a><br \/>\n<a href=\"http:\/\/roboromania.ro\/produs\/kit-sasiu-4wd-robot-car-chassis-kit\/\" target=\"_blank\">un Kit \u0219asiu 4WD<\/a><br \/>\n<a href=\"http:\/\/roboromania.ro\/categorie-produs\/breadboard\/\" target=\"_blank\">cabluri Dupont<\/a><\/p>\n<p>Modul driver motoare L293D este shield si nu ave\u021bi cum s\u0103 gre\u0219i\u021bi pinii<\/p>\n<p>Codul (sau <a href=\"http:\/\/roboromania.ro\/proiecte\/robot-4WD\/4wd_cu_schield_ultima_varinta_modificata_pentru_4_motoare.zip\" target=\"_blank\">download<\/a>) :<\/p>\n<p>\/\/ Robot 4WD autonom ocolire obstacole &#8211; &#8222;MERS Robotica pentru copii&#8221; &#8211; Mihai Dascaliuc<\/p>\n<p>#include &lt;AFMotor.h&gt; \/\/import your motor shield library<br \/>\n#define trigPin A0 \/\/ define the pins of your sensor<br \/>\n#define echoPin A1<br \/>\nAF_DCMotor motor1(1,MOTOR12_64KHZ); \/\/ set up motors.<br \/>\nAF_DCMotor motor2(2, MOTOR12_8KHZ);<br \/>\nAF_DCMotor motor3(3, MOTOR12_8KHZ);<br \/>\nAF_DCMotor motor4(4, MOTOR12_8KHZ);<\/p>\n<p>void setup() {<br \/>\nSerial.begin(9600); \/\/ begin serial communitication<br \/>\nSerial.println(&#8222;Motor test!&#8221;);<br \/>\npinMode(trigPin, OUTPUT);\/\/ set the trig pin to output (Send sound waves)<br \/>\npinMode(echoPin, INPUT);\/\/ set the echo pin to input (recieve sound waves)<br \/>\nmotor1.setSpeed(200); \/\/set the speed of the motors, between 0-255<br \/>\nmotor2.setSpeed (200);<br \/>\nmotor3.setSpeed (200);<br \/>\nmotor4.setSpeed (200);<br \/>\n}<\/p>\n<p>void loop() {<\/p>\n<p>long duration, distance; \/\/ start the scan<br \/>\ndigitalWrite(trigPin, LOW);<br \/>\ndelayMicroseconds(2); \/\/ delays are required for a succesful sensor operation.<br \/>\ndigitalWrite(trigPin, HIGH);<\/p>\n<p>delayMicroseconds(10); \/\/this delay is required as well!<br \/>\ndigitalWrite(trigPin, LOW);<br \/>\nduration = pulseIn(echoPin, HIGH);<br \/>\ndistance = (duration\/2) \/ 29.1;\/\/ convert the distance to centimeters.<br \/>\nif (distance &lt; 40)\/*if there&#8217;s an obstacle 25 centimers, ahead, do the following: *\/ {<br \/>\nSerial.println(&#8222;Close Obstacle detected!&#8221; );<br \/>\nSerial.println(&#8222;Obstacle Details:&#8221;);<br \/>\nSerial.print(&#8222;Distance From Robot is &#8221; );<br \/>\nSerial.print( distance);<br \/>\nSerial.print( &#8221; CM!&#8221;);\/\/ print out the distance in centimeters.<\/p>\n<p>Serial.println(&#8221; The obstacle is declared a threat due to close distance. &#8222;);<br \/>\nSerial.println(&#8221; Turning !&#8221;);<br \/>\nmotor1.run(FORWARD); \/\/ Turn as long as there&#8217;s an obstacle ahead.<br \/>\nmotor2.run(FORWARD);<br \/>\nmotor3.run(BACKWARD);<br \/>\nmotor4.run(BACKWARD);<br \/>\n} else {<br \/>\nSerial.println(&#8222;No obstacle detected. going forward&#8221;);<br \/>\ndelay (15);<br \/>\nmotor1.run(FORWARD); \/\/if there&#8217;s no obstacle ahead, Go Forward!<br \/>\nmotor2.run(FORWARD);<br \/>\nmotor3.run(FORWARD);<br \/>\nmotor4.run(FORWARD);<br \/>\n}<br \/>\n}<\/p>\n<p><a href=\"http:\/\/roboromania.ro\/wp-content\/uploads\/2018\/06\/video.mov\" target=\"_blank\">filmule\u021b realizat de MERS Robotica pentru copii &#8211; Constan\u0163a<\/a><\/p>\n<p><span style=\"color: #0000ff;\">Succes!<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Robot 4WD Roboromania autonom ocolire obstacole realizat de MERS Robotica pentru copii &#8211; Mihai Dasc\u0103liuc MERS Robotica pentru copii &#8211; Constan\u0163a\u00a0 https:\/\/www.facebook.com\/roboticaconstanta\/ Aveti nevoie de : o Plac\u0103 de dezvoltare tip Arduino UNO (oricare) un Modul driver motoare L293D un Senzor cu ultrasunete HC\u2013SR04 un Kit \u0219asiu 4WD cabluri Dupont Modul driver motoare L293D este [&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-4804","post","type-post","status-publish","format-standard","hentry","category-tutoriale-arduino"],"_links":{"self":[{"href":"https:\/\/roboromania.ro\/index.php?rest_route=\/wp\/v2\/posts\/4804","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=4804"}],"version-history":[{"count":8,"href":"https:\/\/roboromania.ro\/index.php?rest_route=\/wp\/v2\/posts\/4804\/revisions"}],"predecessor-version":[{"id":5240,"href":"https:\/\/roboromania.ro\/index.php?rest_route=\/wp\/v2\/posts\/4804\/revisions\/5240"}],"wp:attachment":[{"href":"https:\/\/roboromania.ro\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4804"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/roboromania.ro\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4804"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/roboromania.ro\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4804"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}