{"id":421,"date":"2019-10-11T14:24:00","date_gmt":"2019-10-11T12:24:00","guid":{"rendered":"https:\/\/blogsaverroes.juntadeandalucia.es\/robotimaticas\/siguelineas-con-mblock-2-0\/"},"modified":"2020-06-21T14:09:27","modified_gmt":"2020-06-21T12:09:27","slug":"siguelineas-con-mblock-2-0","status":"publish","type":"post","link":"https:\/\/blogsaverroes.juntadeandalucia.es\/robotimaticas\/siguelineas-con-mblock-2-0\/","title":{"rendered":"Siguel\u00edneas con mBlock 2.0."},"content":{"rendered":"<p style=\"text-align: left\">Veamos un programa sencillo para que nuestro robot siga una l\u00ednea negra.<\/p>\n<p>El c\u00f3digo&nbsp; adjunto ser\u00eda para la placa \u00bb Motor Driver Controlador 2 motores HG7881&#8243; , que ser\u00eda la que tiene este robot<\/p>\n<div style=\"clear: both;text-align: center\"><a style=\"margin-left: 1em;margin-right: 1em\" href=\"https:\/\/1.bp.blogspot.com\/-q47j-Iz_QFg\/XZovjrd6buI\/AAAAAAAAAhE\/3IQufFvJrsUKsgdLQqysfoN9xjbpvXi_QCLcBGAsYHQ\/s1600\/EL0463%2BMOTOR%2BDRIVER%2BControlador%2B2%2Bmotores%2BHG7881.jpg\"><img decoding=\"async\" src=\"https:\/\/1.bp.blogspot.com\/-q47j-Iz_QFg\/XZovjrd6buI\/AAAAAAAAAhE\/3IQufFvJrsUKsgdLQqysfoN9xjbpvXi_QCLcBGAsYHQ\/s1600\/EL0463%2BMOTOR%2BDRIVER%2BControlador%2B2%2Bmotores%2BHG7881.jpg\" border=\"0\" data-original-height=\"159\" data-original-width=\"318\"><\/a><\/div>\n<h1 style=\"background-color: white;line-height: 21.6px;margin: 0px\">&nbsp;<\/h1>\n<div>Las conexiones para los motores A y B, se hacen con pines PWM . En el c\u00f3digo que os adjunto ten\u00e9is que saber&nbsp;<\/div>\n<div>\n<div>\n<div style=\"text-align: left\">&nbsp; &nbsp; B &#8211; IA &#8211; Avance del motor B&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8212;&nbsp; &nbsp;Pin PWM &#8211; 10<br \/>\n&nbsp; &nbsp; B &#8211; IB &#8211; Retroceso del motor B&nbsp; &nbsp; &nbsp; &#8212;&nbsp; &nbsp;Pin PWM &#8211; 9<\/div>\n<\/div>\n<div>\n<div style=\"text-align: left\">&nbsp; &nbsp; A &#8211; IA &#8211; Avance del motor A&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &#8212;&nbsp; &nbsp;Pin PWM &#8211; 6<\/div>\n<\/div>\n<div style=\"text-align: left\">&nbsp; &nbsp; A &#8211; IB &#8211; Retroceso del motor A&nbsp; &nbsp; &nbsp; &#8212;&nbsp; Pin PWM &#8211; 5<\/div>\n<\/div>\n<p>&nbsp;<\/p>\n<div style=\"text-align: center\">C\u00d3DIGO para mBlock basado en Scratch 2.0.<\/div>\n<p>&nbsp;<\/p>\n<div style=\"clear: both;text-align: center\"><a style=\"margin-left: 1em;margin-right: 1em\" href=\"https:\/\/1.bp.blogspot.com\/-FfjdPQQXNak\/XZoz1wuw49I\/AAAAAAAAAhQ\/w8IGgmuljFEqc6d-GttGgyAn5m0eZSsCACLcBGAsYHQ\/s1600\/Codigo_Siguelineas_1.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/1.bp.blogspot.com\/-FfjdPQQXNak\/XZoz1wuw49I\/AAAAAAAAAhQ\/w8IGgmuljFEqc6d-GttGgyAn5m0eZSsCACLcBGAsYHQ\/s640\/Codigo_Siguelineas_1.png\" width=\"640\" height=\"505\" border=\"0\" data-original-height=\"542\" data-original-width=\"685\"><\/a><\/div>\n<p>He creado los siguientes bloques, con el objeto de que este coche los puedan programar los alumnos de primaria y secundaria, sin problemas. Estos son los bloques y variables creados<\/p>\n<div style=\"clear: both;text-align: center\"><a style=\"margin-left: 1em;margin-right: 1em\" href=\"https:\/\/1.bp.blogspot.com\/-ZU8VaB9jk8c\/XZo0zEy1abI\/AAAAAAAAAhc\/I-NktR8PlTU5uAjxIATtjpOBEAWU8vR5ACLcBGAsYHQ\/s1600\/Codigo_Siguelineas_2.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/1.bp.blogspot.com\/-ZU8VaB9jk8c\/XZo0zEy1abI\/AAAAAAAAAhc\/I-NktR8PlTU5uAjxIATtjpOBEAWU8vR5ACLcBGAsYHQ\/s640\/Codigo_Siguelineas_2.png\" width=\"298\" height=\"640\" border=\"0\" data-original-height=\"604\" data-original-width=\"282\"><\/a><\/div>\n<p>Y el c\u00f3digo de los bloques es el siguiente<\/p>\n<div style=\"clear: both;text-align: center\"><a style=\"margin-left: 1em;margin-right: 1em\" href=\"https:\/\/1.bp.blogspot.com\/-paMPGOQURps\/XZo1hw5iT4I\/AAAAAAAAAhk\/mSifwjkfFyAdLZ2_-ZamLlvD0lWqTewrQCLcBGAsYHQ\/s1600\/Codigo_Siguelineas_3.png\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/1.bp.blogspot.com\/-paMPGOQURps\/XZo1hw5iT4I\/AAAAAAAAAhk\/mSifwjkfFyAdLZ2_-ZamLlvD0lWqTewrQCLcBGAsYHQ\/s640\/Codigo_Siguelineas_3.png\" width=\"640\" height=\"536\" border=\"0\" data-original-height=\"594\" data-original-width=\"708\"><\/a><\/div>\n<p>&nbsp; &nbsp; Y este es el resultado en nuestro coche, voy a usar los Perecitos que se han creado en nuestro centro.<\/p>\n<div style=\"clear: both;text-align: center\"><object width=\"420\" height=\"366\"><\/object><\/div>\n<p><b>Otros proyectos:<\/b><\/p>\n<p><i><a href=\"https:\/\/robotimaticas2019.blogspot.com\/2019\/10\/evita-obstaculos-con-mblock-20.html\" target=\"_blank\" rel=\"noopener noreferrer\">Evita Obst\u00e1culos con mBlock 2.0.<\/a><\/i><br \/>\n<i><a href=\"https:\/\/robotimaticas2019.blogspot.com\/2019\/11\/control-del-robotcar-con-la-realidad.html\" target=\"_blank\" rel=\"noopener noreferrer\">Control del RobotCar con Realidad Aumentada usando mBlock 2.0.<\/a><\/i><br \/>\n<i>Control del RobotCar con un mando a distancia usando mBlock 2.0.<\/i><br \/>\n<i><a href=\"https:\/\/robotimaticas2019.blogspot.com\/2019\/12\/proyecto-distintas-formas-de-mover-un.html\" target=\"_blank\" rel=\"noopener noreferrer\">Proyecto &#8211; Distintas formas de controlar un RobotCar<\/a><\/i><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Veamos un programa sencillo para que nuestro robot siga una l\u00ednea negra. El c\u00f3digo&nbsp; adjunto ser\u00eda para la placa \u00bb Motor Driver Controlador 2 motores HG7881&#8243; , que ser\u00eda la que tiene este robot &nbsp; Las conexiones para los motores A y B, se hacen con pines PWM . En el c\u00f3digo que os adjunto &hellip; <\/p>\n<p class=\"link-more\"><a href=\"https:\/\/blogsaverroes.juntadeandalucia.es\/robotimaticas\/siguelineas-con-mblock-2-0\/\" class=\"more-link\">Continuar leyendo<span class=\"screen-reader-text\"> \u00abSiguel\u00edneas con mBlock 2.0.\u00bb<\/span><\/a><\/p>\n","protected":false},"author":8446,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"video","meta":{"ngg_post_thumbnail":0,"footnotes":""},"categories":[2324095,2324092],"tags":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/blogsaverroes.juntadeandalucia.es\/robotimaticas\/wp-json\/wp\/v2\/posts\/421"}],"collection":[{"href":"https:\/\/blogsaverroes.juntadeandalucia.es\/robotimaticas\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogsaverroes.juntadeandalucia.es\/robotimaticas\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogsaverroes.juntadeandalucia.es\/robotimaticas\/wp-json\/wp\/v2\/users\/8446"}],"replies":[{"embeddable":true,"href":"https:\/\/blogsaverroes.juntadeandalucia.es\/robotimaticas\/wp-json\/wp\/v2\/comments?post=421"}],"version-history":[{"count":2,"href":"https:\/\/blogsaverroes.juntadeandalucia.es\/robotimaticas\/wp-json\/wp\/v2\/posts\/421\/revisions"}],"predecessor-version":[{"id":501,"href":"https:\/\/blogsaverroes.juntadeandalucia.es\/robotimaticas\/wp-json\/wp\/v2\/posts\/421\/revisions\/501"}],"wp:attachment":[{"href":"https:\/\/blogsaverroes.juntadeandalucia.es\/robotimaticas\/wp-json\/wp\/v2\/media?parent=421"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogsaverroes.juntadeandalucia.es\/robotimaticas\/wp-json\/wp\/v2\/categories?post=421"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogsaverroes.juntadeandalucia.es\/robotimaticas\/wp-json\/wp\/v2\/tags?post=421"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}