








{"id":264,"date":"2020-10-19T06:32:15","date_gmt":"2020-10-19T06:32:15","guid":{"rendered":"https:\/\/osoyoo.info\/?p=264"},"modified":"2020-10-20T21:14:32","modified_gmt":"2020-10-20T21:14:32","slug":"arduino-basic-lesson-26-basic-car","status":"publish","type":"post","link":"https:\/\/osoyoo.info\/index.php\/2020\/10\/19\/arduino-basic-lesson-26-basic-car\/","title":{"rendered":"Hardware Programming with Arduino IDE &#8211; Lesson 26:  Basic Car Movement"},"content":{"rendered":"<p><a href=\"https:\/\/osoyoo.info\/index.php\/2020\/10\/18\/253\/\"><img loading=\"lazy\" class=\"alignnone\" src=\"https:\/\/osoyoo.com\/picture\/Arduino_Graphical_Programming_Kit\/Previous.png\" alt=\"\" width=\"206\" height=\"59\" \/><\/a> \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 <a href=\"https:\/\/osoyoo.info\/index.php\/2020\/10\/11\/arduino-basic-tutorial-directory\/\"><img loading=\"lazy\" class=\"alignnone\" src=\"https:\/\/osoyoo.com\/picture\/Arduino_Graphical_Programming_Kit\/Tutorial.png\" alt=\"\" width=\"206\" height=\"59\" \/><\/a> \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 <a href=\"https:\/\/osoyoo.info\/index.php\/2020\/10\/20\/arduino-basic-lesson-27-ir-remote-control-robot-car\/\"><img loading=\"lazy\" class=\"alignright\" src=\"https:\/\/osoyoo.com\/picture\/Arduino_Graphical_Programming_Kit\/Next.png\" alt=\"\" width=\"206\" height=\"59\" \/><\/a><\/p>\n<div align=\"center\"><img loading=\"lazy\" class=\"aligncenter size-full\" src=\"https:\/\/osoyoo.com\/picture\/Arduino_Graphical_Programming_Kit\/Authorized_Online_Retailers.png\" width=\"1150\" height=\"56\" \/><\/div>\n<div align=\"center\"><\/div>\n<div align=\"center\">\n<table border=\"1\" cellspacing=\"0\" cellpadding=\"2\">\n<tbody>\n<tr>\n<td>Buy from US<\/td>\n<td>Buy from UK<\/td>\n<td>Buy from DE<\/td>\n<td>Buy from IT<\/td>\n<td>Buy from FR<\/td>\n<td>Buy from ES<\/td>\n<td>Buy from JP<\/td>\n<\/tr>\n<tr>\n<td><a href=\"https:\/\/www.amazon.com\/OSOYOO-Programming-Controlled-Mechanical-Educational\/dp\/B08163QYLB\/ref=as_li_ss_tl?keywords=arduino+kit&amp;qid=1577086035&amp;sr=8-10&amp;&amp;linkCode=ll1&amp;tag=osoyoo-20&amp;linkId=03d3fc4c0ddacde6e72868e74f51df64&amp;language=en_US\"><img loading=\"lazy\" class=\"alignnone size-large\" src=\"https:\/\/osoyoo.com\/picture\/icon\/us_buy_now.png\" width=\"150\" height=\"30\" \/><\/a><\/td>\n<td><a href=\"https:\/\/www.amazon.co.uk\/dp\/B08163QYLB\/ref=as_li_ss_tl?ref_=nav_signin&amp;&amp;linkCode=ll1&amp;tag=osoyoo-21&amp;linkId=100d3e2260cacec7910ba471d1a14e4a&amp;language=en_GB\"><img loading=\"lazy\" class=\"alignnone size-large\" src=\"https:\/\/osoyoo.com\/picture\/icon\/uk_buy_now.png\" width=\"150\" height=\"30\" \/><\/a><\/td>\n<td><a href=\"https:\/\/www.amazon.de\/dp\/B08163QYLB\/ref=as_li_ss_tl?ref=myi_title_dp&amp;linkCode=ll1&amp;tag=osoyoo05-21&amp;linkId=b5b682a9eb223e4fb00c18bfa0604e05&amp;language=de_DE\"><img loading=\"lazy\" class=\"alignnone size-large\" src=\"https:\/\/osoyoo.com\/picture\/icon\/de_buy_now.png\" width=\"150\" height=\"30\" \/><\/a><\/td>\n<td><a href=\"https:\/\/www.amazon.it\/dp\/B08163QYLB\/ref=as_li_ss_tl?ref=myi_title_dp&amp;linkCode=ll1&amp;tag=osoyoo01-21&amp;linkId=7e28023235665dc16687428f095136d7&amp;language=it_IT\"><img loading=\"lazy\" class=\"alignnone size-large\" src=\"https:\/\/osoyoo.com\/picture\/icon\/it_buy_now.png\" width=\"150\" height=\"30\" \/><\/a><\/td>\n<td><a href=\"https:\/\/www.amazon.fr\/dp\/B08163QYLB\/ref=as_li_ss_tl?ref=myi_title_dp&amp;ref_=nav_ya_signin&amp;_encoding=UTF8&amp;&amp;linkCode=ll1&amp;tag=osoyoo0b-21&amp;linkId=b64d046d9d9dcfd1a21d58d068b88062&amp;language=fr_FR\"><img loading=\"lazy\" class=\"alignnone size-large\" src=\"https:\/\/osoyoo.com\/picture\/icon\/fr_buy_now.png\" width=\"150\" height=\"30\" \/><\/a><\/td>\n<td><a href=\"https:\/\/www.amazon.es\/dp\/B08163QYLB\/ref=as_li_ss_tl?ref=nav_signin&amp;ref_=nav_ya_signin&amp;_encoding=UTF8&amp;&amp;&amp;linkCode=ll1&amp;tag=osoyoo04-21&amp;linkId=f06db7c77f513ff8707cead3b285b17e&amp;language=es_ES\"><img loading=\"lazy\" class=\"alignnone size-large\" src=\"https:\/\/osoyoo.com\/picture\/icon\/es_buy_now.png\" width=\"150\" height=\"30\" \/><\/a><\/td>\n<td><a href=\"https:\/\/www.amazon.co.jp\/dp\/B08168W3D5?ref=myi_title_dp\"><img loading=\"lazy\" class=\"alignnone size-large\" src=\"https:\/\/osoyoo.com\/picture\/icon\/jp_buy_now.png\" width=\"150\" height=\"30\" \/><\/a><\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<h1><img class=\"aligncenter\" src=\"https:\/\/osoyoo.com\/picture\/Arduino_Graphical_Programming_Kit\/objective.png\" \/><\/h1>\n<p><a href=\"https:\/\/osoyoo.com\/?p=27153\">The OSOYOO Magic I\/O Shield for Arduino<\/a> is a powerful board for the beginners. With this Magic board, we can\u00a0 easily connect various sensors and actuators much easier than before. In addition, this extension board has a build-in motor driver chip which allows us to control movements of two pairs of electric motors.<\/p>\n<p>In this lesson, we will show how to assemble a simple robot car and use Mixly to program its movement.<\/p>\n<h1><img class=\"aligncenter\" src=\"https:\/\/osoyoo.com\/picture\/Arduino_Graphical_Programming_Kit\/Parts-&amp;-Devices-min.png\" \/><\/h1>\n<ul>\n<li>OSOYOO Magic I\/O Shield for Arduino<\/li>\n<li>OSOYOO UNO Board<\/li>\n<li>Wheels<\/li>\n<li>Acrylic Chassis<\/li>\n<li>Motor Box<\/li>\n<li>OSOYOO 3-Pin PNP Cable<\/li>\n<li>OSOYOO 4-Pin PNP Cable<\/li>\n<li>USB Cable<\/li>\n<li>PC<\/li>\n<\/ul>\n<p><strong>Notice:<\/strong><\/p>\n<p>Not much is needed for this lesson, Make sure you have a good quality syncing cable,do not pick a \u2018charge only\u2019 USB cable.<\/p>\n<h1><img class=\"aligncenter\" src=\"https:\/\/osoyoo.com\/picture\/Arduino_Graphical_Programming_Kit\/how_to_make.png\" \/><\/h1>\n<p>1. Remove the protective film from the chassis, then install the motor under the chassis with M3 screws,nuts and rubber rings as follow: (Please install the rubber rings on the chassis)<\/p>\n<p><img loading=\"lazy\" class=\"size-full aligncenter\" src=\"https:\/\/osoyoo.com\/picture\/Arduino_Graphical_Programming_Kit\/lesson21\/4.png\" width=\"1010\" height=\"614\" \/><\/p>\n<p>2. Install the universal wheel with the M3 screws, copper pillars and rubber rings:<\/p>\n<p><img loading=\"lazy\" class=\"size-full aligncenter\" src=\"https:\/\/osoyoo.com\/picture\/Arduino_Graphical_Programming_Kit\/lesson21\/5.png\" width=\"1010\" height=\"614\" \/><\/p>\n<p>3. Install the universal wheel under the chassis with the M3 screws:<\/p>\n<p><img loading=\"lazy\" class=\"size-full aligncenter\" src=\"https:\/\/osoyoo.com\/picture\/Arduino_Graphical_Programming_Kit\/lesson21\/6.png\" width=\"1010\" height=\"614\" \/><\/p>\n<p>4. Install the OSOYOO UNO Board with M3 plastic screws and pillars:<\/p>\n<p><img loading=\"lazy\" class=\"size-full aligncenter\" src=\"https:\/\/osoyoo.com\/picture\/Arduino_Graphical_Programming_Kit\/lesson21\/7.png\" width=\"1010\" height=\"400\" \/><\/p>\n<p>5. Install OSOYOO UNO Board on the chassis with M3 plastic screws:<\/p>\n<p><img loading=\"lazy\" class=\"size-full aligncenter\" src=\"https:\/\/osoyoo.com\/picture\/Arduino_Graphical_Programming_Kit\/lesson21\/8.png\" width=\"1010\" height=\"614\" \/><\/p>\n<p>6. Plug OSOYOO Magic I\/O Shield v1.1 into OSOYOO UNO Board as the picture show:<\/p>\n<p><img loading=\"lazy\" class=\"size-full aligncenter\" src=\"https:\/\/osoyoo.com\/picture\/Arduino_Graphical_Programming_Kit\/lesson21\/9.png\" width=\"1010\" height=\"614\" \/><\/p>\n<p>7. Install the wheels:<\/p>\n<p><img loading=\"lazy\" class=\"size-full aligncenter\" src=\"https:\/\/osoyoo.com\/picture\/Arduino_Graphical_Programming_Kit\/lesson21\/10.png\" width=\"1010\" height=\"614\" \/><\/p>\n<p>8. Install the battery box on the chassis with M2 screws and nuts:<\/p>\n<p><img loading=\"lazy\" class=\"size-full aligncenter\" src=\"https:\/\/osoyoo.com\/picture\/Arduino_Graphical_Programming_Kit\/lesson21\/11.png\" width=\"1010\" height=\"614\" \/><\/p>\n<p>9. Connect the components:<\/p>\n<p><img loading=\"lazy\" class=\"size-full aligncenter\" src=\"https:\/\/osoyoo.com\/picture\/Arduino_Graphical_Programming_Kit\/lesson21\/12.png\" width=\"1010\" height=\"614\" \/><\/p>\n<p>Left Motor \u2013 L1<\/p>\n<p>Right Motor \u2013 R1<\/p>\n<p>IN1 &#8212;D12 \/\/K1\u3001K2 motor direction<br \/>\nIN2 &#8212;D11 \/\/K1\u3001K2 motor direction<br \/>\nIN3 &#8212;D9 \/\/K3\u3001K4 motor direction<br \/>\nIN4 &#8212;D10 \/\/K3\u3001K4 motor direction<br \/>\nENA &#8212;D5 \/\/ Needs to be a PWM pin to be able to control motor speed ENA<br \/>\nENB &#8212;D6 \/\/ Needs to be a PWM pin to be able to control motor speed ENB<\/p>\n<p><img loading=\"lazy\" class=\"size-full aligncenter\" src=\"https:\/\/osoyoo.com\/picture\/Arduino_Graphical_Programming_Kit\/lesson21\/base-motor.png\" width=\"1010\" height=\"614\" \/><\/p>\n<p><img loading=\"lazy\" class=\"size-full aligncenter\" src=\"https:\/\/osoyoo.com\/picture\/Arduino_Graphical_Programming_Kit\/lesson21\/base-car-connection.png\" width=\"1010\" height=\"614\" \/><\/p>\n<p><img loading=\"lazy\" class=\"size-full aligncenter\" src=\"https:\/\/osoyoo.com\/picture\/Arduino_Graphical_Programming_Kit\/lesson21\/base-car-ena-enb.png\" width=\"1010\" height=\"614\" \/><\/p>\n<p><img loading=\"lazy\" class=\"size-full aligncenter\" src=\"https:\/\/osoyoo.com\/picture\/Arduino_Graphical_Programming_Kit\/lesson21\/battery-base.png\" width=\"1010\" height=\"614\" \/><\/p>\n<h1><img class=\"aligncenter\" src=\"https:\/\/osoyoo.com\/picture\/Arduino_Graphical_Programming_Kit\/how_to_code.png\" \/><\/h1>\n<h4><span style=\"color: #ff0000;\"><strong>Notice: Shut off your battery or Unplug your power adapter when upload sketch code to Arduino.<\/strong><\/span><\/h4>\n<p>After above operations are completed, connect the Arduino board to your computer using the USB cable. The green power LED (labelled\u00a0<strong>PWR<\/strong>) should go on.<\/p>\n<p><a href=\"https:\/\/osoyoo.info\/upload\/lesson26.zip\">Click to download the code<\/a><\/p>\n<p>&nbsp;<\/p>\n<h1><img class=\"aligncenter\" src=\"https:\/\/osoyoo.com\/picture\/Arduino_Graphical_Programming_Kit\/how_to_play.png\" alt=\"how_to_play.png (1150\u00c3\u0083\u00c2\u0083\u00c3\u0082\u00c2\u0083\u00c3\u0083\u00c2\u0082\u00c3\u0082\u00c2\u0083\u00c3\u0083\u00c2\u0083\u00c3\u0082\u00c2\u0082\u00c3\u0083\u00c2\u0082\u00c3\u0082\u00c2\u009756)\" \/><\/h1>\n<p>Disconnect Arduino from PC, put a 9V battery into battery pox<strong>(make sure polar direction is correct, otherwise it can destroy your device and cause fire hazard).<\/strong><\/p>\n<p><img loading=\"lazy\" class=\"size-full aligncenter\" src=\"https:\/\/osoyoo.com\/picture\/Arduino_Graphical_Programming_Kit\/lesson21\/13.png\" width=\"1010\" height=\"614\" \/><\/p>\n<p>Put the car on the ground, press the Motor Power switch on the OSOYOO Magic I\/O Shield for Arduino, the car should go forward 2 seconds, then go backward 2\u00a0\u00a0seconds, then right turn for 2 seconds, then left turn for 2 seconds, then stop.<\/p>\n<p><img loading=\"lazy\" class=\"size-full aligncenter\" src=\"https:\/\/osoyoo.com\/picture\/Arduino_Graphical_Programming_Kit\/lesson21\/switch.png\" width=\"1010\" height=\"614\" \/><\/p>\n<div align=\"center\"><iframe src=\"https:\/\/www.youtube.com\/embed\/6nuv84R_CIA\" width=\"560\" height=\"315\" frameborder=\"0\" allowfullscreen=\"allowfullscreen\"><\/iframe><\/div>\n<p>If the car does not move as per above mentioned result, you should check your wire connection, battery voltage(must over 7.2v).<\/p>\n<p><a href=\"https:\/\/osoyoo.info\/index.php\/2020\/10\/18\/253\/\"><img loading=\"lazy\" class=\"alignnone\" src=\"https:\/\/osoyoo.com\/picture\/Arduino_Graphical_Programming_Kit\/Previous.png\" alt=\"\" width=\"206\" height=\"59\" \/><\/a> \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 <a href=\"https:\/\/osoyoo.info\/index.php\/2020\/10\/11\/arduino-basic-tutorial-directory\/\"><img loading=\"lazy\" class=\"alignnone\" src=\"https:\/\/osoyoo.com\/picture\/Arduino_Graphical_Programming_Kit\/Tutorial.png\" alt=\"\" width=\"206\" height=\"59\" \/><\/a> \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 <a href=\"https:\/\/osoyoo.info\/index.php\/2020\/10\/20\/arduino-basic-lesson-27-ir-remote-control-robot-car\/\"><img loading=\"lazy\" class=\"alignright\" src=\"https:\/\/osoyoo.com\/picture\/Arduino_Graphical_Programming_Kit\/Next.png\" alt=\"\" width=\"206\" height=\"59\" \/><\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 \u00a0 Buy from US Buy from UK Buy from DE Buy from IT Buy from FR Buy from ES Buy from JP The OSOYOO Magic I\/O Shield for [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":275,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[2],"tags":[],"_links":{"self":[{"href":"https:\/\/osoyoo.info\/index.php\/wp-json\/wp\/v2\/posts\/264"}],"collection":[{"href":"https:\/\/osoyoo.info\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/osoyoo.info\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/osoyoo.info\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/osoyoo.info\/index.php\/wp-json\/wp\/v2\/comments?post=264"}],"version-history":[{"count":7,"href":"https:\/\/osoyoo.info\/index.php\/wp-json\/wp\/v2\/posts\/264\/revisions"}],"predecessor-version":[{"id":303,"href":"https:\/\/osoyoo.info\/index.php\/wp-json\/wp\/v2\/posts\/264\/revisions\/303"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/osoyoo.info\/index.php\/wp-json\/wp\/v2\/media\/275"}],"wp:attachment":[{"href":"https:\/\/osoyoo.info\/index.php\/wp-json\/wp\/v2\/media?parent=264"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/osoyoo.info\/index.php\/wp-json\/wp\/v2\/categories?post=264"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/osoyoo.info\/index.php\/wp-json\/wp\/v2\/tags?post=264"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}