<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-1468652985727080356</id><updated>2026-04-30T11:28:28.271-07:00</updated><category term="Como progrmar en java"/><category term="arduino"/><category term="Arduini y java"/><category term="Arduino y java"/><category term="LM35 arduino y java"/><category term="LM35 y arduino"/><category term="java puerto Serie"/><category term="java y arduino"/><category term="metodos java"/><category term="puerto serie"/><category term="puerto serie en java"/><category term="puerto serie java"/><category term="tutorial arduino y java"/><title type='text'>Java al maximo</title><subtitle type='html'>Aprendamos más del gran lenguaje java, manejo de puertos, mysql, librerias especiales todo lo que necesitemos saber de java aqui lo encontraras!&#xa;Muestra tus proyectos muestra de que eres capaz con java.</subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://javaallimite.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1468652985727080356/posts/default?redirect=false'/><link rel='alternate' type='text/html' href='http://javaallimite.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><author><name>victor</name><uri>http://www.blogger.com/profile/14807786148874785693</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>3</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-1468652985727080356.post-3976287660652984503</id><published>2011-12-22T19:48:00.000-08:00</published><updated>2011-12-22T21:26:17.817-08:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="arduino"/><category scheme="http://www.blogger.com/atom/ns#" term="Como progrmar en java"/><category scheme="http://www.blogger.com/atom/ns#" term="java puerto Serie"/><category scheme="http://www.blogger.com/atom/ns#" term="LM35 arduino y java"/><category scheme="http://www.blogger.com/atom/ns#" term="LM35 y arduino"/><category scheme="http://www.blogger.com/atom/ns#" term="puerto serie"/><title type='text'>Sensor de temperatura con arduino y java</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #990000; font-size: x-large;&quot;&gt;Sensor de temperatura LM35 y java&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: center;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #990000; font-size: x-large;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Saludos nuevamente de mi parte.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Estamos a qui para un nuevo tutorial, esta vez de nuevo con arduino y java, pero en esta&amp;nbsp;ocasión&amp;nbsp;utilizando un sensor de temperatura (LM35).&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;***************************************************************************&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;para llevar&amp;nbsp;acabo&amp;nbsp;este tutorial se da por hecho que &amp;nbsp;ha visto el post anterior ya que la manera en que arduino se comunicara con java es la misma por lo tantos los pasos a seguir son los mismo. no ser asi&amp;nbsp;por favor&amp;nbsp;miviste el &amp;nbsp; ----&amp;gt;&amp;nbsp;&lt;a href=&quot;http://www.javaallimite.blogspot.com/2011/04/primer-tutorial-arduino-desde-java.html&quot; target=&quot;_blank&quot;&gt;post&lt;/a&gt;&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;***************************************************************************&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Un LM35 es un dispositivo&amp;nbsp;electrónico&amp;nbsp;capas de poder medir la temperatura, consta de tres bases o patas, cada una con su propio&amp;nbsp;propósito&amp;nbsp;uno para gnd o tierra, otro para vin o&amp;nbsp;voltaje&amp;nbsp;de entrada y por ultimo vout o voltaje de salida.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;El LM35 funciona de la siguiente manera.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;1°c = 10mlv &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; lo que es igual a un grado centigrado es igual a 10 mili volts&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;por lo que si en &amp;nbsp;temperatura ambiente tenemos 32°c&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;el LM35&amp;nbsp;tendría&amp;nbsp;en su base de salida &amp;nbsp;320 mlv;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;La forma en que se conecta a arduino y la&amp;nbsp;función&amp;nbsp;de cada una de sus bases es la&amp;nbsp;siguiente:&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: right;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmmJTZnDb0i8hIPsqhI4SgtsriqQM8q1taCZr8aJj233wvAnK_Av4L1ojQoDSvApcqNC3ODTeXIvbWmuvTxLIkzqj-hy6s052P7FORmjmlQzVCK4R0u9xlC0GI40Rz8OPjCTGhfWgLRlU/s1600/Arduino_lm35_board_setup.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmmJTZnDb0i8hIPsqhI4SgtsriqQM8q1taCZr8aJj233wvAnK_Av4L1ojQoDSvApcqNC3ODTeXIvbWmuvTxLIkzqj-hy6s052P7FORmjmlQzVCK4R0u9xlC0GI40Rz8OPjCTGhfWgLRlU/s1600/Arduino_lm35_board_setup.jpg&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Con esta&amp;nbsp;unión&amp;nbsp;se pueden dar mil usos, desde&amp;nbsp;mecánicos,&amp;nbsp;electrónicos y por que no hasta&amp;nbsp;médicos&amp;nbsp; como fue en mi caso, &lt;a href=&quot;http://www.electrocardiotacometro.blogspot.com/&quot; target=&quot;_blank&quot;&gt;ver otro de mis blogs donde use este cirucitor para fines medicos&lt;/a&gt;.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;paso 1.-&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;preparar java para la&amp;nbsp;conexión&amp;nbsp;con arduino llamando&amp;nbsp;librerías&amp;nbsp;y ajustando directorios de archivos. (visto en el post&amp;nbsp;anterior&amp;nbsp;mismos pasos) &lt;a href=&quot;http://www.javaallimite.blogspot.com/2011/04/primer-tutorial-arduino-desde-java.html&quot; target=&quot;_blank&quot;&gt;ir al post anterios&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;paso 2.-&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;preparar la&amp;nbsp;interfaz&amp;nbsp;en java encargada de recibir los datos que arduino le ara llegar, para este tutorial yo he preparado un&amp;nbsp;termómetro&amp;nbsp;dibujado en el metodo paint() de una clase java. quedando asi&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtTSjlJ7UuhsTK7CqYZmUR19OwKZQnfwRIKfWLvLrH71k-Q2_AaZ-MjNpHXU_vqDzjNilXRTRix5S5BmZBN39oYf_vt3eKIL9YW88XtsAUId7J4PfcNbkGzw9aSbjFPG0L-4cyqDf1ifA/s1600/Pantallazo-0-0.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjtTSjlJ7UuhsTK7CqYZmUR19OwKZQnfwRIKfWLvLrH71k-Q2_AaZ-MjNpHXU_vqDzjNilXRTRix5S5BmZBN39oYf_vt3eKIL9YW88XtsAUId7J4PfcNbkGzw9aSbjFPG0L-4cyqDf1ifA/s320/Pantallazo-0-0.png&quot; width=&quot;239&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Esta interfaz ira representando los valores que arduino le haga llegar.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;CÓDIGO&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&lt;/span&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;public void paint(Graphics g)&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp;//super.paint(g);//para algunos sistemas windoxs&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp;repaint();&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; //temp=(redonde((n/.30)));&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if ((x-c&amp;lt;=156)&amp;amp;&amp;amp;(x-c&amp;gt;=106))&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; fondo=Color.BLUE;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;if ((x-c&amp;lt;=106)&amp;amp;&amp;amp;(x-c&amp;gt;=74))&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; fondo=Color.ORANGE;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if ((x-c&amp;lt;=74)&amp;amp;&amp;amp;(x-c&amp;gt;=34))&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; fondo=Color.RED;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //base&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //fuente de todas las letras en el termometro&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Font f = new Font( &quot;Helvetica&quot;,Font.BOLD,16 );&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;g.setFont( f );&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;g.setColor(Color.BLACK);&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; g.drawArc(90,230,50,50, 130,280);//base arriba&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;g.drawArc(80,230,70,60, 130,277);//base abajo&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;g.drawLine(100,80,100,235);&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; g.drawLine(92,80,92,237);&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;g.drawLine(132,80,132,235);&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;g.drawLine(140,80,140,238);&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; //base&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;g.drawArc(92,60,48,48,8,180);//tapa de arriba&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;g.drawArc(100,65,32,32,5,180);//tapa de abajo&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; //g.drawArc(90,50,50,50, 540,360);&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;//rellono que simula al mercurio&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; g.setColor(fondo);&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;g.fillArc(90,230,50,50, 0,360);&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;g.fillRect(101,80,31,156);//rellono mercurio&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;g.setColor(Color.WHITE);&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;g.fillRect(101,80,31,x-c);//rellono mercurio&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;//fuentes&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;g.setColor(Color.white);&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp;g.fillArc(100,65,32,32,5,180);//tapa de abajo&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp;g.drawString((c)+&quot;ºC&quot;, 95,260);&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//letras&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; g.setColor(Color.BLUE);&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;g.drawString(&quot;0 -&quot;, 70,240);&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; g.drawString(&quot;20 -&quot;, 65,220);&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;g.setColor(Color.ORANGE);&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;g.drawString(&quot;40 -&quot;, 65,200);&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; g.drawString(&quot;60 -&quot;,65,180);&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; g.setColor(Color.RED);&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;g.drawString(&quot;80 -&quot;, 65,160);&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; g.drawString(&quot;100 -&quot;,55,140);&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //g.drawString(&quot;120 -&quot;, 55,120);&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //g.drawString(&quot;140 -&quot;,55,100);&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if(x&amp;lt;=10)&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; {&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; g.setColor(Color.RED);&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp;g.fillArc(100,65,32,32,5,180);//tapa de abajo&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Es&amp;nbsp;fácil&amp;nbsp;notar que el&amp;nbsp;termómetro&amp;nbsp;ira adquiriendo otro color mientras la temperatura vaya aumentando.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;paso 3.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;hasta ahora solo se ha preparado la interfaz de usuario, entramos a la parte de la&amp;nbsp;conexión&amp;nbsp;pues prepararemos arduino para mandar los datos a java.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;el codigo es muy simple.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;void setup()&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;//abrimos el puerto serie a una tasa de bits de 9600 estantar&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;Serial.begin(9600);&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;}&lt;/span&gt;//fin de setup&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;void loop()&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;//se prepara los datos para ser enviados &amp;nbsp;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;/*primero se lee lo que esta en la entrada&amp;nbsp;analógica&amp;nbsp;0 luego lo multiplicamos por 500 por que esta siendo alimentado con 5v y hay 500 veces 10 mlv en el. 10ml por 500 = 5v (LM35 usa 10ml para presesentar un 1°c)&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;esta es la&amp;nbsp;explicación&amp;nbsp;de por que por 500&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;luego se divide entre 1023.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;esto por que es lo&amp;nbsp;máximo&amp;nbsp;que arduino puede leer de la&amp;nbsp;estragada&amp;nbsp;analogica&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;y por ultimo escribimos en el puerto serie la cantidad que nos quedo. ya en grados&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;*/&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;Serial.write((analogRead(0)*500.00)/1023.00);&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;//le decimos a arduino &amp;nbsp;que lee la entrada&amp;nbsp;analógica&amp;nbsp; cada segundo &amp;nbsp;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;delay(1000);&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;cabe aclarar que hay dos formas en las que arduino&amp;nbsp;envía&amp;nbsp;informacion por el puerto serie son Serial.write ();&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;y Serial.println();&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;uno envia el valor real y el otro pinta el resultado sin importarle cual es su valor.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;ejemplo si estamos a 61°c&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;el&amp;nbsp;método&amp;nbsp; Serial.write ();&amp;nbsp;mandaría&amp;nbsp;una a ¿por que? es simple por que en la tabla ascii a=61 entonces cuando java reciba esta &quot;a&quot;&amp;nbsp;sabrá&amp;nbsp;que es un 61 y lo graficara en el&amp;nbsp;termómetro.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;el metodo Serial.println (); este no le importara su valor real y simplemente&amp;nbsp;pondrá&amp;nbsp;en el puerto serie el 61&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;entonces cuando java reciba este&amp;nbsp;&amp;nbsp;este 61, tomara el &quot;6&quot; &amp;nbsp;y graficara en el&amp;nbsp;termómetro&amp;nbsp;el 54, tabla ascci 6 =54&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;e&amp;nbsp;inmediatamente&amp;nbsp;tomara el &amp;nbsp;&quot;1&quot; y graficara en el&amp;nbsp;termómetro el 49, por la misma razon 1 en &amp;nbsp;la tabla ascii=49.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;por lo que el metodo Serial.println() no es valido para estas practicas.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;el codigo sin comentarios queda asi:&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhL8Xbg8yugNYt7P5m1ZFSVF0asCDwfAMTQHzsSPAF3L4JHM2Kwk9opmnK0fD6JhFsqLFyR6hw-r4xgDrfuI1RiK7VpXW-olr6_L4kkidquoSqHKpBfxMbui30KBrayVW9BTeIEKkBi0Kw/s1600/Pantallazo-1-1-1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhL8Xbg8yugNYt7P5m1ZFSVF0asCDwfAMTQHzsSPAF3L4JHM2Kwk9opmnK0fD6JhFsqLFyR6hw-r4xgDrfuI1RiK7VpXW-olr6_L4kkidquoSqHKpBfxMbui30KBrayVW9BTeIEKkBi0Kw/s1600/Pantallazo-1-1-1.png&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;paso 4 y ultimo:&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;recibir&amp;nbsp;los datos de arduino&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;//importamos las librerias necesarias para la conexion&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;import gnu.io.CommPortIdentifier;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;import gnu.io.SerialPort;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;import java.lang.reflect.*;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;import java.io.InputStream;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;import processing.app.Preferences;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;creamos&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;una variable de tipo Input para que este reciba los datos de arduino asi:&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;&amp;nbsp;static InputStream input;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;luego en el metodo main que previamente fue preparado para la comunicacion&amp;nbsp;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;asemos &lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;&amp;nbsp;int n=0; n=(input.read()) ;//Temperatura&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;temperatura(n);&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #660000;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;y ese valor se lo mandamos a un metodo encargado graficarlo en el&amp;nbsp;termómetro.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;public static void temperatura(int t)&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;c=t;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp;&lt;/span&gt;la &quot;c&quot; del&amp;nbsp;código&amp;nbsp;es la que se graficara en arduino.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;el&amp;nbsp;código&amp;nbsp;quedara&amp;nbsp;así sin el metodo paint&amp;nbsp;:&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;import gnu.io.PortInUseException;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;import gnu.io.UnsupportedCommOperationException;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;import java.awt.Color;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;import java.awt.Font;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;import java.awt.Graphics;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;import gnu.io.CommPortIdentifier;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;import gnu.io.SerialPort;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;import gnu.io.SerialPortEvent;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;import java.io.InputStream;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;import java.io.OutputStream;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;import processing.app.Preferences;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;import java.util.*;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;import java.io.IOException;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;import java.util.logging.Level;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;import java.util.logging.Logger;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;import java.awt.Color;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;/**&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp;*&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp;* @author victor&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp;*/&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;public class Temperatura extends javax.swing.JFrame {&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;int x=156;static int c=0;static int m=1;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;double temp=0;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;Color fondo=Color.GREEN;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;static byte chunk[]={1};&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;static int n=0;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; static InputStream input;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; static OutputStream output;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; static SerialPort serialport;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; private static final String PORT_NAMES[] = {&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;//&quot;/dev/tty.usbserial-A9007UX1&quot;, // Mac OS X&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;//&quot;/dev/ttyUSB0&quot;, // Linux&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &quot;/dev/ttyACM0&quot;,&quot;/dev/ttyUSB0&quot;, &quot;/dev/ttyUSB1&quot;, &quot;/dev/ttyUSB2&quot;, &quot;/dev/ttyUSB3&quot;, &quot;/dev/ttyUSB4&quot;, &quot;/dev/ttyUSB5&quot;, &quot;/dev/ttyUSB6&quot;, &quot;/dev/ttyUSB7&quot;, &quot;/dev/ttyUSB8&quot;, &quot;/dev/ttyUSB9&quot;, &quot;/dev/ttyUSB10&quot;, &quot;/dev/ttyUSB11&quot;, &quot;/dev/ttyUSB12&quot;,&quot;/dev/ttyUSB13&quot;,&quot;/dev/ttyUSB14&quot;,&quot;/dev/ttyUSB15&quot;,&quot;/dev/ttyUSB16&quot;,&quot;/dev/ttyUSB17&quot;,&quot;/dev/ttyUSB18&quot;,&quot;/dev/ttyUSB19&quot;,&quot;/dev/ttyUSB20&quot;,&quot;/dev/ttyUSB21&quot;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;,&quot;COM3&quot;,&quot;COM0&quot;,&quot;COM1&quot;,&quot;COM2&quot;,&quot;COM4&quot;,&quot;COM5&quot;,&quot;COM6&quot;,&quot;COM7&quot;,&quot;COM3&quot;,&quot;COM8&quot;,&quot;COM9&quot;,&quot;COM10&quot;,&quot;COM11&quot;,&quot;COM12&quot; // Windows&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;};&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; static public class MyPrefs extends Preferences {&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; static public void init() {&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; Preferences.init(&quot;/home/victor/.arduino/preferences.txt&quot;);&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;//Preferences.init(&quot;c:/preferences.txt&quot;);&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; /** Creates new form Temperatura */&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; public Temperatura() {&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; initComponents();&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;public static void temperatura(int t)&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;c=t;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; /** This method is called from within the constructor to&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* initialize the form.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* WARNING: Do NOT modify this code. The content of this method is&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* always regenerated by the Form Editor.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;*/&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; @SuppressWarnings(&quot;unchecked&quot;)&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; // &amp;lt;editor-fold defaultstate=&quot;collapsed&quot; desc=&quot;Generated Code&quot;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; private void initComponents() {&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; setTitle(&quot;Termometro&quot;);&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; getContentPane().setLayout(layout);&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; layout.setHorizontalGroup(&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .addGap(0, 244, Short.MAX_VALUE)&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; );&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; layout.setVerticalGroup(&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; .addGap(0, 300, Short.MAX_VALUE)&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; );&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; pack();&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; }// &amp;lt;/editor-fold&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; /**&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;* @param args the command line arguments&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;*/&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; public static void main(String args[]) throws IOException, PortInUseException, UnsupportedCommOperationException {&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; /* Set the Nimbus look and feel */&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //&amp;lt;editor-fold defaultstate=&quot;collapsed&quot; desc=&quot; Look and feel setting code (optional) &quot;&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;* For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;*/&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; try {&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; if (&quot;Nimbus&quot;.equals(info.getName())) {&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; javax.swing.UIManager.setLookAndFeel(info.getClassName());&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; break;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } catch (ClassNotFoundException ex) {&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; java.util.logging.Logger.getLogger(Temperatura.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } catch (InstantiationException ex) {&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; java.util.logging.Logger.getLogger(Temperatura.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } catch (IllegalAccessException ex) {&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; java.util.logging.Logger.getLogger(Temperatura.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; } catch (javax.swing.UnsupportedLookAndFeelException ex) {&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; java.util.logging.Logger.getLogger(Temperatura.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //&amp;lt;/editor-fold&amp;gt;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; /* Create and display the form */&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; java.awt.EventQueue.invokeLater(new Runnable() {&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; public void run() {&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; new Temperatura().setVisible(true);&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; });&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MyPrefs.init();&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println(&quot;puerto usado: &quot; + MyPrefs.get(&quot;serial.port&quot;));&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println(&quot;targeta utilizada: &quot; + MyPrefs.get(&quot;board&quot;));&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; /*CommPortIdentifier portId = CommPortIdentifier.getPortIdentifier(&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; MyPrefs.get(&quot;serial.port&quot;));*/&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; CommPortIdentifier portId = null;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;Enumeration portEnum = CommPortIdentifier.getPortIdentifiers();&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;// iteraciones para buscar el puerto&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;while (portEnum.hasMoreElements()) {&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;CommPortIdentifier currPortId = (CommPortIdentifier) portEnum.nextElement();&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;for (String portName:PORT_NAMES) {&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;if (currPortId.getName().equals(portName)) {&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;portId = currPortId;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;     &lt;/span&gt;break;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; Temperatura m=new Temperatura();&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; serialport = (SerialPort)portId.open(m.getClass().getName(), 9600);&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; input = serialport.getInputStream();&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; output = serialport.getOutputStream();&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; serialport.setSerialPortParams(MyPrefs.getInteger(&quot;serial.debug_rate&quot;),&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SerialPort.DATABITS_8,&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SerialPort.STOPBITS_1,&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; SerialPort.PARITY_NONE);&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; while(true){&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; while(input.available()&amp;gt;0) {&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //System.out.println((char)(input.read()));&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;try {&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; /*&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;int available = input.available();//esta linea regresa el valor de la cantidad de informaion en el puerto serie&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;byte chunk[] = new byte[available];//se crea una rreglo de tipo bite que tiene como limite el valor de avalible&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;input.read(chunk, 0, available);//lee lo que se encuentra pendiente en el puertoserie y lo guarda en el arreglo&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;// Displayed results are codepage dependent&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; //despliega en pantalla todo lo que logro leer&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System.out.println(&quot;&quot;);&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;//System.out.println(&quot;Arduino dice: &quot;+new String(chunk));&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;n=Integer.parseInt(new String(chunk));&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;System.out.println(&quot;&quot;+n);&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;*/int b=0;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp;int n=0; n=(input.read()) ;//Temperatura&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;temperatura(n);&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;System.out.println(n);&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;  &lt;/span&gt;} catch (Exception e) {&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;    &lt;/span&gt;System.err.println(e.toString());&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&lt;span class=&quot;Apple-tab-span&quot; style=&quot;white-space: pre;&quot;&gt;   &lt;/span&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;//System.out.println(&quot;&quot;+ban);&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;}&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp;&amp;nbsp;static public double redonde (double x)&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp;{&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; return &amp;nbsp;Math.rint(x*1)/1;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&amp;nbsp; &amp;nbsp;&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;}&lt;/span&gt;&lt;/div&gt;&lt;div&gt;código&amp;nbsp;completos dudas comentarios y/o sugerencias a vctr.31@hotmail.com&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;un video de su implementacion.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;iframe allowfullscreen=&#39;allowfullscreen&#39; webkitallowfullscreen=&#39;webkitallowfullscreen&#39; mozallowfullscreen=&#39;mozallowfullscreen&#39; width=&#39;320&#39; height=&#39;266&#39; src=&#39;https://www.youtube.com/embed/Lo4Tha9PYAs?feature=player_embedded&#39; frameborder=&#39;0&#39;&gt;&lt;/iframe&gt;&lt;br /&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #cc0000;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;iframe allowfullscreen=&#39;allowfullscreen&#39; webkitallowfullscreen=&#39;webkitallowfullscreen&#39; mozallowfullscreen=&#39;mozallowfullscreen&#39; width=&#39;320&#39; height=&#39;266&#39; src=&#39;https://www.blogger.com/video.g?token=AD6v5dwgSjf02hBCM1vqAgFYqIp12uQWhEQjQnucRoMWz4Zp-bPWa1f8qGncfTuDO0ivskel6vIdLv3Pd6tYp4d5jg&#39; class=&#39;b-hbp-video b-uploaded&#39; frameborder=&#39;0&#39;&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: lime;&quot;&gt;Próximo tutorial&amp;nbsp;comunicación&amp;nbsp;de java con de&amp;nbsp;Internet&lt;/span&gt;&lt;/div&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;/div&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javaallimite.blogspot.com/feeds/3976287660652984503/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://javaallimite.blogspot.com/2011/12/sensor-de-temperatura-con-arduino-y.html#comment-form' title='4 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1468652985727080356/posts/default/3976287660652984503'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1468652985727080356/posts/default/3976287660652984503'/><link rel='alternate' type='text/html' href='http://javaallimite.blogspot.com/2011/12/sensor-de-temperatura-con-arduino-y.html' title='Sensor de temperatura con arduino y java'/><author><name>victor</name><uri>http://www.blogger.com/profile/14807786148874785693</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjmmJTZnDb0i8hIPsqhI4SgtsriqQM8q1taCZr8aJj233wvAnK_Av4L1ojQoDSvApcqNC3ODTeXIvbWmuvTxLIkzqj-hy6s052P7FORmjmlQzVCK4R0u9xlC0GI40Rz8OPjCTGhfWgLRlU/s72-c/Arduino_lm35_board_setup.jpg" height="72" width="72"/><thr:total>4</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1468652985727080356.post-2006878191217261537</id><published>2011-04-26T02:25:00.000-07:00</published><updated>2011-04-26T19:53:48.613-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="arduino"/><category scheme="http://www.blogger.com/atom/ns#" term="Arduino y java"/><category scheme="http://www.blogger.com/atom/ns#" term="Como progrmar en java"/><category scheme="http://www.blogger.com/atom/ns#" term="metodos java"/><category scheme="http://www.blogger.com/atom/ns#" term="puerto serie java"/><title type='text'>Primer tutorial: Arduino desde Java</title><content type='html'>&lt;div class=&quot;separator&quot; style=&quot;background-color: #fff2cc; clear: both; color: black; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiCG4DhwojMcsxPkXzLNXaylxf-SBZ4dcUijs3nwMwXArZhwqlefD6GF-MXecqUa7otBUr0LwVsIiBJtqx4yDSJv03KUY8LNummHfEcGOU7tgeyAUKXRxScr5N9En1sYxq8lAtLJUdFnmM/s1600/Pantallazo-6.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;br /&gt;
&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: black;&quot;&gt;Comenzamos con el primer Tutorial del blog, para los que nos gusta mezclar el Software y hardware, y queremos hacerlo desde Arduino y java. aquí están estos pequeños pasos para hacerlo.&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: black;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: black;&quot;&gt;&lt;br /&gt;
****Damos por hecho que ya tiene instalado Netbeans y Arduino*********&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: black;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: black; text-align: center;&quot;&gt;Paso 1.- Preparar arduino .&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: black;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: black;&quot;&gt;colocamos un led en arduino de la siguiente manera.&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: black;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;background-color: #fff2cc; clear: both; color: black; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEijMKQwQR_irbFbNKuoROYB05XmrRu5VWrUH8EB7coiSv4XAN9PBwkKw5iZO1JIf_dDcY2Pi8mOH-_n5b1vr85jixfI-ad8EtdRAj6ZvfTaZmxa4ntx8hdQ0JKCV590idS8Bn_LNkCZGuQ/s1600/IMG20110426_002.jpg&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;320&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEijMKQwQR_irbFbNKuoROYB05XmrRu5VWrUH8EB7coiSv4XAN9PBwkKw5iZO1JIf_dDcY2Pi8mOH-_n5b1vr85jixfI-ad8EtdRAj6ZvfTaZmxa4ntx8hdQ0JKCV590idS8Bn_LNkCZGuQ/s320/IMG20110426_002.jpg&quot; width=&quot;240&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: black;&quot;&gt;&lt;span style=&quot;background-color: #7f6000;&quot;&gt;Se encuentra en el pin 13.&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: black;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: black;&quot;&gt;Abrimos el ejecutable de arduino nos vamos a File&amp;gt;Examples&amp;gt;Blink&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: black;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: black;&quot;&gt;nos abrirá uno de los ejemplo que hacer parpadear un led en el pin 13 cada segundo.&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: black;&quot;&gt;el Código es el Siguiente&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;background-color: #fff2cc; clear: both; color: black; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcf0SzRyPtJs7XqEX7mNuzDPk7xObr4K4dkKXKISIZobvsqmncNaC_eTk6p04pc5NVqHUt47WtHKUZjU6xONhMeOw_v5RuLM6bYPXuenQMwhE8E4nSfKeoiQ-9YgkSEru7AMdeQHkcXrg/s1600/21.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;179&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjcf0SzRyPtJs7XqEX7mNuzDPk7xObr4K4dkKXKISIZobvsqmncNaC_eTk6p04pc5NVqHUt47WtHKUZjU6xONhMeOw_v5RuLM6bYPXuenQMwhE8E4nSfKeoiQ-9YgkSEru7AMdeQHkcXrg/s320/21.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: black;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: black;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: black;&quot;&gt;Lo tendremos que modificar de la siguiente manera:&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;background-color: #fff2cc; clear: both; color: black; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjx6oRoA5pLFQPka6wW9Jj33zoztAqkO8-lkCWUrCXTkjOQd5LtEASqWrAUqhVm5mqLVQV-WH_ILn3giInwbzk-HBKHuV-3HHNtDpv-3pMmSuCIJ5M6wgp3JAQNbXyi8KTNi5zoSIMHNlU/s1600/Pantallazo.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;179&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjx6oRoA5pLFQPka6wW9Jj33zoztAqkO8-lkCWUrCXTkjOQd5LtEASqWrAUqhVm5mqLVQV-WH_ILn3giInwbzk-HBKHuV-3HHNtDpv-3pMmSuCIJ5M6wgp3JAQNbXyi8KTNi5zoSIMHNlU/s320/Pantallazo.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: black;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: black;&quot;&gt;Después de modificarlo lo compilamos(-con icono parecido a play debajo de File) y si todo anda bien lo subimos (Verifique que esta en el puerto corecto y que tiene seleccionado la placa correcta).Ya que tengasmos el programa en arduino hasta aquí por el momento con la placa (No desconecte)nos vamos a Netbeans.&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: black;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: black;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: black; text-align: center;&quot;&gt;Paso 2: Abrimos Netbeans y nos vamos a File&amp;gt;New project... nos aparecerá la siguiente ventana.&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: black;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;background-color: #fff2cc; clear: both; color: black; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvWj6Z66a41F9KAg1B1BZMz-aS9tEdnQagRS3IgVzIWJ1dhAWkTtiy59Y3osu634ZPDmWvqDyXFuYDWhJ7v-SiB8C89olX3wk8Wfyw3BLZnJC4NHaWtWTiWigvHjgwwPhao0jLoNoPzW8/s1600/1.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;179&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhvWj6Z66a41F9KAg1B1BZMz-aS9tEdnQagRS3IgVzIWJ1dhAWkTtiy59Y3osu634ZPDmWvqDyXFuYDWhJ7v-SiB8C89olX3wk8Wfyw3BLZnJC4NHaWtWTiWigvHjgwwPhao0jLoNoPzW8/s320/1.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: black;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: black;&quot;&gt;Seleccionamos java y java application como se ve en la figura y presionamos next &amp;gt; y veremos la siguiente Ventana.&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: black;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;background-color: #fff2cc; clear: both; color: black; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5JIBSW93yj_ZlMj9ZeaBiQZbMaacuHEW7POb5yKSU8WSP3hztNOtMbVdR6bDki2CZg0FoTi1tN_vFw2lqv5s1LJTEMwKBg5k3PgEfhTxGGEprthXViMftcqTXuyOncyeZsMkBGtmF0Nw/s1600/2.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;179&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5JIBSW93yj_ZlMj9ZeaBiQZbMaacuHEW7POb5yKSU8WSP3hztNOtMbVdR6bDki2CZg0FoTi1tN_vFw2lqv5s1LJTEMwKBg5k3PgEfhTxGGEprthXViMftcqTXuyOncyeZsMkBGtmF0Nw/s320/2.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: black;&quot;&gt;Escoja un nombre para el proyecto nuevo en mi caso use &quot;ArduinoAndJava&quot;, desmarque la opción que dice Create Main Class pues no la necesita remos, la ventana le quedara de la siguiente forma.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;background-color: #fff2cc; clear: both; color: black; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjApJvtZST4FCKMp78WVWH90lQsc23D_ajcAnoIVoqGXmvAGT-dHY0i5tR_Dl7Ce2SXnkTv-9_VTaGLmI2qW0tX6w5UYCkn6DmfN3eu3HHaLIoiX2bPsFL7rjMHyRumPQAPwIRiXHf37iw/s1600/3.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;179&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjApJvtZST4FCKMp78WVWH90lQsc23D_ajcAnoIVoqGXmvAGT-dHY0i5tR_Dl7Ce2SXnkTv-9_VTaGLmI2qW0tX6w5UYCkn6DmfN3eu3HHaLIoiX2bPsFL7rjMHyRumPQAPwIRiXHf37iw/s320/3.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: black;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: black;&quot;&gt;Cuando tengamos de esta manera la ventana le damos en Next &amp;gt;.&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: black;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: black;&quot;&gt;y ahora tendremos la siguiente Ventana.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;background-color: #fff2cc; clear: both; color: black; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKKkBx7dKPJFtz75ZpdKuMysBOMBp3lpIku7ePKzlTGO2fPbp0U6iUYPx7gVUeJ_9R9UxxMHv4M4AvgNmqSsPfD0_oJxxGT_zuoepXvtXeQT1QyV_GsZ97FrjPHZtvNbsjOw9K5ifA2aA/s1600/4.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;179&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjKKkBx7dKPJFtz75ZpdKuMysBOMBp3lpIku7ePKzlTGO2fPbp0U6iUYPx7gVUeJ_9R9UxxMHv4M4AvgNmqSsPfD0_oJxxGT_zuoepXvtXeQT1QyV_GsZ97FrjPHZtvNbsjOw9K5ifA2aA/s320/4.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: black;&quot;&gt;&amp;nbsp;ya podemos ver nuestro nuevo proyecto creado lo seleccionamos y le damos un click derecho(click secundario), y hasta lo ultimo seleccionamos properties..&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: black;&quot;&gt;Se abrirá otra ventana y seleccionamos Run como se ve en la siguiente imagen.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;background-color: #fff2cc; clear: both; color: black; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhI4J88z2fitqf105-rVKbEkvvQysRZZbNwGffntBLEMCd3S3wfKinLN_vCxsin9xFo-T9LtEe4ZzVPyKpe1yLtmvOfO0Y_Jcbcf3xX-g7S37h7iGz5do7V1ZUWoC7l7GtVecsxkGIixnY/s1600/5.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;179&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhI4J88z2fitqf105-rVKbEkvvQysRZZbNwGffntBLEMCd3S3wfKinLN_vCxsin9xFo-T9LtEe4ZzVPyKpe1yLtmvOfO0Y_Jcbcf3xX-g7S37h7iGz5do7V1ZUWoC7l7GtVecsxkGIixnY/s320/5.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: black;&quot;&gt;Localizamos la parte que dice Working Directori y damos click en Browse... ahi se abrirá otra ventana para seleccionar la ruta donde se encuentra la carpeta de arduino así como se ve en la sig. imagen.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;background-color: #fff2cc; clear: both; color: black; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJggtEUzgtMYngISt5ldGFmgWMH816YBWptgIfjr2M3P0hxggj8Xqjg-ys8hPE_ndJdYxO_HzdZDbTnvZqahjqI6_hwTNAF8k3V8tv-eGUi_gx2awl1Kh_PlNTmJltffh2sl1uzanQ_to/s1600/6.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;179&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjJggtEUzgtMYngISt5ldGFmgWMH816YBWptgIfjr2M3P0hxggj8Xqjg-ys8hPE_ndJdYxO_HzdZDbTnvZqahjqI6_hwTNAF8k3V8tv-eGUi_gx2awl1Kh_PlNTmJltffh2sl1uzanQ_to/s320/6.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: black;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: black;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: black;&quot;&gt;Después de seleccionar la ruta veremos algo así.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;background-color: #fff2cc; clear: both; color: black; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjM1dySTxb_VBRz_Iwzf5OiqqvKT8qAbC8bIXif0lFctyhZwf3nBRI5s0iMd-ig3S3DZDGnT-ooP4sX-JcaEZLO1Uu-LMfCQkBioESLaoZ8-UAGcAk3_6D2uaRzr-BTe0t9bED930TbRTc/s1600/7.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;179&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjM1dySTxb_VBRz_Iwzf5OiqqvKT8qAbC8bIXif0lFctyhZwf3nBRI5s0iMd-ig3S3DZDGnT-ooP4sX-JcaEZLO1Uu-LMfCQkBioESLaoZ8-UAGcAk3_6D2uaRzr-BTe0t9bED930TbRTc/s320/7.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: black;&quot;&gt;Una vez hecho esto damos a Ok y terminamos con este paso.&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: black;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: black;&quot;&gt;Paso 3: Librerias&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: black;&quot;&gt;&lt;br /&gt;
Localizamos nuestro proyecto y le damos click a la flecha que esta junto y se abrirán nuevas carpetas y seleccionamos la que dice Libraries como se ve enseguida.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;background-color: #fff2cc; clear: both; color: black; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_Z1weXxF7Vb_E2UUFzSl7fdfU5U-zCp1Z9XSGTvDvt-Jqo4M_Eb0UvhbNE24_9HZ9afOqu_fAKUmxJbIdS2aAO_f85H1BHqIAS4QU8xFeXNR1hB6O8PMWtz1YVw77kONIZsFaxVf7Iw0/s1600/9.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;179&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi_Z1weXxF7Vb_E2UUFzSl7fdfU5U-zCp1Z9XSGTvDvt-Jqo4M_Eb0UvhbNE24_9HZ9afOqu_fAKUmxJbIdS2aAO_f85H1BHqIAS4QU8xFeXNR1hB6O8PMWtz1YVw77kONIZsFaxVf7Iw0/s320/9.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: black;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: black;&quot;&gt;La seleccionamos con un click derecho y veremos lo siguiente.&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: black;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;background-color: #fff2cc; clear: both; color: black; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmKTIWUPBaLoQUoG_snJOTsZd0cbt-n4BErMFdZLP2EVHfRp7CP6IkDvpoLQP4uNRJB_OIVc_ZNdFcZ_Lc7HDmzb2C7xAmtPhqzIudP95zF8zP545jWYUwQwJzSGuCKBD1alaBD3_sE84/s1600/10.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;179&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhmKTIWUPBaLoQUoG_snJOTsZd0cbt-n4BErMFdZLP2EVHfRp7CP6IkDvpoLQP4uNRJB_OIVc_ZNdFcZ_Lc7HDmzb2C7xAmtPhqzIudP95zF8zP545jWYUwQwJzSGuCKBD1alaBD3_sE84/s320/10.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: black;&quot;&gt;Le damos click en el boton que dice Create veremos ....&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;background-color: #fff2cc; clear: both; color: black; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNgbpF2gAC44beeLgmnLHeaqRI3uKTLBmgwwEORnmUnCRAJESyfJjyYs37j3XwgHRyRE9C8oEzaVEw5DPPy2oDdSwNeWbBv7A5RSETM-lz5yc5FJz1-bW0CSU2hN_c-RBevGWAVYLa4xQ/s1600/11.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;179&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjNgbpF2gAC44beeLgmnLHeaqRI3uKTLBmgwwEORnmUnCRAJESyfJjyYs37j3XwgHRyRE9C8oEzaVEw5DPPy2oDdSwNeWbBv7A5RSETM-lz5yc5FJz1-bW0CSU2hN_c-RBevGWAVYLa4xQ/s320/11.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: black;&quot;&gt;En Libreries Name ponemos ARDUINO y pulsamos ok.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;background-color: #fff2cc; clear: both; color: black; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMP3sT6Uo5OxUzC_kJ_ebLuJ03PN1RTT0xSSRbgoAxq90tk5ihmg_d3df8X_w09yPEQdbl1g33cUgeCau_gqj3wVUQpLEHyFWPWWcvrJOzej9n7FByO3TG-TOqKj61nfpHyG4oUmQOjWc/s1600/12.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;179&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMP3sT6Uo5OxUzC_kJ_ebLuJ03PN1RTT0xSSRbgoAxq90tk5ihmg_d3df8X_w09yPEQdbl1g33cUgeCau_gqj3wVUQpLEHyFWPWWcvrJOzej9n7FByO3TG-TOqKj61nfpHyG4oUmQOjWc/s320/12.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: black;&quot;&gt;Veremos algo parecido a la imagen de arriba, tendremos que buscar la carpeta de arduino que nos descargamos y dentro de esas carpeta localizamos otra llamada &amp;gt; lib ahi se encuentran todas las librerías que necesitamos para que java pueda comunicarse con arduino. veremos lo siguiente&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;background-color: #fff2cc; clear: both; color: black; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;background-color: #fff2cc; clear: both; color: black; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;background-color: #fff2cc; clear: both; color: black; text-align: center;&quot;&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;background-color: #fff2cc; clear: both; color: black; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhptpowV_lvCTjKlXcKpqMG_lkn15Cqn2Se-uJ-9IQNwSxtMEWAbXN8HhiO9sh92Gl32zFPX0Hj8EHEu5eLjmxvh3SqLdF0Bs3Ez6yrjjcKSz_PW5_akb_EV9zDKQQs1IMkb27WF0Gq4Qs/s1600/13.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;179&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhptpowV_lvCTjKlXcKpqMG_lkn15Cqn2Se-uJ-9IQNwSxtMEWAbXN8HhiO9sh92Gl32zFPX0Hj8EHEu5eLjmxvh3SqLdF0Bs3Ez6yrjjcKSz_PW5_akb_EV9zDKQQs1IMkb27WF0Gq4Qs/s320/13.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: black;&quot;&gt;Seleccionamos todos lo Jars que ahi vemos y pulsamos add JAR/Folder.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;background-color: #fff2cc; clear: both; color: black; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiOwLOq47onaABsPnLy7Ck0PbcYuUcrCE7y7AyW2oJENjQ6KHGySr0S20MszULk2SHij3rDPgUhckpd2GqJxbQtAB3jml9R9dHyptbuQ1Ic3znCfIsJvS_gNuII3W476ZBEA-TR901Tidw/s1600/Pantallazo-3.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;179&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiOwLOq47onaABsPnLy7Ck0PbcYuUcrCE7y7AyW2oJENjQ6KHGySr0S20MszULk2SHij3rDPgUhckpd2GqJxbQtAB3jml9R9dHyptbuQ1Ic3znCfIsJvS_gNuII3W476ZBEA-TR901Tidw/s320/Pantallazo-3.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: black;&quot;&gt;Ahora veremos la ventana anterior seleccionamos la librería que acavamos de crear y pulsamos en. Add Libra...&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: black;&quot;&gt;listo tenemos todas la librerías necesarias, y ahora solo necesitamos el código. espero que hasta aquí todo vaya perfecto. continuamos.&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: black;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: black;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: black; text-align: center;&quot;&gt;Paso 4:Añadir clases&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: black; text-align: justify;&quot;&gt;Le damos click derecho a nuestro proyecto nuevo y seleccionamos New&amp;gt;Java class&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: black; text-align: justify;&quot;&gt;y le ponemos&amp;nbsp; nombre a nuestra clase, en mi caso le puse &quot;led&quot;.&amp;nbsp; como vemos enseguida.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;background-color: #fff2cc; clear: both; color: black; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEid8O4qJgGam-EBnA5aFETlEmyjAjVYMilfirpBQTDocTlGHTWFNtynbJZDWrADSeU2Y1bUPirqiMd5nmP-tkr4aEGOnbAnVLOibe4CvWKtYGaKPt2hYH_1O8eUwmHXEiVHbwMTc__a-Is/s1600/Pantallazo-5.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;179&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEid8O4qJgGam-EBnA5aFETlEmyjAjVYMilfirpBQTDocTlGHTWFNtynbJZDWrADSeU2Y1bUPirqiMd5nmP-tkr4aEGOnbAnVLOibe4CvWKtYGaKPt2hYH_1O8eUwmHXEiVHbwMTc__a-Is/s320/Pantallazo-5.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;background-color: #fff2cc; clear: both; color: black; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgNlWURUHxQZehwYoUsZN4mvjSERMMx8qA9Qvm-R_T-rjnyDNaTkaExdDQT3etOUJeytovGxTlmww850oMppJlC9Gpk6iQ_iimyRPA-cVZK86lAyKHZ-KLLfSsO5pnwLUwDWbwsHkVAHGs/s1600/Pantallazo-5.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;br /&gt;
&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: black;&quot;&gt;&lt;span style=&quot;background-color: #7f6000;&quot;&gt;y &lt;/span&gt;&lt;span style=&quot;background-color: #7f6000;&quot;&gt;presionamos&lt;/span&gt;&lt;span style=&quot;background-color: #7f6000;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;background-color: #7f6000;&quot;&gt;Finish&lt;/span&gt;&lt;span style=&quot;background-color: #7f6000;&quot;&gt;. veremos....&lt;/span&gt;&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: black; text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;background-color: #fff2cc; clear: both; color: black; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgcI-l3kNi6ohhK7fHMpXQMW71FilpEl3CdAK1iqC9HeRVqNZaBTaUj8hjvMzX6RlU4Fb_JguiYCumlrwSQIWb7a2GbhlQJHQlDY3MOC2r5yyq4NkvXmVeLiyUPB8Hxp-BZ1timz1s_bvw/s1600/Pantallazo-6.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;179&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgcI-l3kNi6ohhK7fHMpXQMW71FilpEl3CdAK1iqC9HeRVqNZaBTaUj8hjvMzX6RlU4Fb_JguiYCumlrwSQIWb7a2GbhlQJHQlDY3MOC2r5yyq4NkvXmVeLiyUPB8Hxp-BZ1timz1s_bvw/s320/Pantallazo-6.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;background-color: #fff2cc; clear: both; color: black; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgRm7zPBlhrwijZukJdpJWia-KFfDSlOxiIEelfxFxEdRK5ArPMqGYUk7f2-sKQ4ii9DqLTIqzS1BTmG_wffBfd2xiwKcNIL4WhVspe2FgSlpIABAQfWuZSdSxnAiAtTAa0tpSeyAkRZfk/s1600/Pantallazo-6.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;br /&gt;
&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: black;&quot;&gt;y agregamos los siguientes métodos para que todo funcione muy bien.&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: red;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: red;&quot;&gt;//arreglo que contine los posibles nombres que tendrán los puertos donde se conectara el arduino&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; private static final String PORT_NAMES[] = {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; //&quot;/dev/tty.usbserial-A9007UX1&quot;, // Mac OS X&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; //&quot;/dev/ttyUSB0&quot;, // Linux&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &quot;/dev/ttyUSB0&quot;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; ,&quot;COM3&quot; // Windows&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; };&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: red;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: red;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: red;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; static public class MyPrefs extends Preferences {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; static public void init() {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; Preferences.init(&quot;/home/victor/.arduino/preferences.txt&quot;);//para linux&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Preferences.init(&quot;c:/preferences.txt&quot;);//para windows&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; /** Creates new form led */&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; public led() {&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; initComponents();&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: red;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: black;&quot;&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;private&lt;span style=&quot;color: red;&quot;&gt; &lt;/span&gt;void&lt;span style=&quot;color: red;&quot;&gt; jButton1ActionPerformed(java.&lt;/span&gt;awt&lt;span style=&quot;color: red;&quot;&gt;.&lt;/span&gt;event&lt;span style=&quot;color: red;&quot;&gt;.&lt;/span&gt;ActionEvent&lt;span style=&quot;color: red;&quot;&gt; &lt;/span&gt;evt&lt;span style=&quot;color: red;&quot;&gt;) {//GEN-&lt;/span&gt;FIRST&lt;span style=&quot;color: red;&quot;&gt;:&lt;/span&gt;event&lt;span style=&quot;color: red;&quot;&gt;_jButton1ActionPerformed&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // TODO &lt;/span&gt;add&lt;span style=&quot;color: red;&quot;&gt; &lt;/span&gt;your&lt;span style=&quot;color: red;&quot;&gt; &lt;/span&gt;handling&lt;span style=&quot;color: red;&quot;&gt; &lt;/span&gt;code&lt;span style=&quot;color: red;&quot;&gt; &lt;/span&gt;here&lt;span style=&quot;color: red;&quot;&gt;:&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Este es el &lt;/span&gt;codigo&lt;span style=&quot;color: red;&quot;&gt; del &lt;/span&gt;boton&lt;span style=&quot;color: red;&quot;&gt; que &lt;/span&gt;prendera&lt;span style=&quot;color: red;&quot;&gt; el &lt;/span&gt;led&lt;span style=&quot;color: red;&quot;&gt; se manda un uno que &lt;/span&gt;arduino&lt;span style=&quot;color: red;&quot;&gt; &lt;/span&gt;interpretara&lt;span style=&quot;color: red;&quot;&gt; por su respectivo &lt;/span&gt;codigo&lt;span style=&quot;color: red;&quot;&gt; &lt;/span&gt;ascii&lt;span style=&quot;color: red;&quot;&gt; que para el uno es 49&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;sendMessage&lt;span style=&quot;color: red;&quot;&gt;(&quot;1&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }//GEN-&lt;/span&gt;LAST&lt;span style=&quot;color: red;&quot;&gt;:&lt;/span&gt;event&lt;span style=&quot;color: red;&quot;&gt;_jButton1ActionPerformed&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;private&lt;span style=&quot;color: red;&quot;&gt; &lt;/span&gt;void&lt;span style=&quot;color: red;&quot;&gt; jButton2ActionPerformed(java.&lt;/span&gt;awt&lt;span style=&quot;color: red;&quot;&gt;.&lt;/span&gt;event&lt;span style=&quot;color: red;&quot;&gt;.&lt;/span&gt;ActionEvent&lt;span style=&quot;color: red;&quot;&gt; &lt;/span&gt;evt&lt;span style=&quot;color: red;&quot;&gt;) {//GEN-&lt;/span&gt;FIRST&lt;span style=&quot;color: red;&quot;&gt;:&lt;/span&gt;event&lt;span style=&quot;color: red;&quot;&gt;_jButton2ActionPerformed&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // TODO &lt;/span&gt;add&lt;span style=&quot;color: red;&quot;&gt; &lt;/span&gt;your&lt;span style=&quot;color: red;&quot;&gt; &lt;/span&gt;handling&lt;span style=&quot;color: red;&quot;&gt; &lt;/span&gt;code&lt;span style=&quot;color: red;&quot;&gt; &lt;/span&gt;here&lt;span style=&quot;color: red;&quot;&gt;:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //Este es el &lt;/span&gt;codigo&lt;span style=&quot;color: red;&quot;&gt; del &lt;/span&gt;boton&lt;span style=&quot;color: red;&quot;&gt; que apagara el &lt;/span&gt;led&lt;span style=&quot;color: red;&quot;&gt; se manda un dos que &lt;/span&gt;arduino&lt;span style=&quot;color: red;&quot;&gt; &lt;/span&gt;interpretara&lt;span style=&quot;color: red;&quot;&gt; por su respectivo &lt;/span&gt;codigo&lt;span style=&quot;color: red;&quot;&gt; &lt;/span&gt;ascii&lt;span style=&quot;color: red;&quot;&gt; que para el dos es 50&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;sendMessage&lt;span style=&quot;color: red;&quot;&gt;(&quot;2&quot;);&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }//GEN-&lt;/span&gt;LAST&lt;span style=&quot;color: red;&quot;&gt;:&lt;/span&gt;event&lt;span style=&quot;color: red;&quot;&gt;_jButton2ActionPerformed&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;private&lt;span style=&quot;color: red;&quot;&gt; &lt;/span&gt;void&lt;span style=&quot;color: red;&quot;&gt; jMenu3MouseClicked(java.&lt;/span&gt;awt&lt;span style=&quot;color: red;&quot;&gt;.&lt;/span&gt;event&lt;span style=&quot;color: red;&quot;&gt;.&lt;/span&gt;MouseEvent&lt;span style=&quot;color: red;&quot;&gt; &lt;/span&gt;evt&lt;span style=&quot;color: red;&quot;&gt;) {//GEN-&lt;/span&gt;FIRST&lt;span style=&quot;color: red;&quot;&gt;:&lt;/span&gt;event&lt;span style=&quot;color: red;&quot;&gt;_jMenu3MouseClicked&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // TODO &lt;/span&gt;add&lt;span style=&quot;color: red;&quot;&gt; &lt;/span&gt;your&lt;span style=&quot;color: red;&quot;&gt; &lt;/span&gt;handling&lt;span style=&quot;color: red;&quot;&gt; &lt;/span&gt;code&lt;span style=&quot;color: red;&quot;&gt; &lt;/span&gt;here&lt;span style=&quot;color: red;&quot;&gt;:&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //extra al darle &lt;/span&gt;click&lt;span style=&quot;color: red;&quot;&gt; cierra toda la &lt;/span&gt;aplicacion&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;this&lt;span style=&quot;color: red;&quot;&gt;.&lt;/span&gt;dispose&lt;span style=&quot;color: red;&quot;&gt;();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }//GEN-&lt;/span&gt;LAST&lt;span style=&quot;color: red;&quot;&gt;:&lt;/span&gt;event&lt;span style=&quot;color: red;&quot;&gt;_jMenu3MouseClicked&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; //&lt;/span&gt;metodo&lt;span style=&quot;color: red;&quot;&gt; &lt;/span&gt;encardago&lt;span style=&quot;color: red;&quot;&gt; de mandar los datos a &lt;/span&gt;arduino&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;&amp;nbsp; &lt;/span&gt;public&lt;span style=&quot;color: red;&quot;&gt; &lt;/span&gt;static&lt;span style=&quot;color: red;&quot;&gt; &lt;/span&gt;synchronized&lt;span style=&quot;color: red;&quot;&gt; &lt;/span&gt;void&lt;span style=&quot;color: red;&quot;&gt; &lt;/span&gt;sendMessage&lt;span style=&quot;color: red;&quot;&gt;(&lt;/span&gt;String&lt;span style=&quot;color: red;&quot;&gt; cadena) {&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; byte[] &lt;/span&gt;asd&lt;span style=&quot;color: red;&quot;&gt;;//&lt;/span&gt;arrglo&lt;span style=&quot;color: red;&quot;&gt; de tipo byte&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;asd&lt;span style=&quot;color: red;&quot;&gt;=cadena.&lt;/span&gt;getBytes&lt;span style=&quot;color: red;&quot;&gt;();//linea que sirve para descomponer un &lt;/span&gt;caracte&lt;span style=&quot;color: red;&quot;&gt; a una forma de bits(&lt;/span&gt;ascii&lt;span style=&quot;color: red;&quot;&gt;)&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;try&lt;span style=&quot;color: red;&quot;&gt; {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;output&lt;span style=&quot;color: red;&quot;&gt;.&lt;/span&gt;write&lt;span style=&quot;color: red;&quot;&gt;(&lt;/span&gt;asd&lt;span style=&quot;color: red;&quot;&gt;);//escribe en el puerto serie lo que se encuentre en el arreglo &lt;/span&gt;bite&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; } &lt;/span&gt;catch&lt;span style=&quot;color: red;&quot;&gt; (&lt;/span&gt;IOException&lt;span style=&quot;color: red;&quot;&gt; &lt;/span&gt;ex&lt;span style=&quot;color: red;&quot;&gt;) {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Logger&lt;span style=&quot;color: red;&quot;&gt;.&lt;/span&gt;getLogger&lt;span style=&quot;color: red;&quot;&gt;(&lt;/span&gt;led&lt;span style=&quot;color: red;&quot;&gt;.&lt;/span&gt;class&lt;span style=&quot;color: red;&quot;&gt;.&lt;/span&gt;getName&lt;span style=&quot;color: red;&quot;&gt;()).&lt;/span&gt;log&lt;span style=&quot;color: red;&quot;&gt;(&lt;/span&gt;Level&lt;span style=&quot;color: red;&quot;&gt;.&lt;/span&gt;SEVERE&lt;span style=&quot;color: red;&quot;&gt;, &lt;/span&gt;null&lt;span style=&quot;color: red;&quot;&gt;, &lt;/span&gt;ex&lt;span style=&quot;color: red;&quot;&gt;);//si no &lt;/span&gt;loga&lt;span style=&quot;color: red;&quot;&gt; enviar la cadena lo intenta de nuevo&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; /**&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; * @&lt;/span&gt;param&lt;span style=&quot;color: red;&quot;&gt; &lt;/span&gt;args&lt;span style=&quot;color: red;&quot;&gt; &lt;/span&gt;the&lt;span style=&quot;color: red;&quot;&gt; &lt;/span&gt;command&lt;span style=&quot;color: red;&quot;&gt; &lt;/span&gt;line&lt;span style=&quot;color: red;&quot;&gt; &lt;/span&gt;arguments&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; */&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;&amp;nbsp; //&lt;/span&gt;metodo&lt;span style=&quot;color: red;&quot;&gt; principal o &lt;/span&gt;main&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;public&lt;span style=&quot;color: red;&quot;&gt; &lt;/span&gt;static&lt;span style=&quot;color: red;&quot;&gt; &lt;/span&gt;void&lt;span style=&quot;color: red;&quot;&gt; &lt;/span&gt;main&lt;span style=&quot;color: red;&quot;&gt;(&lt;/span&gt;String&lt;span style=&quot;color: red;&quot;&gt; &lt;/span&gt;args&lt;span style=&quot;color: red;&quot;&gt;[])&lt;/span&gt;throws&lt;span style=&quot;color: red;&quot;&gt; &lt;/span&gt;Exception&lt;span style=&quot;color: red;&quot;&gt; {&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; java.&lt;/span&gt;awt&lt;span style=&quot;color: red;&quot;&gt;.&lt;/span&gt;EventQueue&lt;span style=&quot;color: red;&quot;&gt;.&lt;/span&gt;invokeLater&lt;span style=&quot;color: red;&quot;&gt;(&lt;/span&gt;new&lt;span style=&quot;color: red;&quot;&gt; &lt;/span&gt;Runnable&lt;span style=&quot;color: red;&quot;&gt;() {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;public&lt;span style=&quot;color: red;&quot;&gt; &lt;/span&gt;void&lt;span style=&quot;color: red;&quot;&gt; &lt;/span&gt;run&lt;span style=&quot;color: red;&quot;&gt;() {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;new&lt;span style=&quot;color: red;&quot;&gt; &lt;/span&gt;led&lt;span style=&quot;color: red;&quot;&gt;().&lt;/span&gt;setVisible&lt;span style=&quot;color: red;&quot;&gt;(&lt;/span&gt;true&lt;span style=&quot;color: red;&quot;&gt;);&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; });&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;MyPrefs&lt;span style=&quot;color: red;&quot;&gt;.&lt;/span&gt;init&lt;span style=&quot;color: red;&quot;&gt;();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;System&lt;span style=&quot;color: red;&quot;&gt;.&lt;/span&gt;out&lt;span style=&quot;color: red;&quot;&gt;.&lt;/span&gt;println&lt;span style=&quot;color: red;&quot;&gt;(&quot;puerto usado: &quot; + &lt;/span&gt;MyPrefs&lt;span style=&quot;color: red;&quot;&gt;.&lt;/span&gt;get&lt;span style=&quot;color: red;&quot;&gt;(&quot;&lt;/span&gt;serial&lt;span style=&quot;color: red;&quot;&gt;.&lt;/span&gt;port&lt;span style=&quot;color: red;&quot;&gt;&quot;));&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;System&lt;span style=&quot;color: red;&quot;&gt;.&lt;/span&gt;out&lt;span style=&quot;color: red;&quot;&gt;.&lt;/span&gt;println&lt;span style=&quot;color: red;&quot;&gt;(&quot;&lt;/span&gt;targeta&lt;span style=&quot;color: red;&quot;&gt; utilizada: &quot; + &lt;/span&gt;MyPrefs&lt;span style=&quot;color: red;&quot;&gt;.&lt;/span&gt;get&lt;span style=&quot;color: red;&quot;&gt;(&quot;&lt;/span&gt;board&lt;span style=&quot;color: red;&quot;&gt;&quot;));&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; /*&lt;/span&gt;CommPortIdentifier&lt;span style=&quot;color: red;&quot;&gt; &lt;/span&gt;portId&lt;span style=&quot;color: red;&quot;&gt; = &lt;/span&gt;CommPortIdentifier&lt;span style=&quot;color: red;&quot;&gt;.&lt;/span&gt;getPortIdentifier&lt;span style=&quot;color: red;&quot;&gt;(&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;MyPrefs&lt;span style=&quot;color: red;&quot;&gt;.&lt;/span&gt;get&lt;span style=&quot;color: red;&quot;&gt;(&quot;&lt;/span&gt;serial&lt;span style=&quot;color: red;&quot;&gt;.&lt;/span&gt;port&lt;span style=&quot;color: red;&quot;&gt;&quot;));*/&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;CommPortIdentifier&lt;span style=&quot;color: red;&quot;&gt; &lt;/span&gt;portId&lt;span style=&quot;color: red;&quot;&gt; = &lt;/span&gt;null&lt;span style=&quot;color: red;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;Enumeration&lt;span style=&quot;color: red;&quot;&gt; &lt;/span&gt;portEnum&lt;span style=&quot;color: red;&quot;&gt; = &lt;/span&gt;CommPortIdentifier&lt;span style=&quot;color: red;&quot;&gt;.&lt;/span&gt;getPortIdentifiers&lt;span style=&quot;color: red;&quot;&gt;();&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; // iteraciones para buscar el puerto&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;while&lt;span style=&quot;color: red;&quot;&gt; (&lt;/span&gt;portEnum&lt;span style=&quot;color: red;&quot;&gt;.&lt;/span&gt;hasMoreElements&lt;span style=&quot;color: red;&quot;&gt;()) {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;CommPortIdentifier&lt;span style=&quot;color: red;&quot;&gt; &lt;/span&gt;currPortId&lt;span style=&quot;color: red;&quot;&gt; = (&lt;/span&gt;CommPortIdentifier&lt;span style=&quot;color: red;&quot;&gt;) &lt;/span&gt;portEnum&lt;span style=&quot;color: red;&quot;&gt;.&lt;/span&gt;nextElement&lt;span style=&quot;color: red;&quot;&gt;();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;for&lt;span style=&quot;color: red;&quot;&gt; (&lt;/span&gt;String&lt;span style=&quot;color: red;&quot;&gt; &lt;/span&gt;portName&lt;span style=&quot;color: red;&quot;&gt;:&lt;/span&gt;PORT&lt;span style=&quot;color: red;&quot;&gt;_&lt;/span&gt;NAMES&lt;span style=&quot;color: red;&quot;&gt;) {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;if&lt;span style=&quot;color: red;&quot;&gt; (&lt;/span&gt;currPortId&lt;span style=&quot;color: red;&quot;&gt;.&lt;/span&gt;getName&lt;span style=&quot;color: red;&quot;&gt;().&lt;/span&gt;equals&lt;span style=&quot;color: red;&quot;&gt;(&lt;/span&gt;portName&lt;span style=&quot;color: red;&quot;&gt;)) {&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;portId&lt;span style=&quot;color: red;&quot;&gt; = &lt;/span&gt;currPortId&lt;span style=&quot;color: red;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;break&lt;span style=&quot;color: red;&quot;&gt;;&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //se crea objeto de la clase&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;led&lt;span style=&quot;color: red;&quot;&gt; m=&lt;/span&gt;new&lt;span style=&quot;color: red;&quot;&gt; &lt;/span&gt;led&lt;span style=&quot;color: red;&quot;&gt;();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; //inicializar&amp;nbsp; &lt;/span&gt;serialport&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;serialport&lt;span style=&quot;color: red;&quot;&gt; = (&lt;/span&gt;SerialPort&lt;span style=&quot;color: red;&quot;&gt;)&lt;/span&gt;portId&lt;span style=&quot;color: red;&quot;&gt;.&lt;/span&gt;open&lt;span style=&quot;color: red;&quot;&gt;(m.&lt;/span&gt;getClass&lt;span style=&quot;color: red;&quot;&gt;().&lt;/span&gt;getName&lt;span style=&quot;color: red;&quot;&gt;(), 9600);&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;output&lt;span style=&quot;color: red;&quot;&gt; = &lt;/span&gt;serialport&lt;span style=&quot;color: red;&quot;&gt;.&lt;/span&gt;getOutputStream&lt;span style=&quot;color: red;&quot;&gt;();&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;serialport&lt;span style=&quot;color: red;&quot;&gt;.&lt;/span&gt;setSerialPortParams&lt;span style=&quot;color: red;&quot;&gt;(&lt;/span&gt;MyPrefs&lt;span style=&quot;color: red;&quot;&gt;.&lt;/span&gt;getInteger&lt;span style=&quot;color: red;&quot;&gt;(&quot;&lt;/span&gt;serial&lt;span style=&quot;color: red;&quot;&gt;.&lt;/span&gt;debug&lt;span style=&quot;color: red;&quot;&gt;_&lt;/span&gt;rate&lt;span style=&quot;color: red;&quot;&gt;&quot;),&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;SerialPort&lt;span style=&quot;color: red;&quot;&gt;.&lt;/span&gt;DATABITS&lt;span style=&quot;color: red;&quot;&gt;_8,&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;SerialPort&lt;span style=&quot;color: red;&quot;&gt;.&lt;/span&gt;STOPBITS&lt;span style=&quot;color: red;&quot;&gt;_1,&lt;/span&gt;&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/span&gt;SerialPort&lt;span style=&quot;color: red;&quot;&gt;.&lt;/span&gt;PARITY&lt;span style=&quot;color: red;&quot;&gt;_&lt;/span&gt;NONE&lt;span style=&quot;color: red;&quot;&gt;);&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;color: red;&quot;&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/span&gt;&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;background-color: #fff2cc; clear: both; color: black; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhptpowV_lvCTjKlXcKpqMG_lkn15Cqn2Se-uJ-9IQNwSxtMEWAbXN8HhiO9sh92Gl32zFPX0Hj8EHEu5eLjmxvh3SqLdF0Bs3Ez6yrjjcKSz_PW5_akb_EV9zDKQQs1IMkb27WF0Gq4Qs/s1600/13.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;br /&gt;
&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: black;&quot;&gt;Listo estos son los métodos principales.&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: black;&quot;&gt;Código completo librerías o lo que necesiten solo manden un correo a vctr.31@hotmail.com y con gusto se los are llegar.&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: black;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: black;&quot;&gt;una ves que tenga el codigo veran lo siguiente.&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;background-color: #fff2cc; clear: both; color: black; text-align: center;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhF0HHAjSk-cCZwdQa4RSY6oecLk_x61gSoKaxyYyqksemfvLq4sq7BXMfsLKmk35b_DAGxCr9UNMEdHJ4yYBEfeaOE9elT9_68OlG05k2Xv4mVaF0MGD8GPhQbiXdHqI1iUkoSli34ROw/s1600/Pantallazo-4.png&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;179&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhF0HHAjSk-cCZwdQa4RSY6oecLk_x61gSoKaxyYyqksemfvLq4sq7BXMfsLKmk35b_DAGxCr9UNMEdHJ4yYBEfeaOE9elT9_68OlG05k2Xv4mVaF0MGD8GPhQbiXdHqI1iUkoSli34ROw/s320/Pantallazo-4.png&quot; width=&quot;320&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: black;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: black;&quot;&gt;(El arduino debe estar conectado con el programa del principio del tutorial)&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: black;&quot;&gt;Y como se puede ver un click en el boton encender y el led lo hara. asi como tambien reaccionara al botón apagado.&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: black;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: black;&quot;&gt;Les dejo un vídeo con el funcionamiento del mismo.&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: black;&quot;&gt;&amp;nbsp; por el momento es todo espero que les guste, muchas gracias.&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: black;&quot;&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: center;&quot;&gt;&lt;object class=&quot;BLOG_video_class&quot; contentid=&quot;FAILED&quot; height=&quot;266&quot; id=&quot;BLOG_video-FAILED-0&quot; width=&quot;320&quot;&gt;&lt;/object&gt;&lt;iframe allowfullscreen=&#39;allowfullscreen&#39; webkitallowfullscreen=&#39;webkitallowfullscreen&#39; mozallowfullscreen=&#39;mozallowfullscreen&#39; width=&#39;320&#39; height=&#39;266&#39; src=&#39;https://www.blogger.com/video.g?token=AD6v5dxzFg6yfsKOmWbR2kkhkNMYEiFPlnoEnm2Jq8NJho8ENW_QiEQqY0PLjMFzVeM1O8eXVZsR8d--qUaOpTenCw&#39; class=&#39;b-hbp-video b-uploaded&#39; frameborder=&#39;0&#39;&gt;&lt;/iframe&gt;&lt;/div&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: black;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: black;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: black;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: black;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: black;&quot;&gt;código completo, librerías , dudas y lo que necesiten a vctr.31@hotmail.com&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: black;&quot;&gt;y comente si quiere algún otro tutorial.&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: black;&quot;&gt;hasta pronto&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: black;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: black;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: black;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: black;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: black;&quot;&gt;&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: black;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: black;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: black;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: black;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: black;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: black;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: black;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: black;&quot;&gt;&lt;object height=&quot;344&quot; width=&quot;425&quot;&gt;&lt;param name=&quot;movie&quot; value=&quot;http://www.youtube.com/v/e17uG8f2Kuk?hl=es&amp;fs=1&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowFullScreen&quot; value=&quot;true&quot;&gt;&lt;/param&gt;&lt;param name=&quot;allowscriptaccess&quot; value=&quot;always&quot;&gt;&lt;/param&gt;&lt;embed src=&quot;http://www.youtube.com/v/e17uG8f2Kuk?hl=es&amp;fs=1&quot; type=&quot;application/x-shockwave-flash&quot; allowscriptaccess=&quot;always&quot; allowfullscreen=&quot;true&quot; width=&quot;425&quot; height=&quot;344&quot;&gt;&lt;/embed&gt;&lt;/object&gt;&lt;/div&gt;&lt;div style=&quot;background-color: #7f6000; color: black;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javaallimite.blogspot.com/feeds/2006878191217261537/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://javaallimite.blogspot.com/2011/04/primer-tutorial-arduino-desde-java.html#comment-form' title='53 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1468652985727080356/posts/default/2006878191217261537'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1468652985727080356/posts/default/2006878191217261537'/><link rel='alternate' type='text/html' href='http://javaallimite.blogspot.com/2011/04/primer-tutorial-arduino-desde-java.html' title='Primer tutorial: Arduino desde Java'/><author><name>victor</name><uri>http://www.blogger.com/profile/14807786148874785693</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEijMKQwQR_irbFbNKuoROYB05XmrRu5VWrUH8EB7coiSv4XAN9PBwkKw5iZO1JIf_dDcY2Pi8mOH-_n5b1vr85jixfI-ad8EtdRAj6ZvfTaZmxa4ntx8hdQ0JKCV590idS8Bn_LNkCZGuQ/s72-c/IMG20110426_002.jpg" height="72" width="72"/><thr:total>53</thr:total></entry><entry><id>tag:blogger.com,1999:blog-1468652985727080356.post-6575913499745713321</id><published>2011-04-25T22:10:00.000-07:00</published><updated>2011-04-25T22:10:51.493-07:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Arduini y java"/><category scheme="http://www.blogger.com/atom/ns#" term="java y arduino"/><category scheme="http://www.blogger.com/atom/ns#" term="puerto serie en java"/><category scheme="http://www.blogger.com/atom/ns#" term="tutorial arduino y java"/><title type='text'>Bienvenidos</title><content type='html'>&lt;div style=&quot;background-color: #fff2cc; color: #660000; text-align: justify;&quot;&gt;Les doy la más cordial de las bienvenidas a este nuevo Blog en el que iremos aprendiendo a manejar java un poco más. Manejo de puertos, Gráficas, MySQL, Enviar y recibir datos de Internet y lo que a ustedes se les ocurra.&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: #660000; text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: #660000; text-align: justify;&quot;&gt;En nuestra primera publicacion aprenderemos a manejar arduino desde Java, encenderemos y apagaremos un Led con una interfaz gráfica de java.&lt;/div&gt;&lt;div style=&quot;background-color: #fff2cc; color: #660000; text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;span style=&quot;background-color: #fff2cc; color: #660000;&quot;&gt;Antes de comenzar este pequeño tutoríal Cabe mencionar que, damos por hecho que tiene Netbeans de ID para Java y que ya tiene Funcionando arduino.&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://javaallimite.blogspot.com/feeds/6575913499745713321/comments/default' title='Enviar comentarios'/><link rel='replies' type='text/html' href='http://javaallimite.blogspot.com/2011/04/bienvenidos.html#comment-form' title='0 comentarios'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/1468652985727080356/posts/default/6575913499745713321'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/1468652985727080356/posts/default/6575913499745713321'/><link rel='alternate' type='text/html' href='http://javaallimite.blogspot.com/2011/04/bienvenidos.html' title='Bienvenidos'/><author><name>victor</name><uri>http://www.blogger.com/profile/14807786148874785693</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry></feed>