{"id":4588,"date":"2017-01-26T16:22:42","date_gmt":"2017-01-26T16:22:42","guid":{"rendered":"http:\/\/hetpro-store.com\/TUTORIALES\/?p=4588"},"modified":"2017-03-09T17:12:15","modified_gmt":"2017-03-09T17:12:15","slug":"visual-basic-servo","status":"publish","type":"post","link":"https:\/\/hetpro-store.com\/TUTORIALES\/visual-basic-servo\/","title":{"rendered":"Visual basic y control de servo"},"content":{"rendered":"<h2 style=\"text-align: justify;\">Visual Basic<\/h2>\n<p style=\"text-align: justify;\">Control Servo Arduino con Visual Basic<br \/>\nCaracter\u00edsticas del motor y modelo<\/p>\n<p style=\"text-align: justify;\"><a href=\"http:\/\/hetpro-store.com\/TUTORIALES\/wp-content\/uploads\/2017\/01\/motor.png\" target=\"_blank\" rel=\"attachment wp-att-4589\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-4589 size-full\" src=\"http:\/\/hetpro-store.com\/TUTORIALES\/wp-content\/uploads\/2017\/01\/motor.png\" alt=\"Visual\" width=\"216\" height=\"159\" \/><\/a><\/p>\n<p style=\"text-align: justify;\">\u2022 Voltaje de operaci\u00f3n : 4.8 a 6.0V<br \/>\n\u2022 Corriente de operaci\u00f3n : 100mA<br \/>\n\u2022 Velocidad de operaci\u00f3n : 0.12seg\/60 (4.8V)<br \/>\n\u2022 Torque : 0.7kg\/cm (4.8V)~0.8kg\/cm (6.0V)<\/p>\n<p style=\"text-align: justify;\">Usaremos un Servomotor en cual consistir\u00e1 en el control de por medio de visual studio con un scroll bar y se ira moviendo seg\u00fan los grados que le mandes.<\/p>\n<h3 style=\"text-align: justify;\">Funcionamiento de un servo<\/h3>\n<p style=\"text-align: justify;\">Se posicionan de forma inmediata en cualquier posici\u00f3n dentro de su intervalo de operaci\u00f3n estos igual se controlan tanto en velocidad como movimiento. En este caso se tiene una interfaz que se podr\u00eda utilizar como si se necesita algo visual en alg\u00fan proyecto elaborado para el control de un servo y buena presentaci\u00f3n. Aplicaciones son muchas para este tipo de motor como en robotica ya que es muy eficiente y es preciso el movimiento y se mantiene en una posici\u00f3n que desees dentro del rango de trabajo.<\/p>\n<h3 style=\"text-align: justify;\">Materiales<\/h3>\n<h3 style=\"text-align: justify;\"><a href=\"https:\/\/hetpro-store.com\/arduino-uno-r3-original\/\" target=\"_blank\">Arduino uno<\/a><br \/>\n<a href=\"https:\/\/hetpro-store.com\/servomotor-towerpro-sg90\/\" target=\"_blank\">Servomotor<\/a><br \/>\nDiagrama de conexi\u00f3n del motor<\/h3>\n<p style=\"text-align: justify;\"><a href=\"http:\/\/hetpro-store.com\/TUTORIALES\/wp-content\/uploads\/2017\/01\/ardu-mot.png\" target=\"_blank\" rel=\"attachment wp-att-4590\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-4590 size-full\" src=\"http:\/\/hetpro-store.com\/TUTORIALES\/wp-content\/uploads\/2017\/01\/ardu-mot.png\" alt=\"Visual\" width=\"473\" height=\"243\" srcset=\"https:\/\/hetpro-store.com\/TUTORIALES\/wp-content\/uploads\/2017\/01\/ardu-mot.png 473w, https:\/\/hetpro-store.com\/TUTORIALES\/wp-content\/uploads\/2017\/01\/ardu-mot-300x154.png 300w\" sizes=\"auto, (max-width: 473px) 100vw, 473px\" \/><\/a><\/p>\n<p style=\"text-align: center;\">Como conectar un servomotor con arduino<\/p>\n<h3 style=\"text-align: justify;\">Librer\u00eda en arduino<\/h3>\n<p style=\"text-align: justify;\">Para agregarla vamos a la opci\u00f3n Programa y buscamos Incluir Librer\u00edas y de la barra que te despliega bajamos hasta ver la que dice servo damos click y te la agregara a tu c\u00f3digo<\/p>\n<p style=\"text-align: justify;\"><a href=\"http:\/\/hetpro-store.com\/TUTORIALES\/wp-content\/uploads\/2017\/01\/ardu2.png\" target=\"_blank\" rel=\"attachment wp-att-4592\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-4592 \" src=\"http:\/\/hetpro-store.com\/TUTORIALES\/wp-content\/uploads\/2017\/01\/ardu2.png\" alt=\"Visual\" width=\"509\" height=\"279\" srcset=\"https:\/\/hetpro-store.com\/TUTORIALES\/wp-content\/uploads\/2017\/01\/ardu2.png 438w, https:\/\/hetpro-store.com\/TUTORIALES\/wp-content\/uploads\/2017\/01\/ardu2-300x164.png 300w\" sizes=\"auto, (max-width: 509px) 100vw, 509px\" \/><\/a><\/p>\n<p style=\"text-align: justify;\"><a href=\"http:\/\/hetpro-store.com\/TUTORIALES\/wp-content\/uploads\/2017\/01\/ardu3.png\" target=\"_blank\" rel=\"attachment wp-att-4593\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-4593 \" src=\"http:\/\/hetpro-store.com\/TUTORIALES\/wp-content\/uploads\/2017\/01\/ardu3.png\" alt=\"Visual\" width=\"501\" height=\"360\" srcset=\"https:\/\/hetpro-store.com\/TUTORIALES\/wp-content\/uploads\/2017\/01\/ardu3.png 667w, https:\/\/hetpro-store.com\/TUTORIALES\/wp-content\/uploads\/2017\/01\/ardu3-300x216.png 300w\" sizes=\"auto, (max-width: 501px) 100vw, 501px\" \/><\/a><\/p>\n<p style=\"text-align: center;\">Como agregar una librer\u00eda en arduino esta es especial para el servo<\/p>\n<p style=\"text-align: justify;\">Ya una vez que te la agrego iniciamos a realizar nuestro c\u00f3digo<\/p>\n<p style=\"text-align: justify;\"><a href=\"http:\/\/hetpro-store.com\/TUTORIALES\/wp-content\/uploads\/2017\/01\/ardu4.png\" target=\"_blank\" rel=\"attachment wp-att-4594\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-4594 \" src=\"http:\/\/hetpro-store.com\/TUTORIALES\/wp-content\/uploads\/2017\/01\/ardu4.png\" alt=\"Visual\" width=\"499\" height=\"228\" srcset=\"https:\/\/hetpro-store.com\/TUTORIALES\/wp-content\/uploads\/2017\/01\/ardu4.png 348w, https:\/\/hetpro-store.com\/TUTORIALES\/wp-content\/uploads\/2017\/01\/ardu4-300x137.png 300w\" sizes=\"auto, (max-width: 499px) 100vw, 499px\" \/><\/a><\/p>\n<h3 style=\"text-align: justify;\">Visual studio<\/h3>\n<p style=\"text-align: justify;\">En visual pondremos el dise\u00f1o para poder tener control de nuestro servo motor con el scroll bar. Lo que tambi\u00e9n veremos en el siguiente c\u00f3digo para que haga funcionar. En los botones de encender y apagar tendremos el c\u00f3digo para conectar con el serial Port en este caso sp1.<\/p>\n<p style=\"text-align: justify;\"><a href=\"http:\/\/hetpro-store.com\/TUTORIALES\/wp-content\/uploads\/2017\/01\/ardu5.png\" target=\"_blank\" rel=\"attachment wp-att-4595\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-4595 size-full\" src=\"http:\/\/hetpro-store.com\/TUTORIALES\/wp-content\/uploads\/2017\/01\/ardu5.png\" alt=\"Visual\" width=\"426\" height=\"345\" srcset=\"https:\/\/hetpro-store.com\/TUTORIALES\/wp-content\/uploads\/2017\/01\/ardu5.png 426w, https:\/\/hetpro-store.com\/TUTORIALES\/wp-content\/uploads\/2017\/01\/ardu5-300x243.png 300w\" sizes=\"auto, (max-width: 426px) 100vw, 426px\" \/><\/a><\/p>\n<p style=\"text-align: center;\">Dise\u00f1o con scroll Bar<\/p>\n<p style=\"text-align: justify;\">El c\u00f3digo necesario para iniciar y detener el puerto para la comunicaci\u00f3n es<\/p>\n<p style=\"text-align: justify;\"><a href=\"http:\/\/hetpro-store.com\/TUTORIALES\/wp-content\/uploads\/2017\/01\/ardu6.png\" target=\"_blank\" rel=\"attachment wp-att-4596\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-4596 size-full\" src=\"http:\/\/hetpro-store.com\/TUTORIALES\/wp-content\/uploads\/2017\/01\/ardu6.png\" alt=\"Visual\" width=\"504\" height=\"105\" \/><\/a><\/p>\n<p style=\"text-align: center;\">C\u00f3digo para botones<\/p>\n<p style=\"text-align: justify;\">Para que se mueva con el Scroll es necesario el siguiente c\u00f3digo y tambi\u00e9n tenemos un label para que te valla mostrando en qu\u00e9 grado va.<\/p>\n<p style=\"text-align: justify;\"><a href=\"http:\/\/hetpro-store.com\/TUTORIALES\/wp-content\/uploads\/2017\/01\/ardu7.png\" target=\"_blank\" rel=\"attachment wp-att-4597\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter wp-image-4597 size-full\" src=\"http:\/\/hetpro-store.com\/TUTORIALES\/wp-content\/uploads\/2017\/01\/ardu7.png\" alt=\"Visual\" width=\"504\" height=\"145\" \/><\/a><\/p>\n<p style=\"text-align: center;\">C\u00f3digo para el control del servo por medio del puerto<\/p>\n<h3 style=\"text-align: justify;\">C\u00f3digo completo visual<\/h3>\n<p>[code language=\u00bbcpp\u00bb]<br \/>\nPublic Class Form1<\/p>\n<p>    Private Sub btn1_Click(sender As Object, e As EventArgs) Handles btn1.Click<br \/>\n        sp1.Open()<br \/>\n    End Sub<\/p>\n<p>    Private Sub btn2_Click(sender As Object, e As EventArgs) Handles btn2.Click<br \/>\n        sp1.Close()<br \/>\n    End Sub<\/p>\n<p>    Private Sub hs1_Scroll(sender As Object, e As ScrollEventArgs) Handles hs1.Scroll<br \/>\n        If hs1.Value = 0 Then<br \/>\n            sp1.Write(&quot;0&quot;)<br \/>\n        ElseIf hs1.Value = 90 Then<br \/>\n            sp1.Write(&quot;1&quot;)<br \/>\n        ElseIf hs1.Value = 180 Then<br \/>\n            sp1.Write(&quot;2&quot;)<br \/>\n        End If<br \/>\n        lbl1.Text = hs1.Value<br \/>\n    End Sub<br \/>\nEnd Class<br \/>\n[\/code]<\/p>\n<h3 style=\"text-align: justify;\">C\u00f3digo arduino<\/h3>\n<p>[code language=\u00bbcpp\u00bb]<\/p>\n<p>#include &lt;Servo.h&gt;<\/p>\n<p>Servo servo1;<br \/>\nint angulo ;<br \/>\nint recibido ;<br \/>\nvoid setup()<br \/>\n{<\/p>\n<p>servo1.attach(9); \/\/Se conecta al pin 9<\/p>\n<p>Serial.begin(9600);<br \/>\n}<\/p>\n<p>void loop()<br \/>\n{<\/p>\n<p>if (Serial.available() &gt; 0) \/\/Es para leer el bit de entrada {<\/p>\n<p>recibido = Serial.read();<\/p>\n<p>switch (recibido)<br \/>\n{<\/p>\n<p>case &#8216;0&#8217;:angulo = 0; break;<br \/>\ncase &#8216;1&#8217;:angulo = 90;break;<br \/>\ncase &#8216;2&#8217;:angulo = 180;break;<br \/>\n}<br \/>\nservo1.write (angulo);<\/p>\n<p>}<\/p>\n<p>}<\/p>\n<p>[\/code]<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Visual Basic Control Servo Arduino con Visual Basic Caracter\u00edsticas del motor y modelo \u2022 Voltaje de operaci\u00f3n : 4.8 a 6.0V \u2022 Corriente de operaci\u00f3n : 100mA \u2022 Velocidad de operaci\u00f3n : 0.12seg\/60 (4.8V) \u2022 Torque : 0.7kg\/cm (4.8V)~0.8kg\/cm (6.0V) Usaremos un Servomotor en cual consistir\u00e1 en el control de por medio de visual studio [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":4652,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":"","_members_access_role":[],"_members_access_error":""},"categories":[14,15,19],"tags":[115,150,60],"class_list":["post-4588","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-arduino","category-comunicacion","category-motores","tag-arduino-uno","tag-comunicacion-visual-arduino","tag-servomotores"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v15.1.2 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Visual basic y control de servo - HeTPro-Tutoriales<\/title>\n<meta name=\"description\" content=\"Control de un servomotor con programacion en arduino y con ayuda de un Scroll bar en visual basics para el movimiento en grados del mismo....\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/hetpro-store.com\/TUTORIALES\/visual-basic-servo\/\" \/>\n<meta property=\"og:locale\" content=\"es_ES\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Visual basic y control de servo - HeTPro-Tutoriales\" \/>\n<meta property=\"og:description\" content=\"Control de un servomotor con programacion en arduino y con ayuda de un Scroll bar en visual basics para el movimiento en grados del mismo....\" \/>\n<meta property=\"og:url\" content=\"https:\/\/hetpro-store.com\/TUTORIALES\/visual-basic-servo\/\" \/>\n<meta property=\"og:site_name\" content=\"HeTPro-Tutoriales\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/HeTPro-142107212482616\/\" \/>\n<meta property=\"article:published_time\" content=\"2017-01-26T16:22:42+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2017-03-09T17:12:15+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/hetpro-store.com\/TUTORIALES\/wp-content\/uploads\/2017\/01\/motor-2.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"200\" \/>\n\t<meta property=\"og:image:height\" content=\"201\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@hetpro1\" \/>\n<meta name=\"twitter:site\" content=\"@hetpro1\" \/>\n<!-- \/ Yoast SEO Premium plugin. -->","amp_enabled":true,"_links":{"self":[{"href":"https:\/\/hetpro-store.com\/TUTORIALES\/wp-json\/wp\/v2\/posts\/4588","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hetpro-store.com\/TUTORIALES\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/hetpro-store.com\/TUTORIALES\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/hetpro-store.com\/TUTORIALES\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/hetpro-store.com\/TUTORIALES\/wp-json\/wp\/v2\/comments?post=4588"}],"version-history":[{"count":0,"href":"https:\/\/hetpro-store.com\/TUTORIALES\/wp-json\/wp\/v2\/posts\/4588\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/hetpro-store.com\/TUTORIALES\/wp-json\/wp\/v2\/media\/4652"}],"wp:attachment":[{"href":"https:\/\/hetpro-store.com\/TUTORIALES\/wp-json\/wp\/v2\/media?parent=4588"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/hetpro-store.com\/TUTORIALES\/wp-json\/wp\/v2\/categories?post=4588"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/hetpro-store.com\/TUTORIALES\/wp-json\/wp\/v2\/tags?post=4588"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}