tag:blogger.com,1999:blog-55805401216262508402024-03-05T10:07:48.301-03:00TixplicandoUberdam Cavalettihttp://www.blogger.com/profile/14380355077708595931noreply@blogger.comBlogger211125tag:blogger.com,1999:blog-5580540121626250840.post-85878262420724632782020-07-21T23:28:00.000-03:002020-07-21T23:28:08.270-03:00Analisando gastos do Governo Federal utilizando Python<div><br /></div><div class="separator" style="clear: both; text-align: center;"><iframe allowfullscreen="" class="BLOG_video_class" height="266" src="https://www.youtube.com/embed/WhM1NXOyyiw" width="320" youtube-src-id="WhM1NXOyyiw"></iframe></div><div><br /></div><div><br /></div><div style="text-align: center;"><a href="https://github.com/berdamc">Link do Github aqui</a><br /></div>Uberdam Cavalettihttp://www.blogger.com/profile/14380355077708595931noreply@blogger.com0tag:blogger.com,1999:blog-5580540121626250840.post-44470720365380255582020-07-08T16:48:00.001-03:002020-07-10T12:02:20.874-03:00Jogo em Python utilizando a biblioteca Game2dBoard <br />
<div style="text-align: center;">
Segue um jogo desenvolvido em Python utilizando a biblioteca <a href="https://github.com/mjbrusso/game2dboard">Game2DBoard</a><br />
<br />
O jogo consistem em acertar a bolinha com o clique do mouse, a bolinha inicia na parte superior e vai descendo para a parte inferior, cada acerto gera um ponto, um erro e o jogo termina. Cada acerto a bolinha inicia novamente na parte superior, por[em agora com uma velocidade maior.</div>
<div>
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqwckaK_fVTam5DppulP1vJt5SkRLWhjn-c__DzLYAZMABVUHwICw-KEvxiRvVL1fQQnjquFc2_ZrgAndOYqwlSrEnG7HEp1MLRrxYM34NpttKI5D4vsuB4VMPJreV2EJVpc-aPE5y2fTe/s1600/teste.gif" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="360" data-original-width="640" height="180" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqwckaK_fVTam5DppulP1vJt5SkRLWhjn-c__DzLYAZMABVUHwICw-KEvxiRvVL1fQQnjquFc2_ZrgAndOYqwlSrEnG7HEp1MLRrxYM34NpttKI5D4vsuB4VMPJreV2EJVpc-aPE5y2fTe/s320/teste.gif" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div>
<br /></div>
<div>
<div style="text-align: center;">
Biblioteca <a href="https://github.com/mjbrusso/game2dboard">Game2dBoard </a>para jogos simples</div>
<div style="text-align: center;">
<br /></div>
<div style="text-align: center;">
<a href="https://github.com/berdamc/Game2DBoard">Código fonte </a></div>
</div>
<div>
<br /></div>
<div>
<br /></div>
<div>
<br /></div>
Uberdam Cavalettihttp://www.blogger.com/profile/14380355077708595931noreply@blogger.com0tag:blogger.com,1999:blog-5580540121626250840.post-36336112062132378252020-06-19T15:51:00.013-03:002021-05-05T09:03:17.589-03:00Beneficiários do Auxílio Emergencial por Cidade<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQNSiQbwqA8ANrnSliARMeSl4DjF6E4XdN7WvZLScPRNZEUIjs906DXt9IRmGIOeKeDeiJxbWEa6Lmnd1cJUbtiLJPNeKspeEtZlhkQWraaDEH_FoxdKTBn7X14tTGgE78vSVA5OJrcdLz/s284/portal.png" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="190" data-original-width="284" height="133" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQNSiQbwqA8ANrnSliARMeSl4DjF6E4XdN7WvZLScPRNZEUIjs906DXt9IRmGIOeKeDeiJxbWEa6Lmnd1cJUbtiLJPNeKspeEtZlhkQWraaDEH_FoxdKTBn7X14tTGgE78vSVA5OJrcdLz/w227-h152/portal.png" width="200" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div><div class="separator" style="clear: both; text-align: center;"><h2><a href="https://drive.google.com/drive/folders/1AlrTx-iuN3fDEkmH3Fsk-Oayr7CKXyZ_?usp=sharing" target="_blank">Clique aqui - Lista de beneficiários do Auxílio Emergencial - Abril 2020 até Janeiro 2021</a></h2></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div style="text-align: center;"><span style="font-size: x-large;"><br /></span></div><div style="text-align: center;"></div><div style="text-align: center;"></div><div style="text-align: center;"><br />
<br />
<br />
<h3 style="text-align: left;">
<b>Portal da Transparência</b></h3>
<div style="text-align: left;">
<div style="text-align: justify;">
Todos os dados contidos no link acima foram retirados do Portal da Transparência, a contraprova pode ser feita lá.<b> </b></div>
<br />
<h3>
<b>Como denunciar</b> ?</h3>
</div>
<div style="text-align: left;">
<div style="text-align: justify;">
Muitos foram os beneficiários e
também, muitos receberam valores sem necessidade. Se você souber de
algum caso, pode denunciar no Portal da Transparência neste <a href="http://www.portaltransparencia.gov.br/beneficios/auxilio-emergencial?paginacaoSimples=true&tamanhoPagina=&offset=&direcaoOrdenacao=asc&colunasSelecionadas=linkDetalhamento%2Ccpf%2Cnis%2Cbeneficiario%2Cobservacao%2CvalorTotalPeriodo&palavraChave=SILVA&de=01%2F05%2F2020&ate=31%2F05%2F2020&municipio=17199&ordenarPor=beneficiario&direcao=asc" target="_blank">link</a>, basta apenas alterar a <b>Busca Livre</b> por <b>sobrenome </b>e mudar o <b>município e o mês de consulta</b>. A consulta é lenta.<b> </b></div>
<div style="text-align: justify;">
<b><br /></b></div>
<div style="text-align: justify;">
<b><br /></b></div>
<div style="text-align: justify;">
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen="" class="BLOG_video_class" height="266" src="https://www.youtube.com/embed/kF_NewJAlNw" width="320" youtube-src-id="kF_NewJAlNw"></iframe></div>
<b><br /></b></div>
<br />
<h3>
<b>Sobre o portal</b> </h3>
<div style="text-align: justify;">
É de conhecimento de todos que o <a href="http://www.portaltransparencia.gov.br/" target="_blank">Portal da Transparência</a> veio para mostrar onde e como o dinheiro público é gasto. A consulta pública pode ser realizada por qualquer cidadão, porém, como já disse acima, a consulta é lenta, os <a href="http://www.portaltransparencia.gov.br/pagina-interna/603519-download-de-dados-auxilio-emergencial">dados abertos</a> podem ser baixados e acessados diretamente no Portal.<br />
<br />
<h3>
Desenvolvedor </h3>
</div>
</div>
</div>
<div style="text-align: justify;">
Utilizando alguma linguagem de programação, é possível separar as informações por cidade, e isso foi feito utilizando a linguagem Python.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Os dados abertos pode ser obtidos <a href="http://www.portaltransparencia.gov.br/pagina-interna/603519-download-de-dados-auxilio-emergencial" target="_blank">aqui</a> em formato CSV.</div>
<br />
<div style="text-align: center;">
<img class="irc_mi" data-atf="0" height="123" src="https://profdanielbrandao.files.wordpress.com/2019/03/python-site.jpg?w=1200" width="200" /> </div>
<br />
<br />
<div style="text-align: justify;">
Se você quer o código Python para separação por cidades, também pode estar fazendo download <a href="https://github.com/berdamc/AuxilioEmergencial" target="_blank">aqui</a></div>
<br />
<br />Uberdam Cavalettihttp://www.blogger.com/profile/04292374654714665881noreply@blogger.com0tag:blogger.com,1999:blog-5580540121626250840.post-4868620069887558762020-05-19T23:03:00.002-03:002020-06-17T11:13:50.022-03:00Faça você mesmo uma barraca de teto / DiY Roof Tents<br />
<br />
<br />
<div style="text-align: center;">
<img height="300" src="https://i.pinimg.com/originals/29/ec/c2/29ecc2a09201abee0698f43b66f69737.jpg" width="400" /></div>
<div style="text-align: center;">
<br /></div>
<div style="text-align: center;">
<br /></div>
<div style="text-align: center;">
Faça download <a href="https://drive.google.com/drive/folders/1glVxCujLXVv9emu9K7Yc1yfPa34PfaMH?usp=sharing">aqui </a>de um projeto de barraca de teto. </div>
<div style="text-align: center;">
<br /></div>
Uberdam Cavalettihttp://www.blogger.com/profile/14380355077708595931noreply@blogger.com0tag:blogger.com,1999:blog-5580540121626250840.post-57670016992239792142020-05-13T17:26:00.018-03:002020-05-15T15:33:02.426-03:00Maven x Netbeans - Erro de repositório<div>Olá pessoal</div><div><br /></div><div style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKxu4I6VkWDZgxr9aSipwRe6CZ-ZYrjowUj_48_OVZnGjfdpdJK5lxRk1aH9sfbG0nGtc7RB1yyFezNVGXFmzg_Yl9cvlKo8nT1itARm5Ve84LKO1WZTxjWP2qa7Guxc8MZy3FOV5Ndz4A/" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="422" data-original-width="750" height="180" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhKxu4I6VkWDZgxr9aSipwRe6CZ-ZYrjowUj_48_OVZnGjfdpdJK5lxRk1aH9sfbG0nGtc7RB1yyFezNVGXFmzg_Yl9cvlKo8nT1itARm5Ve84LKO1WZTxjWP2qa7Guxc8MZy3FOV5Ndz4A/s320/1+xsrKVt69q3JsZzLD-ldekQ.jpeg" width="281" /></a></div><div><br /></div><div>Há muito tempo venho tentando utilizar Maven nos projetos em Netbeans, e sempre havia um erro na tentativa de download dos arquivos do repositório <a href="http://repo.maven.apache.org/">http://repo.maven.apache.org</a></div><div><br /></div><div><br /></div><div class="separator" style="clear: both; text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8wI1wmkk0XhNi9zH4HU68l3b7uQ2tM4kufv1DptlbByfF9bdgIAXY33Xrcg_ffkbYv2tZKmskeLAjuWNG5PGjgAmL3MrRyX0mO1-GFSMvovO67ZMXG4ANQzjFZihNb2jFdDUMYJ3myUw-/" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="468" data-original-width="750" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj8wI1wmkk0XhNi9zH4HU68l3b7uQ2tM4kufv1DptlbByfF9bdgIAXY33Xrcg_ffkbYv2tZKmskeLAjuWNG5PGjgAmL3MrRyX0mO1-GFSMvovO67ZMXG4ANQzjFZihNb2jFdDUMYJ3myUw-/s320/capa.jpg" width="320" /></a></div><div></div><div><br /></div><div>Por muitas vezes pensei que era erro no sistema operacional, na minha rede, no firewall, no antivírus ou sei lá o que mais.<br /></div><div><br /></div><div>Pois bem, tentei resolver e aqui vai a resposta, pode parecer simples, mas isso é o resultado depois de uma hora de tentativas frustradas.</div><div><br /></div><div><b>Qual a causa.</b></div><div>O repositório central utilizado pelo Maven era <br /></div><div><b><br /></b></div><div><u><i>http://repo.maven.apache.org/</i></u> <b> </b>e parece que a URL mudou para<br /></div><div> <pre><u><i><b>https://repo.maven.apache.org/maven2/</b></i></u></pre><b> </b>(foi adiciona um s no http, camada adicional de segurança SSL/TLS). <br /></div><div><br /></div><div>Abaixo seguem os passos rápidos para realizar essa mudança no Netbeans e ser feliz, ou seja adicionando apenas o repositório com SSL <pre></pre></div><code class="hljs xml"><span class="hljs-tag"></span></code><br /><div><b><br /></b></div><div><b>Passo 1</b></div><div>Acesse este arquivo na sua máquina Windows<br /></div><div><br /></div><div><i><span> </span>C:\Program Files\NetBeans 8.2 RC\java\maven\conf\settings.xml</i></div><div><br /></div><div><b>Passo 2</b></div><div><span> Copie e cole o conteúdo abaixo no arquivo citado no passo 1.</span></div><div><span><br /></span></div><div><span><br /></span></div><div><i><span><?xml version="1.0" encoding="UTF-8"?><settings xmlns="http://maven.apache.org/SETTINGS/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" <br /> xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd"><pluginGroups></pluginGroups><proxies></proxies><servers></servers><mirrors><mirror><id>internal-repository</id><name>Maven Repository Manager running on https://repo1.maven.org/maven2</name><url></span></i><b>https://repo.maven.apache.org/maven2/</b><i><span></url><mirrorOf>*</mirrorOf></mirror></mirrors><profiles></profiles></settings></span></i></div><div><br /><span></span></div><div><b><span>Passo 3</span></b></div><div><span><span> </span>Crie o projeto Maven e visualize as dependências sendo baixadas tranquilamente.<br /></span></div><div style="text-align: left;"><pre><span></span></pre></div>Uberdam Cavalettihttp://www.blogger.com/profile/14380355077708595931noreply@blogger.com0tag:blogger.com,1999:blog-5580540121626250840.post-31345022020134432402020-05-06T12:20:00.002-03:002020-05-06T12:26:03.155-03:00JSON e Arduino<br />
No post de hoje iremos falar sobre interoperabilidade de sistemas. O termo pode parecer estranho, mas grande parte dos serviços da Web funciona neste formato, onde algum sistema envia informações para outro. <b>E aqui vem a pergunta, como enviar informações quando os sistemas são desenvolvidos em linguagens diferentes ??</b><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3RtjmfRELBLkQUpk-O5EwXi7TPygGQK5NF5LouqTntqK9ghyphenhyphenapuc_nNVfyM8fvsVt-FPAjA_Pfr7HhkBqdLhZNL6kJyifRd-EUp-J2dhL1LE5_Z_vQttHLQuYc3W5AjLjrVwJPg2ERUa_/s1600/logo-1200.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="1200" data-original-width="1200" height="320" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj3RtjmfRELBLkQUpk-O5EwXi7TPygGQK5NF5LouqTntqK9ghyphenhyphenapuc_nNVfyM8fvsVt-FPAjA_Pfr7HhkBqdLhZNL6kJyifRd-EUp-J2dhL1LE5_Z_vQttHLQuYc3W5AjLjrVwJPg2ERUa_/s320/logo-1200.jpg" width="320" /></a></div>
<br />
<br />
<br />
<br />
Tempos atrás tínhamos os arquivos XML que eram enviados de um sistema para outro. Exemplo disso é a maneira como os dados de Nota Fiscal Eletrônica ainda são enviados para a Receita Federal.<br />
<b> </b><br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEho1xNVfR2WIS25Z6k6wjzVsygkvhaUHNOujwWvvSaRQGe_8tT4YIPFOIt3uIvs5NqYW0lTAB4Wqis3bXS6aAscshyphenhyphenkZRtiA3pPqxOKog6paZesbTSHEmaCXiIBIzGpbckPxXK1XlPWzu2C/s1600/unnamed.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" data-original-height="344" data-original-width="512" height="215" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEho1xNVfR2WIS25Z6k6wjzVsygkvhaUHNOujwWvvSaRQGe_8tT4YIPFOIt3uIvs5NqYW0lTAB4Wqis3bXS6aAscshyphenhyphenkZRtiA3pPqxOKog6paZesbTSHEmaCXiIBIzGpbckPxXK1XlPWzu2C/s320/unnamed.png" width="320" /> </a></td><td style="text-align: center;"></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Exemplo de NFe enviada a Receita Federal</td><td class="tr-caption" style="text-align: center;"></td><td class="tr-caption" style="text-align: center;"></td><td class="tr-caption" style="text-align: center;"></td><td class="tr-caption" style="text-align: center;"></td><td class="tr-caption" style="text-align: center;"></td><td class="tr-caption" style="text-align: center;"><br /></td><td class="tr-caption" style="text-align: center;"><br /></td><td class="tr-caption" style="text-align: center;"><br /></td><td class="tr-caption" style="text-align: center;"><br /></td><td class="tr-caption" style="text-align: center;"><br /></td></tr>
</tbody></table>
<b> </b><br />
<b> </b>Outro maneira de enviar informações entre sistemas é o formato Json, bastante difundido na maioria das linguagens. A plataforma Arduino não poderia ficar de fora e também tem a biblioteca para realizar o envio e recebimento deste tipo de dados.<br />
<br />
Dentre todas as bibliotecas que testei essa é a melhor <a href="https://arduinojson.org/" target="_blank">Arduinojson</a>. Abra o gerenciador de bibliotecas da IDE Arduino e faça a instalação da última versão. Neste momento a 6.15.1<br />
<br />
<table align="center" cellpadding="0" cellspacing="0" class="tr-caption-container" style="margin-left: auto; margin-right: auto; text-align: center;"><tbody>
<tr><td style="text-align: center;"><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-ancdo98GPNOpH-TJZe3qx8Vd33cnl7NOdXUnxoBdPLcO-YfARBonCTudPPVjxDKkJwl4H7BOlvu4e7dXFrdJtoKbVklVucX8whIYZ-Z-y-gCKUIJJmkswrPSlO3DadrY8EDqZTLYkt95/s1600/imagem.png" imageanchor="1" style="margin-left: auto; margin-right: auto;"><img border="0" data-original-height="713" data-original-width="1266" height="180" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg-ancdo98GPNOpH-TJZe3qx8Vd33cnl7NOdXUnxoBdPLcO-YfARBonCTudPPVjxDKkJwl4H7BOlvu4e7dXFrdJtoKbVklVucX8whIYZ-Z-y-gCKUIJJmkswrPSlO3DadrY8EDqZTLYkt95/s320/imagem.png" width="320" /></a></td></tr>
<tr><td class="tr-caption" style="text-align: center;">Gerenciador de bibliotecas Arduino</td><td class="tr-caption" style="text-align: center;"><br /></td><td class="tr-caption" style="text-align: center;"><br /></td><td class="tr-caption" style="text-align: center;"><br /></td></tr>
</tbody></table>
<br />
<b> </b><br />
<a name='more'></a><b>Serializando dados - Criando o arquivo Json</b><br />
<br />
<b><span style="background-color: #eeeeee; color: #434f54; display: inline; float: none; font-family: , "menlo" , "monaco" , "consolas" , "liberation mono" , "courier new" , monospace; font-size: 14px; font-style: normal; font-weight: 400; letter-spacing: normal; text-align: left; text-indent: 0px; text-transform: none; white-space: pre; word-spacing: 0px;"></span><span class="hljs-function" style="box-sizing: border-box; color: #434f54; font-family: , "menlo" , "monaco" , "consolas" , "liberation mono" , "courier new" , monospace; font-size: 14px; font-style: normal; font-weight: 400; letter-spacing: normal; text-align: left; text-indent: 0px; text-transform: none; white-space: pre; word-spacing: 0px;">#include <ArduinoJson.h><br /><br /><br />void setup() {<br /> Serial.begin(9600);</span></b><br />
<b><span class="hljs-function" style="box-sizing: border-box; color: #434f54; font-family: , "menlo" , "monaco" , "consolas" , "liberation mono" , "courier new" , monospace; font-size: 14px; font-style: normal; font-weight: 400; letter-spacing: normal; text-align: left; text-indent: 0px; text-transform: none; white-space: pre; word-spacing: 0px;">}<br /><br />void loop() {<br /> <br /> DynamicJsonDocument doc(200);<br /><br /> doc["sensor"] = "gps";<br /> doc["time"] = 1351824120;<br /><br /> JsonArray data = doc.createNestedArray("data"); <br /> data.add(48.75608);<br /> data.add(2.302038);<br /><br /> serializeJsonPretty(doc, Serial); //imprime na serial em um formato mais legível<br /> serializeJson(doc, Serial); //imprime no formato contínuo<br /><br />}</span></b><br />
<br />
<br />
<b>DeSerializando dados - Tratando um arquivo Json recebido</b><br />
<span class="hljs-function" style="box-sizing: border-box; color: #434f54; font-family: , "menlo" , "monaco" , "consolas" , "liberation mono" , "courier new" , monospace; font-size: 14px; font-style: normal; letter-spacing: normal; text-align: left; text-indent: 0px; text-transform: none; white-space: pre; word-spacing: 0px;">#include <ArduinoJson.h><br /><br />void setup() {<br /> Serial.begin(9600);<br />}<br /><br />void loop() {<br /> DynamicJsonDocument doc(200);<br /> const char* json = "{\"sensor\":\"gps\",\"time\":1351824120,\"data\":[48.75608,2.302038]}";<br /><br /> deserializeJson(doc, json);<br /><br /> const char* sensor = doc["sensor"]; <br /> long time = doc["time"]; <br /><br /> float data_0 = doc["data"][0]; <br /> float data_1 = doc["data"][1];<br /><br /> Serial.println(sensor);<br /> Serial.println(time);<br /> Serial.println(data_0);<br /> Serial.println(data_1);<br />} </span><span class="hljs-function" style="box-sizing: border-box; color: #434f54; font-family: , "menlo" , "monaco" , "consolas" , "liberation mono" , "courier new" , monospace; font-size: 14px; font-style: normal; letter-spacing: normal; text-align: left; text-indent: 0px; text-transform: none; white-space: pre; word-spacing: 0px;"><br /></span><br />
<br />
<br />
<br />Uberdam Cavalettihttp://www.blogger.com/profile/14380355077708595931noreply@blogger.com0tag:blogger.com,1999:blog-5580540121626250840.post-14695336623748179932020-05-05T14:53:00.004-03:002020-05-05T14:53:42.128-03:00Python, Pandas e Gráfico<i><br /></i>
Segue um pequeno código utilizando <a href="https://www.python.org/" target="_blank">Python </a>com bibliotecas <a href="https://matplotlib.org/" target="_blank">matplolib</a> e <a href="https://pandas.pydata.org/" target="_blank">Pandas </a>1.0.1 (tive problemas usando a versão 1.0.3)<br />
<br />
A ideia apenas é carregar uma matriz de valores(pilotos e qtde de pódios cada um), e assim mostrar um gráfico em barras horizontais. Existe também um filtro para apenas exibir pilotos que possuem pódio maior que zero.<br />
<i><br /></i>
<i><br /></i>
<i><br /></i>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVdEL0BgjN1fz1B3xnzxqrLr_roVFv1FRNsSSw86uwk7qM-QpvS4PMtZlEONmrfEiEpgxoKtYxEqJ1SOALH_dTG5o-ld8FEEzEm1zGz3clbIMsWDmXZ_QDvfTbFuvYmvZ_MMsSj067EzM3/s1600/Gr%25C3%25A1fico.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="595" data-original-width="809" height="235" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgVdEL0BgjN1fz1B3xnzxqrLr_roVFv1FRNsSSw86uwk7qM-QpvS4PMtZlEONmrfEiEpgxoKtYxEqJ1SOALH_dTG5o-ld8FEEzEm1zGz3clbIMsWDmXZ_QDvfTbFuvYmvZ_MMsSj067EzM3/s320/Gr%25C3%25A1fico.png" width="320" /></a></div>
<i><br /></i>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpikVGR22qEQ7Dqi52PyYgtFBg_xlFIoyzHIujcaTwlvTJRQPJEAX4zyu2AOHNazBYhhOx7p7iwHJ9EeYf96LWBDgnVxH75FNcr1T70CrUhF-FmjVrlCncPZ5Sfs4Ossh52P5UTb97bJ4n/s1600/python.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="422" data-original-width="750" height="180" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjpikVGR22qEQ7Dqi52PyYgtFBg_xlFIoyzHIujcaTwlvTJRQPJEAX4zyu2AOHNazBYhhOx7p7iwHJ9EeYf96LWBDgnVxH75FNcr1T70CrUhF-FmjVrlCncPZ5Sfs4Ossh52P5UTb97bJ4n/s320/python.jpg" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<i><br /></i>
<i><br /></i>
<i>import pandas as pd</i><br />
<i>import matplotlib.pyplot as plot</i><br />
<i><br /></i>
<i>data = {</i><br />
<i> "Piloto": ['A.Senna', 'Prost', 'Piquet', 'Mansell', 'Boutsen',</i><br />
<i> 'R.Patrese', 'Berger', 'Aguri Suzuki', 'Éric Bernard', 'Derek Warwick',</i><br />
<i> 'Modena', 'Nicola Larini', 'Jean Alesi', 'Satoru Nakajima', 'Pierluigi Martini',</i><br />
<i> 'Andrea de Cesaris', 'Philippe Alliot', 'Nannini', 'Capelli', 'Emanuele Pirro',</i><br />
<i> 'Michele Alboreto', 'Martin Donnelly', 'Alex Caffi', 'Maurício Gugelmin', 'Olivier Grouillard',</i><br />
<i> 'Paolo Barilla', 'David Brabham', 'Gregor Foitek', 'Moreno', 'Yannick Dalmas',</i><br />
<i> 'Jyrki Järvilehto', 'Tarquini', 'Gianni Morbidelli', 'Johnny Herbert', 'Bernd Schneider'</i><br />
<i> ],</i><br />
<i> "Pódio": [11, 9, 4, 5, 3,</i><br />
<i> 1, 7, 1, 0, 0,</i><br />
<i> 0, 0, 2, 0, 0,</i><br />
<i> 0, 0, 3, 1, 0,</i><br />
<i> 0, 0, 0, 0, 0,</i><br />
<i> 0, 0, 0, 1, 0,</i><br />
<i> 0, 0, 0, 0, 0</i><br />
<i> ]</i><br />
<i>};</i><br />
<i><br /></i>
<i>dataframe = pd.DataFrame(data = data);</i><br />
<i>dataframe1 = dataframe[dataframe['Pódio'] > 0]</i><br />
<i>dataframe1.plot.barh(x = "Piloto", y = "Pódio", rot = 70, title = "Pódios por piloto");</i><br />
<i>plot.show(block = True);</i><br />
<i><br /></i>
<i><br /></i>
<i><br /></i>
<i><br /></i>
<i><br /></i>
<i><br /></i>
<i><br /></i>
<i><br /></i>
<i><br /></i>
<i><br /></i>
<i><br /></i>
<i><br /></i>
<i><br /></i>
<i><br /></i>Uberdam Cavalettihttp://www.blogger.com/profile/04292374654714665881noreply@blogger.com0tag:blogger.com,1999:blog-5580540121626250840.post-51150118585418220612020-02-17T22:20:00.000-03:002020-02-17T22:34:27.692-03:00Viajando para o Atacama/Chile/Argentina<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<b>Frio, calor, chuva, medo, vento, altitude, respiração pesada, vulcão, lago com sal, Pacífico, </b></div>
<div class="separator" style="clear: both; text-align: center;">
<b>tempestade, telescópio, dormir na aduana no meio da cordilheira, comida, moeda e idioma diferentes. Algumas das coisas que pudemos experimentar.</b></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div style="text-align: center;">
<iframe allowfullscreen="" class="YOUTUBE-iframe-video" data-thumbnail-src="https://i.ytimg.com/vi/0B4UqUEj4lo/0.jpg" frameborder="0" height="266" src="https://www.youtube.com/embed/0B4UqUEj4lo?feature=player_embedded" width="320"></iframe></div>
<br />Uberdam Cavalettihttp://www.blogger.com/profile/14380355077708595931noreply@blogger.com0tag:blogger.com,1999:blog-5580540121626250840.post-56608342147828332752019-07-11T22:53:00.001-03:002019-07-11T22:53:56.957-03:00System UI has stopped - How to fix/Como resolver<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /><iframe width="320" height="266" class="YOUTUBE-iframe-video" data-thumbnail-src="https://i.ytimg.com/vi/87bWedT5RoI/0.jpg" src="https://www.youtube.com/embed/87bWedT5RoI?feature=player_embedded" frameborder="0" allowfullscreen></iframe></div>
<br />Uberdam Cavalettihttp://www.blogger.com/profile/14380355077708595931noreply@blogger.com0tag:blogger.com,1999:blog-5580540121626250840.post-63945612355227122182018-11-29T19:56:00.003-02:002018-11-29T21:21:07.829-02:00Jogo em JavaScript<div style="margin-left: 1em; margin-right: 1em;">
</div>
<br />
<b>Jogar em sala de aula ??</b><br />
<div style="text-align: center;">
<b><br /></b></div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhk6iL9lPPfhyphenhyphenJ_JPMC2KW5EkHJI07Equoyzco5WC7XPQcM3Ui0rAFounHzB6ccXVYatm6N3G1yvUhKPRLWaMkO8P8Zn878tkeri0KBemFkcmrHEGA-gK9cnVMD1tlGghDGJOtQqjbV1VoX/s1600/321.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="240" data-original-width="235" height="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhk6iL9lPPfhyphenhyphenJ_JPMC2KW5EkHJI07Equoyzco5WC7XPQcM3Ui0rAFounHzB6ccXVYatm6N3G1yvUhKPRLWaMkO8P8Zn878tkeri0KBemFkcmrHEGA-gK9cnVMD1tlGghDGJOtQqjbV1VoX/s200/321.jpg" width="195" /></a></div>
<br />
<br />
Exatamente, jogar em sala de aula pode ser algo que incomoda muitos professores, e acredite, muitos pedagogos <a href="http://info.geekie.com.br/gamificacao/" target="_blank">dizem </a>que esse é o caminho que pode tornar a aprendizagem mais interessante<br />
<br />
Pensando nisso, na disciplina de Conceitos de Programação (<i>os conceitos eles já viram, vamos para a parte violenta</i>)
, decidi implantar o desenvolvimento de um jogo em JavaScript. O jogo
em si vai ser o mesmo para todos, um objeto pulando ao clique do mouse,
parecido com o jogo do Chrome,<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://cache.olhardigital.com.br/uploads/acervo_imagens/2018/09/20180904104428_660_420.jpg" style="margin-left: 1em; margin-right: 1em;"><img alt="Resultado de imagem para dinossauro chrome" border="0" class="irc_mi" height="203" src="https://cache.olhardigital.com.br/uploads/acervo_imagens/2018/09/20180904104428_660_420.jpg" style="margin-top: 37px;" width="320" /></a></div>
porém,
os alunos podem editar o background, mudar a figura dos personagens,
adicionar os sons que cada um gosta, entre outras coisas.<br />
<br />
Pensando
nisso, decidi encontrar algo pronto para não perder. Pesquisando na
internet, apostei nas aulas do Youtube, de um rapaz chamado Filipe
Alves, ele possui um <a href="https://www.youtube.com/watch?v=z3r8up9cz3w&t=0s" target="_blank">canal</a>
onde você pode acompanhar esse jogo e outros vídeos sobre computação.
Os vídeos são muito bem aplicados e prendem a atenção dos
alunos,realmente recomendo.<br />
<br />
Chega de lenga lenga e vamos aos códigos, abaixo você pode ver a tela inicial do jogo<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6_92chJioz8SGkhdUIDVZqi4o_Stn8UL6jOsaFaJ7RgiUmnaTr1i3-11qL8owuQzksdSa1003Dkdb_9g056vBlwOqjnuTxkeqJa6RI89Wq4OxJOJGe-e5Li0vJAdiiQgJzmFGCUMxT3cU/s1600/1324.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="567" data-original-width="597" height="302" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg6_92chJioz8SGkhdUIDVZqi4o_Stn8UL6jOsaFaJ7RgiUmnaTr1i3-11qL8owuQzksdSa1003Dkdb_9g056vBlwOqjnuTxkeqJa6RI89Wq4OxJOJGe-e5Li0vJAdiiQgJzmFGCUMxT3cU/s320/1324.png" width="320" /></a></div>
<br />
<br />
<br />
Pra quem desejar você pode realizar o download dos arquivos de código fonte <a href="https://drive.google.com/file/d/1Ieju5UjEES48lzpkIiBPDCZgEo5b7C5b/view?usp=sharing" target="_blank">aqui </a>e sair jogando.<br />
<br />
<br />
<br />
Abraços e até maisUberdam Cavalettihttp://www.blogger.com/profile/04292374654714665881noreply@blogger.com0tag:blogger.com,1999:blog-5580540121626250840.post-32087808848806372932018-11-19T15:14:00.000-02:002020-04-24T14:16:44.519-03:00Protótipo de Urna Eletrônica desenvolvida em Java<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="about:invalid#zClosurez" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"></a><a href="https://www.blogger.com/blogger.g?blogID=5580540121626250840" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"></a><a href="about:invalid#zClosurez" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"></a><a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhnWKaUTjVYx-uRpwFiEnnX6c1eLPZjaWJXNy_RZTqC0vu5epvFVRnN2jNdvp5I6P5z5sIHAchyphenhyphenWUWmhnRw3bSeVEuXtVIviTL8YSLroVGvUOExrUCihkttS6ZDLSdbAdfbANqZ_lNHrVOI/s1600/download.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="768" data-original-width="1366" height="179" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhnWKaUTjVYx-uRpwFiEnnX6c1eLPZjaWJXNy_RZTqC0vu5epvFVRnN2jNdvp5I6P5z5sIHAchyphenhyphenWUWmhnRw3bSeVEuXtVIviTL8YSLroVGvUOExrUCihkttS6ZDLSdbAdfbANqZ_lNHrVOI/s320/download.png" width="320" /></a></div>
<br />
<div style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;">
</div>
<br />
Graças a Deus, caro eleitor, a eleição desse ano acabou. Muitos foram os boatos por fraudes nas urnas brasileiras, mas acredito que todo o processo desenvolvimento do software e da urna é auditado tanto pelo governo federal e também pelo partidos políticos. Mas não vamos falar mais disso.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
Todo ano na instituição que trabalho, os alunos devem desenvolver projetos voltados para as disciplinas que os mesmos aprendem. Várias foram as disciplinas estudadas, Bancos de dados, Programação, HTML e CSS, entre outras.<br />
<br />
<br />
<a name='more'></a><br />
<br />
<b>Evolua aprendendo Java Web com <a href="https://go.hotmart.com/G22567196W?dp=1" target="_blank">este curso. </a></b><br />
<br />
<br />
Nesse ano decidimos desenvolver um protótipo em Java de urna eletrônica, pode parecer simples, mas vários conceitos foram aplicados aqui desde a escolha das imagens, a programação dos botões, o design da tela, voto branco e voto nulo. Para quem quiser<a href="https://drive.google.com/file/d/1lJpjQHovBk-x7WX3qqhV23vQSQZWak4k/view?usp=sharing" target="_blank"><b> aqui pode ser feito o download do projeto</b></a>.<br />
<br />
O projeto contou com o auxílio dos alunos<br />
<br />
<b>Mateus Zanella</b><br />
<b>Flávio Trombetta </b><br />
<b>Matheus Kozelski</b><br />
<b>Marina Grosbelli</b><br />
<br />
Mais uma coisa, o projeto foi desenvolvido em Netbeans, portanto, baixe, descompacte e abra-o. <br />
<br />
<br />
Um abraço e até mais <br />
<br />Uberdam Cavalettihttp://www.blogger.com/profile/04292374654714665881noreply@blogger.com0tag:blogger.com,1999:blog-5580540121626250840.post-31957430866625898312018-08-28T11:21:00.005-03:002018-08-28T11:21:56.107-03:00Instalando Python no Netbeans 8.2<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiN5wk-APae9v6M6zx7zN9ilFGLfPzIOt-3D94fY-zTO5m3zKmKsYZYy4N6_Dm58torD050tueyre3kft-Ak6fEO0AlDqRXJRyyvMe2zhYsuk_hB1TQZhap9PchRLDlCQerBvAgx0rQwvFe/s1600/opengraph-icon-200x200.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="200" data-original-width="200" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiN5wk-APae9v6M6zx7zN9ilFGLfPzIOt-3D94fY-zTO5m3zKmKsYZYy4N6_Dm58torD050tueyre3kft-Ak6fEO0AlDqRXJRyyvMe2zhYsuk_hB1TQZhap9PchRLDlCQerBvAgx0rQwvFe/s1600/opengraph-icon-200x200.png" /></a></div>
<br />
<br />
<br />
<br />
Para você que assim como eu precisa desenvolver alguns exemplos utilizando Python 3.7.0 e Netbeans 8.2 , segue a instalação.<br />
<br />
Primeiramente baixe a versão Python 3.7.0 para sua arquitetura de processador, nesse <a href="https://www.python.org/downloads/windows/" target="_blank">link </a><br />
<br />
<br />
Após o download realize a instalação, na sequência, instale a versão 8.1 do plugin Python para o Netbeans <a href="http://plugins.netbeans.org/plugin/61688/python" target="_blank">aqui </a><br />
<a name='more'></a><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVuEhmOhg-kFcLbR3gNMbt__8Zgs2UXn-h2em0zRcglRpk4PEef6-8AHAB45kdJqE_xS-3GZIR6RQBEsn3c8uFInxAYIEXA1OvjE7_zfKuFYdMkcVdhWbCxHyaWCKL7Z-idegDsHSPOYnh/s1600/capa.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="468" data-original-width="750" height="199" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhVuEhmOhg-kFcLbR3gNMbt__8Zgs2UXn-h2em0zRcglRpk4PEef6-8AHAB45kdJqE_xS-3GZIR6RQBEsn3c8uFInxAYIEXA1OvjE7_zfKuFYdMkcVdhWbCxHyaWCKL7Z-idegDsHSPOYnh/s320/capa.jpg" width="320" /></a></div>
<br />
Descompacte o arquivo ZIP que você fez o download, abra o Netbeans e vá em Ferramentas, Plugins, Obtidos por Download, encontre a pasta, e adicione todos os arquivos com extensão .nbm.<br />
<br />
Feito isso, reinicie o Netbeans, crie um novo projeto Python e escolha a opção abaixo.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5y4gJrJiaXjdcPtNHP2IHSHbBpGhRg3rBcmrpnSN06Oh7yzwWFxNpsm16PM4YTQbVedWadyC0KE1IWKkZhZXWqRcmsPkovK3gRMhGeZcSqNLKZkWnLw-gI7W0d0MfGw1w4yYE_KgC253a/s1600/dfdf.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="507" data-original-width="730" height="222" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5y4gJrJiaXjdcPtNHP2IHSHbBpGhRg3rBcmrpnSN06Oh7yzwWFxNpsm16PM4YTQbVedWadyC0KE1IWKkZhZXWqRcmsPkovK3gRMhGeZcSqNLKZkWnLw-gI7W0d0MfGw1w4yYE_KgC253a/s320/dfdf.png" width="320" /></a></div>
<br />
<br />
<br />
<br />
<br />
O Netbeans já vai criar um projeto de exemplo, execute-o e verifique se no prompt apareceu a mensagem "Hello World".<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj14H04JXiSJnwR7F5TdAoMCpLm8FNADhhI_NFcL2ckvrlEucYQulcOBmrcDsoEVYohrjOLG1t5k78ll7L9cewPjrkEXr1JMz4nLqFTZrtx3-yJ0pnmOY4vzitfP8IRQYlYtq8WSzpe8y5I/s1600/opengraph-icon-200x200.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="597" data-original-width="1103" height="173" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj14H04JXiSJnwR7F5TdAoMCpLm8FNADhhI_NFcL2ckvrlEucYQulcOBmrcDsoEVYohrjOLG1t5k78ll7L9cewPjrkEXr1JMz4nLqFTZrtx3-yJ0pnmOY4vzitfP8IRQYlYtq8WSzpe8y5I/s320/opengraph-icon-200x200.png" width="320" /></a></div>
<br />
<br />
Parabéns, Netbeans e Python funcionando perfeitamente<br />
<br />
<br />
Uberdam Cavalettihttp://www.blogger.com/profile/14380355077708595931noreply@blogger.com0tag:blogger.com,1999:blog-5580540121626250840.post-90717434418703737272018-08-20T10:11:00.001-03:002018-08-20T10:12:32.954-03:00TCC sobre Automação Industrial com redes AS-I<br />
<div style="text-align: center;">
Segue TCC sobre Automação envolvendo redes AS-I, CLP e controle via celular ou PC.</div>
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgM0uMCFW1q3sI1bKRoBlfMRoZY0WXOWRtR75RtN05Vb6HLnpcNiRQE6Fve3zA00fLQxWxJzZcDMr4ZbS9_NvuIhyphenhyphen1kQO2CfD5U_XBKdZ_y01xUevg_tD8SfmbFXjeftG49pWgGIybCdlBC/s1600/automacao-industrial-custo-fabrica-1080x620.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="620" data-original-width="1080" height="183" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgM0uMCFW1q3sI1bKRoBlfMRoZY0WXOWRtR75RtN05Vb6HLnpcNiRQE6Fve3zA00fLQxWxJzZcDMr4ZbS9_NvuIhyphenhyphen1kQO2CfD5U_XBKdZ_y01xUevg_tD8SfmbFXjeftG49pWgGIybCdlBC/s320/automacao-industrial-custo-fabrica-1080x620.jpg" width="320" /></a></div>
<br />
Autores : Marcelo Cenci e Uberdam Cavaletti<br />
<br />
Link para download <a href="https://drive.google.com/file/d/1Jc8i9-tPKLdSCW9mC_7wQU728gGjCSE2/view?usp=sharing" target="_blank">aqui</a>Uberdam Cavalettihttp://www.blogger.com/profile/14380355077708595931noreply@blogger.com0tag:blogger.com,1999:blog-5580540121626250840.post-18961973532511595722017-11-21T09:37:00.001-02:002017-11-21T14:04:33.996-02:00Partituras Gaúchas e Sertanejas<br />
<br />
<div style="text-align: center;">
<b>Segue aí pessoal, várias partituras de músicas gaúchas e sertanejas.</b></div>
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWAjBfXPMp_haza2IOM0jdN6nX3Rn4rCfRiWnia8xoT980RkaZ6EENRTIBrH2iaNi8Z0MRIM6OFo5qORe9gnqZPEbsq8FGAu1exTX-h06R1m8YO7mJ2KtG0aXC_q9VfU9mFPPtXyIicks8/s1600/Accordeon_100.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="768" data-original-width="1024" height="240" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWAjBfXPMp_haza2IOM0jdN6nX3Rn4rCfRiWnia8xoT980RkaZ6EENRTIBrH2iaNi8Z0MRIM6OFo5qORe9gnqZPEbsq8FGAu1exTX-h06R1m8YO7mJ2KtG0aXC_q9VfU9mFPPtXyIicks8/s320/Accordeon_100.jpg" width="320" /></a></div>
<br />
<br />
Acesse o <a href="https://drive.google.com/drive/folders/14zjWo-nA4sI4egDDKxE0TgRwr4kkmiKp?usp=sharing" target="_blank">Google Drive</a>Uberdam Cavalettihttp://www.blogger.com/profile/14380355077708595931noreply@blogger.com1tag:blogger.com,1999:blog-5580540121626250840.post-10424915975583504112017-10-09T11:22:00.000-03:002020-04-26T00:13:21.942-03:00Painel de Carro e Arduíno<br />
<div style="text-align: center;">
<b>Painel de Carro e Arduíno</b></div>
<div style="text-align: center;">
<br /></div>
<div style="text-align: left;">
<br /></div>
<div style="text-align: left;">
<b> </b></div>
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen="" class="YOUTUBE-iframe-video" data-thumbnail-src="https://i.ytimg.com/vi/iA9L2YFDnwE/0.jpg" frameborder="0" height="266" src="https://www.youtube.com/embed/iA9L2YFDnwE?feature=player_embedded" width="320"></iframe></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
Desenvolvimento de painel analisando dados emitidos pelo jogo Live for Speed. <span style="text-align: center;">O jogo envia dados via pacotes UDP, foi utilizada biblioteca que recebe os dados do game via pacotes UDP. Arduino recebe esses dados, realiza funções ou tratamento e transfere para o painel. </span></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
O painel conta com marcador de combustível, indicador de marchas, ponto de troca de marcha, velocidade, RPM. Foram utilizados leds, servo motores, placa de rede ethernet, bibliotecas de tramamento de dados.</div>
<div style="text-align: left;">
<b> </b></div>
Uberdam Cavalettihttp://www.blogger.com/profile/04292374654714665881noreply@blogger.com2tag:blogger.com,1999:blog-5580540121626250840.post-70053822438752180312017-05-31T23:42:00.002-03:002018-08-20T23:56:37.307-03:00Codificando Batalha Naval em VisualG<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDeAnxQibyHQ854JY0UcAd_OR-Nz8R7wOn8RRl6rK7W0hPFTjH-RA7gH7XdIkIrJ68VjQo41l9vG68Jeczqw9VL2rltb_Ys5_ZtrYiFgxKbBD8C9fm4JLL40_PJK3EqL97lt8_GCt_l8Oe/s1600/images.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" data-original-height="194" data-original-width="259" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiDeAnxQibyHQ854JY0UcAd_OR-Nz8R7wOn8RRl6rK7W0hPFTjH-RA7gH7XdIkIrJ68VjQo41l9vG68Jeczqw9VL2rltb_Ys5_ZtrYiFgxKbBD8C9fm4JLL40_PJK3EqL97lt8_GCt_l8Oe/s1600/images.jpg" /></a></div>
<br />
<br />
<br />
<br />
<pre style="background: #ffffff; color: black;">Algoritmo<span style="color: #0000e6;"> "BatalhaNaval"</span>
<span style="color: #074726;">Var</span>
MinhaMatriz: Vetor<span style="color: dimgrey;">[1..10,1..10]</span> de Caracter
coluna,linha,navio,boia,lancha,JogadaLinha,JogadaColuna,submarino:inteiro;
TerminarJogo:Logico;
procedimento LimparMatriz
inicio
PARA linha DE <span style="color: #008c00;">1</span> ATÉ <span style="color: #008c00;">10</span> FAÇA
PARA coluna DE <span style="color: #008c00;">1</span> ATÉ <span style="color: #008c00;">10</span> FAÇA
MinhaMatriz<span style="color: dimgrey;">[linha,coluna]</span> :<span style="color: #074726;">=</span><span style="color: #0000e6;"> "A"</span>
FIMPARA
FIMPARA
fimprocedimento<a name='more'></a>
Inicio
escreval(<span style="color: #0000e6;">"+++++++++ Batalha Naval ++++++++++"</span>)
LimparMatriz
escreval(<span style="color: #0000e6;">"+++++++++ Gerando navios, boias, submarinos, lanchas ++++++++++"</span>)
PARA navio DE <span style="color: #008c00;">1</span> ATÉ <span style="color: #008c00;">4</span> FAÇA
linha :<span style="color: #074726;">=</span> randi(<span style="color: #008c00;">10</span>)
coluna :<span style="color: #074726;">=</span> randi(<span style="color: #008c00;">10</span>)
se linha <span style="color: #074726;">=</span> <span style="color: #008c00;">0</span> entao
linha:<span style="color: #074726;">=</span> linha + <span style="color: #008c00;">1</span>
fimse
se coluna <span style="color: #074726;">=</span> <span style="color: #008c00;">0</span> entao
coluna:<span style="color: #074726;">=</span> coluna + <span style="color: #008c00;">1</span>
fimse
MinhaMatriz<span style="color: dimgrey;">[linha,coluna]</span>:<span style="color: #074726;">=</span><span style="color: #0000e6;">"N"</span>
FIMPARA
PARA boia DE <span style="color: #008c00;">1</span> ATÉ <span style="color: #008c00;">4</span> FAÇA
linha :<span style="color: #074726;">=</span> randi(<span style="color: #008c00;">10</span>)
coluna :<span style="color: #074726;">=</span> randi(<span style="color: #008c00;">10</span>)
se linha <span style="color: #074726;">=</span> <span style="color: #008c00;">0</span> entao
linha:<span style="color: #074726;">=</span> linha + <span style="color: #008c00;">1</span>
fimse
se coluna <span style="color: #074726;">=</span> <span style="color: #008c00;">0</span> entao
coluna:<span style="color: #074726;">=</span> coluna + <span style="color: #008c00;">1</span>
fimse
MinhaMatriz<span style="color: dimgrey;">[linha,coluna]</span>:<span style="color: #074726;">=</span><span style="color: #0000e6;">"B"</span>
FIMPARA
PARA submarino DE <span style="color: #008c00;">1</span> ATÉ <span style="color: #008c00;">2</span> FAÇA
linha :<span style="color: #074726;">=</span> randi(<span style="color: #008c00;">10</span>)
coluna :<span style="color: #074726;">=</span> randi(<span style="color: #008c00;">10</span>)
se linha <span style="color: #074726;">=</span> <span style="color: #008c00;">0</span> entao
linha:<span style="color: #074726;">=</span> linha + <span style="color: #008c00;">1</span>
fimse
se coluna <span style="color: #074726;">=</span> <span style="color: #008c00;">0</span> entao
coluna:<span style="color: #074726;">=</span> coluna + <span style="color: #008c00;">1</span>
fimse
MinhaMatriz<span style="color: dimgrey;">[linha,coluna]</span>:<span style="color: #074726;">=</span><span style="color: #0000e6;">"S"</span>
FIMPARA
PARA lancha DE <span style="color: #008c00;">1</span> ATÉ <span style="color: #008c00;">2</span> FAÇA
linha :<span style="color: #074726;">=</span> randi(<span style="color: #008c00;">10</span>)
coluna :<span style="color: #074726;">=</span> randi(<span style="color: #008c00;">10</span>)
se linha <span style="color: #074726;">=</span> <span style="color: #008c00;">0</span> entao
linha:<span style="color: #074726;">=</span> linha + <span style="color: #008c00;">1</span>
fimse
se coluna <span style="color: #074726;">=</span> <span style="color: #008c00;">0</span> entao
coluna:<span style="color: #074726;">=</span> coluna + <span style="color: #008c00;">1</span>
fimse
MinhaMatriz<span style="color: dimgrey;">[linha,coluna]</span>:<span style="color: #074726;">=</span><span style="color: #0000e6;">"L"</span>
FIMPARA
LimpaTela
escreval(<span style="color: #0000e6;">"+++++++++ Iniciando o jogo ++++++++++"</span>)
TerminarJogo:=falso;
Enquanto nao(TerminarJogo) FAÇA
escreval(<span style="color: #0000e6;">"+++++++++ Digite o valor de uma linha (1-10) ++++++++++"</span>)
Leia(JogadaLinha)
escreval(<span style="color: #0000e6;">"+++++++++ Digite o valor de uma coluna (1-10) ++++++++++"</span>)
Leia(JogadaColuna)
se ((JogadaLinha <span style="color: #074726;">=</span> <span style="color: #008c00;">0</span>) E (JogadaColuna <span style="color: #074726;">=</span> <span style="color: #008c00;">0</span>)) entao
TerminarJogo:<span style="color: #074726;">=</span> verdadeiro;
senao
SE ((JogadaLinha <span style="color: #074726;">></span><span style="color: #074726;">=</span> <span style="color: #008c00;">1</span>) E (JogadaLinha <span style="color: #074726;"><</span>=<span style="color: #008c00;">10</span>) E (JogadaColuna <span style="color: #074726;">></span><span style="color: #074726;">=</span> <span style="color: #008c00;">1</span>) E (JogadaColuna <span style="color: #074726;"><</span>=<span style="color: #008c00;">10</span>)) ENTAO
SE MinhaMatriz<span style="color: dimgrey;">[JogadaLinha,JogadaColuna]</span> <span style="color: #074726;">=</span><span style="color: #0000e6;"> "A"</span> entao
escreval(<span style="color: #0000e6;">"+++++++++ Splash ++++++++++"</span>)
fimse
se MinhaMatriz<span style="color: dimgrey;">[JogadaLinha,JogadaColuna]</span> <span style="color: #074726;">=</span><span style="color: #0000e6;"> "N"</span> entao
escreval(<span style="color: #0000e6;">"+++++++++ Navio ++++++++++"</span>)
fimse
se MinhaMatriz<span style="color: dimgrey;">[JogadaLinha,JogadaColuna]</span> <span style="color: #074726;">=</span><span style="color: #0000e6;"> "B"</span> entao
escreval(<span style="color: #0000e6;">"+++++++++ Boia ++++++++++"</span>)
fimse
se MinhaMatriz<span style="color: dimgrey;">[JogadaLinha,JogadaColuna]</span> <span style="color: #074726;">=</span><span style="color: #0000e6;"> "L"</span> entao
escreval(<span style="color: #0000e6;">"+++++++++ Lancha ++++++++++"</span>)
fimse
se MinhaMatriz<span style="color: dimgrey;">[JogadaLinha,JogadaColuna]</span> <span style="color: #074726;">=</span><span style="color: #0000e6;"> "S"</span> entao
escreval(<span style="color: #0000e6;">"+++++++++ Submarino ++++++++++"</span>)
fimse
MinhaMatriz<span style="color: dimgrey;">[JogadaLinha,JogadaColuna]</span>:<span style="color: #074726;">=</span><span style="color: #0000e6;"> "J"</span>
fimse
fimse
FimEnquanto
Fimalgoritmo
</pre>
<br />
<br />
<br />Uberdam Cavalettihttp://www.blogger.com/profile/04292374654714665881noreply@blogger.com1tag:blogger.com,1999:blog-5580540121626250840.post-62030420530940788922017-02-02T11:18:00.001-02:002017-02-02T11:21:36.215-02:00Codificando 2048 para Android<br />
<br />
<div style="text-align: center;">
</div>
<div style="text-align: center;">
</div>
<div style="text-align: center;">
<img alt="https://upload.wikimedia.org/wikipedia/commons/6/64/2048_Screenshot.png" height="320" src="https://upload.wikimedia.org/wikipedia/commons/6/64/2048_Screenshot.png" width="319" /> </div>
<div style="text-align: center;">
<br /></div>
<div style="text-align: justify;">
Bom dia pessoal. Lá por volta de 2014 um estudante de computação da Itália (Gabriele Cirulli), desenvolveu este jogo, 2048. O objetivo do jogo é chegar ao valor de 2048 em um desses quadros coloridos.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Este game ficou muito conhecido e jogá-lo é viciante. A codificação do mesmo é simples e você pode obter mais informações do jogo <a href="https://gabrielecirulli.github.io/2048/" target="_blank">aqui</a> e sobre o autor <a href="https://twitter.com/gabrielecirulli" target="_blank">aqui</a>.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Até aquele momento em 2014, não se tinha um versão para Android, IOS, atualmente existem muitas. Naquela oportunidade desenvolvi quase que por completo a codificação para Android, mas não tive mais tempo de tocar o código fonte adiante.</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Irei compartilhar esse fontes aqui e agora para quem quiser. O projeto foi codificado no Eclipse</div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Link dos fontes <a href="https://www.4shared.com/rar/2jbX4HXHce/2048Meu.html" target="_blank">aqui</a></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
Curta o blog Tixplicando no Facebook clicando <a href="https://www.facebook.com/tixplicando/" target="_blank">aqui </a></div>
<div style="text-align: justify;">
<br /></div>
<div style="text-align: justify;">
<br /></div>
Uberdam Cavalettihttp://www.blogger.com/profile/14380355077708595931noreply@blogger.com0tag:blogger.com,1999:blog-5580540121626250840.post-50212247830096261572016-10-18T19:00:00.000-02:002016-10-18T19:00:35.294-02:00Quantas pessoas com seu nome existem no Brasil ??<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiido3nh9JH43mF4PBq2_PNl0MXlDgT4uj56NRRHhojr1TkS7wXSzuCDI-oMRBW8PU_8YhZMRoceW19CI662zEn5QjqAO9-0bTk2ZlTQUpZKM7C-E-Ldr0_-4M_LsN9aR-O2Fvwwnz3vnK_/s1600/nomes.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="290" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiido3nh9JH43mF4PBq2_PNl0MXlDgT4uj56NRRHhojr1TkS7wXSzuCDI-oMRBW8PU_8YhZMRoceW19CI662zEn5QjqAO9-0bTk2ZlTQUpZKM7C-E-Ldr0_-4M_LsN9aR-O2Fvwwnz3vnK_/s400/nomes.jpg" width="400" /></a></div>
<br />
<br />
Isso mesmo. Você já se perguntou quantos nomes iguais ao seu existem no Brasil, Estado ou seu Município ?<br />
<br />
O IBGE com base nessas informações lançou a um tempo atrás esse <a href="http://censo2010.ibge.gov.br/nomes" target="_blank">site </a>onde você pode pesquisar a frequência com que seu nome é utilizado no país, estado ou município,ranking do nome e além disso oferece um gráfico mostrando em que década seu nome foi mais utilizado.<br />
<br />
Abaixo podemos ver o gráfico do jogador Romário, que teve um crescimento elevado na década de 90 pelo fato do mesmo estar em evidência.<br />
<br />
Aproveite e diverta-se <br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiuyCfVP-hN8ON3eey6PIVJEZLwzy_bw0QXdTJySBkW3-FLf64SLsGHC2RxtEKjxBZVO15IMrbtX0do6hikj_g_4VA2zWENpcI6bD_qbHSDVkGTpeOTZ-MzOKErXNcFW10F6ohY-Sx_U_OL/s1600/gr%25C3%25A1fico.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="246" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiuyCfVP-hN8ON3eey6PIVJEZLwzy_bw0QXdTJySBkW3-FLf64SLsGHC2RxtEKjxBZVO15IMrbtX0do6hikj_g_4VA2zWENpcI6bD_qbHSDVkGTpeOTZ-MzOKErXNcFW10F6ohY-Sx_U_OL/s400/gr%25C3%25A1fico.png" width="400" /></a></div>
<br />
<br />
<br />Uberdam Cavalettihttp://www.blogger.com/profile/04292374654714665881noreply@blogger.com0tag:blogger.com,1999:blog-5580540121626250840.post-36351000239525098092016-10-05T10:29:00.003-03:002020-02-25T19:56:49.570-03:00Automação Residencial<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixaUgYgUiP67dYK5Hv1nNqbcReytlVz9DFl0MwBat8JjAoef3UqEl-CXDlEcIhCB9v0e0xkxjGj2sg3Rqb9LamfjngXkwD48CFrtKWLURW0HOwAI5tj5Y545P_l0Bjj_iQnYTarD2QcPnA/s1600/jetsons.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="180" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEixaUgYgUiP67dYK5Hv1nNqbcReytlVz9DFl0MwBat8JjAoef3UqEl-CXDlEcIhCB9v0e0xkxjGj2sg3Rqb9LamfjngXkwD48CFrtKWLURW0HOwAI5tj5Y545P_l0Bjj_iQnYTarD2QcPnA/s320/jetsons.jpg" width="320" /></a></div>
<br />
<br />
Não caro leitor, por incrível que pareça o título desse post e a imagem acima tem tudo a ver. Você que tem menos que 25 provavelmente não vai lembrar desse desenho animado que retratava uma família futurística cercada de invenções tecnológicas.<br />
<br />
Segue um vídeo<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen="" class="YOUTUBE-iframe-video" data-thumbnail-src="https://i.ytimg.com/vi/e8SC6bny1SA/0.jpg" frameborder="0" height="266" src="https://www.youtube.com/embed/e8SC6bny1SA?feature=player_embedded" width="320"></iframe></div>
<br />
É claro que muitas dessas tecnologias poderão nem existir, mas muitas delas podem ser facilmente criadas hoje utilizando programação, placas eletrônicas (Arduíno, Raspberry, Rumba). interfaces, (HTML, Android), componentes eletrônicos e elétricos.<br />
<br />
Pois vem vamos lá, irei demonstrar aqui um dos projetos que foi desenvolvido no Mundo Senai Xanxerê, evento este que tem como finalidade demonstrar aos alunos oque se pode fazer com as mais variadas áreas do conhecimento.<br />
<br />
<br />
<b>A ideia</b><br />
<br />
A ideia era automatizar uma sala de aula, iluminação, ventiladores, cortina, som.<br />
<br />
<b>Componentes utilizados</b><br />
<br />
Arduino Mega<br />
Relés<br />
<b></b><br />
<b>Como controlar a sala</b><br />
Decidimos montar uma aplicação utilizando HTML, JavaScript e AJAX, dessa maneira se vários celulares ou tablets estivessem conectados, todos iriam receber o estado da iluminação,som (ligado, desligado), cortinas (abertas,fechadas),<br />
<br />
<br />
<b>A página do usuário </b><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjOE7ZEU9m7mvtTNAu_jmFEy8-57J1W_YSWYlBoQn7V6-6FiX1MkvhuSVc64J2l6tkLt1l1KJvKXKGbhddv5gQffvJRO4XWZkjRd-GVhS7UejkwSf2pH-Jb8tWfcohtVYG4Glnf6c2o6MDH/s1600/Automacao+Residencial.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="255" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjOE7ZEU9m7mvtTNAu_jmFEy8-57J1W_YSWYlBoQn7V6-6FiX1MkvhuSVc64J2l6tkLt1l1KJvKXKGbhddv5gQffvJRO4XWZkjRd-GVhS7UejkwSf2pH-Jb8tWfcohtVYG4Glnf6c2o6MDH/s320/Automacao+Residencial.png" width="320" /></a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<br />
<br />
<a name='more'></a><br />
<h4>
<span style="color: red;"><a href="https://go.hotmart.com/H22565755Q" target="_blank">Compre </a>um curso agora e aprenda a montar seu projetos com Arduino.</span></h4>
<br />
<b>A página HTML (deve ser gravada no Sd Card e inserida no slot do shield ethernet)</b><br />
<br />
<!-- HTML generated using hilite.me --><br />
<div style="background: #ffffff; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;">
<pre style="line-height: 125%; margin: 0;"><span style="color: #557799;"><!DOCTYPE html></span>
<span style="color: #007700;"><html></span>
<span style="color: #007700;"><head></span>
<span style="color: #007700;"><title></span>Automação Residencial<span style="color: #007700;"></title></span>
<span style="color: #007700;"><script></span>
strLED1 <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">""</span>;
strLED2 <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">""</span>;
strLED3 <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">""</span>;
strLED4 <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">""</span>;
strLED5 <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">""</span>;
strLED6 <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">""</span>;
strLED7 <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">""</span>;
strLED8 <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">""</span>;
strLED9 <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">""</span>;
strbarra1 <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">""</span>;
strbarra2 <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">""</span>;
strbarra3 <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">""</span>;
strbarra4 <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">""</span>;
strbarra5 <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">""</span>;
strventiladores <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">""</span>;
strdata <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">""</span>;
strLED31 <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">""</span>;
strLED33 <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">""</span>;
strLED35 <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">""</span>;
strLED37 <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">""</span>;
strLED39 <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">""</span>;
<span style="color: #008800; font-weight: bold;">var</span> LED2_state <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">0</span>;
<span style="color: #008800; font-weight: bold;">var</span> LED3_state <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">0</span>;
<span style="color: #008800; font-weight: bold;">var</span> LED4_state <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">0</span>;
<span style="color: #008800; font-weight: bold;">var</span> LED5_state <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">0</span>;
<span style="color: #008800; font-weight: bold;">var</span> LED6_state <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">0</span>;
<span style="color: #008800; font-weight: bold;">var</span> LED7_state <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">0</span>;
<span style="color: #008800; font-weight: bold;">var</span> LED8_state <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">0</span>;
<span style="color: #008800; font-weight: bold;">var</span> LED9_state <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">0</span>;
<span style="color: #008800; font-weight: bold;">var</span> barra1_state <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">0</span>;
<span style="color: #008800; font-weight: bold;">var</span> barra2_state <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">0</span>;
<span style="color: #008800; font-weight: bold;">var</span> barra3_state <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">0</span>;
<span style="color: #008800; font-weight: bold;">var</span> barra4_state <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">0</span>;
<span style="color: #008800; font-weight: bold;">var</span> barra5_state <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">0</span>;
<span style="color: #008800; font-weight: bold;">var</span> ventiladores_state <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">0</span>;
<span style="color: #008800; font-weight: bold;">var</span> LED31_state <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">0</span>;
<span style="color: #008800; font-weight: bold;">var</span> LED33_state <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">0</span>;
<span style="color: #008800; font-weight: bold;">var</span> LED35_state <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">0</span>;
<span style="color: #008800; font-weight: bold;">var</span> LED37_state <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">0</span>;
<span style="color: #008800; font-weight: bold;">var</span> LED39_state <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">0</span>;
setTimeout(<span style="color: #008800; font-weight: bold;">function</span>(){ alert(<span style="background-color: #fff0f0;">"Atualiza a página"</span>); }, <span style="color: #0000dd; font-weight: bold;">480000</span>);
<span style="color: #008800; font-weight: bold;">function</span> GetArduinoIO() {
nocache <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">"&nocache="</span> <span style="color: #333333;">+</span> <span style="color: #007020;">Math</span>.random() <span style="color: #333333;">*</span> <span style="color: #0000dd; font-weight: bold;">1000000</span>;
<span style="color: #008800; font-weight: bold;">var</span> request <span style="color: #333333;">=</span> <span style="color: #008800; font-weight: bold;">new</span> XMLHttpRequest();
request.onreadystatechange <span style="color: #333333;">=</span> <span style="color: #008800; font-weight: bold;">function</span>() {
<span style="color: #008800; font-weight: bold;">if</span> (<span style="color: #008800; font-weight: bold;">this</span>.readyState <span style="color: #333333;">==</span> <span style="color: #0000dd; font-weight: bold;">4</span>) {
<span style="color: #008800; font-weight: bold;">if</span> (<span style="color: #008800; font-weight: bold;">this</span>.status <span style="color: #333333;">==</span> <span style="color: #0000dd; font-weight: bold;">200</span>) {
<span style="color: #008800; font-weight: bold;">if</span> (<span style="color: #008800; font-weight: bold;">this</span>.responseXML <span style="color: #333333;">!=</span> <span style="color: #008800; font-weight: bold;">null</span>) {
<span style="color: #888888;">// XML file received - contains analog values, switch values and LED states</span>
<span style="color: #008800; font-weight: bold;">var</span> count;
<span style="color: #888888;">// get analog inputs</span>
<span style="color: #008800; font-weight: bold;">var</span> num_an <span style="color: #333333;">=</span> <span style="color: #008800; font-weight: bold;">this</span>.responseXML.getElementsByTagName(<span style="background-color: #fff0f0;">'analog'</span>).length;
<span style="color: #008800; font-weight: bold;">for</span> (count <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">0</span>; count <span style="color: #333333;"><</span> num_an; count<span style="color: #333333;">++</span>) {
<span style="color: #007020;">document</span>.getElementsByClassName(<span style="background-color: #fff0f0;">"analog"</span>)[count].innerHTML <span style="color: #333333;">=</span>
<span style="color: #008800; font-weight: bold;">this</span>.responseXML.getElementsByTagName(<span style="background-color: #fff0f0;">'analog'</span>)[count].childNodes[<span style="color: #0000dd; font-weight: bold;">0</span>].nodeValue;
}
<span style="color: #888888;">// get switch inputs</span>
<span style="color: #008800; font-weight: bold;">var</span> num_an <span style="color: #333333;">=</span> <span style="color: #008800; font-weight: bold;">this</span>.responseXML.getElementsByTagName(<span style="background-color: #fff0f0;">'switch'</span>).length;
<span style="color: #008800; font-weight: bold;">for</span> (count <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">0</span>; count <span style="color: #333333;"><</span> num_an; count<span style="color: #333333;">++</span>) {
<span style="color: #007020;">document</span>.getElementsByClassName(<span style="background-color: #fff0f0;">"switches"</span>)[count].innerHTML <span style="color: #333333;">=</span>
<span style="color: #008800; font-weight: bold;">this</span>.responseXML.getElementsByTagName(<span style="background-color: #fff0f0;">'switch'</span>)[count].childNodes[<span style="color: #0000dd; font-weight: bold;">0</span>].nodeValue;
}
<span style="color: #888888;">// LED 1</span>
<span style="color: #888888;">//if (this.responseXML.getElementsByTagName('LED')[0].childNodes[0].nodeValue === "checked") {</span>
<span style="color: #888888;">// document.LED_form.LED1.checked = true;</span>
<span style="color: #888888;">//}</span>
<span style="color: #888888;">//else {</span>
<span style="color: #888888;">// document.LED_form.LED1.checked = false;</span>
<span style="color: #888888;">//}</span>
<span style="color: #888888;">// LED 2</span>
<span style="color: #008800; font-weight: bold;">if</span> (<span style="color: #008800; font-weight: bold;">this</span>.responseXML.getElementsByTagName(<span style="background-color: #fff0f0;">'LED2'</span>)[<span style="color: #0000dd; font-weight: bold;">0</span>].childNodes[<span style="color: #0000dd; font-weight: bold;">0</span>].nodeValue <span style="color: #333333;">===</span> <span style="background-color: #fff0f0;">"on"</span>) {
<span style="color: #007020;">document</span>.getElementById(<span style="background-color: #fff0f0;">"LED2"</span>).innerHTML <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">"Desligar fluorescentes 1 (D2)"</span>;
}
<span style="color: #008800; font-weight: bold;">else</span> {
<span style="color: #007020;">document</span>.getElementById(<span style="background-color: #fff0f0;">"LED2"</span>).innerHTML <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">"Ligar fluorescentes 1 (D2)"</span>;
}
<span style="color: #888888;">// LED 3</span>
<span style="color: #008800; font-weight: bold;">if</span> (<span style="color: #008800; font-weight: bold;">this</span>.responseXML.getElementsByTagName(<span style="background-color: #fff0f0;">'LED3'</span>)[<span style="color: #0000dd; font-weight: bold;">0</span>].childNodes[<span style="color: #0000dd; font-weight: bold;">0</span>].nodeValue <span style="color: #333333;">===</span> <span style="background-color: #fff0f0;">"on"</span>) {
<span style="color: #007020;">document</span>.getElementById(<span style="background-color: #fff0f0;">"LED3"</span>).innerHTML <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">"Desligar fluorescentes 2 (D3)"</span>;
LED3_state <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">1</span>;
}
<span style="color: #008800; font-weight: bold;">else</span> {
<span style="color: #007020;">document</span>.getElementById(<span style="background-color: #fff0f0;">"LED3"</span>).innerHTML <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">"Ligar fluorescentes 2 (D3)"</span>;
LED3_state <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">0</span>;
}
<span style="color: #888888;">// LED 5</span>
<span style="color: #008800; font-weight: bold;">if</span> (<span style="color: #008800; font-weight: bold;">this</span>.responseXML.getElementsByTagName(<span style="background-color: #fff0f0;">'LED5'</span>)[<span style="color: #0000dd; font-weight: bold;">0</span>].childNodes[<span style="color: #0000dd; font-weight: bold;">0</span>].nodeValue <span style="color: #333333;">===</span> <span style="background-color: #fff0f0;">"on"</span>) {
<span style="color: #007020;">document</span>.getElementById(<span style="background-color: #fff0f0;">"LED5"</span>).innerHTML <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">"Desligar fluorescentes 3 (D5)"</span>;
LED5_state <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">1</span>;
}
<span style="color: #008800; font-weight: bold;">else</span> {
<span style="color: #007020;">document</span>.getElementById(<span style="background-color: #fff0f0;">"LED5"</span>).innerHTML <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">"Ligar fluorescentes 3 (D5)"</span>;
LED5_state <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">0</span>;
}
<span style="color: #888888;">// LED 6</span>
<span style="color: #008800; font-weight: bold;">if</span> (<span style="color: #008800; font-weight: bold;">this</span>.responseXML.getElementsByTagName(<span style="background-color: #fff0f0;">'LED6'</span>)[<span style="color: #0000dd; font-weight: bold;">0</span>].childNodes[<span style="color: #0000dd; font-weight: bold;">0</span>].nodeValue <span style="color: #333333;">===</span> <span style="background-color: #fff0f0;">"on"</span>) {
<span style="color: #007020;">document</span>.getElementById(<span style="background-color: #fff0f0;">"LED6"</span>).innerHTML <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">"Desligar fluorescentes 4 (D6)"</span>;
LED6_state <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">1</span>;
}
<span style="color: #008800; font-weight: bold;">else</span> {
<span style="color: #007020;">document</span>.getElementById(<span style="background-color: #fff0f0;">"LED6"</span>).innerHTML <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">"Ligar fluorescentes 4 (D6)"</span>;
LED6_state <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">0</span>;
}
<span style="color: #888888;">// LED 7</span>
<span style="color: #008800; font-weight: bold;">if</span> (<span style="color: #008800; font-weight: bold;">this</span>.responseXML.getElementsByTagName(<span style="background-color: #fff0f0;">'LED7'</span>)[<span style="color: #0000dd; font-weight: bold;">0</span>].childNodes[<span style="color: #0000dd; font-weight: bold;">0</span>].nodeValue <span style="color: #333333;">===</span> <span style="background-color: #fff0f0;">"on"</span>) {
<span style="color: #007020;">document</span>.getElementById(<span style="background-color: #fff0f0;">"LED7"</span>).innerHTML <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">"Desligar som (D7)"</span>;
LED7_state <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">1</span>;
}
<span style="color: #008800; font-weight: bold;">else</span> {
<span style="color: #007020;">document</span>.getElementById(<span style="background-color: #fff0f0;">"LED7"</span>).innerHTML <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">"Ligar som (D7)"</span>;
LED7_state <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">0</span>;
}
<span style="color: #888888;">// LED 8</span>
<span style="color: #888888;">//if (this.responseXML.getElementsByTagName('LED8')[0].childNodes[0].nodeValue === "on") {</span>
<span style="color: #888888;">// document.getElementById("LED8").innerHTML = "Fechar cortina (D8)/(D9)";</span>
<span style="color: #888888;">// LED8_state = 1;</span>
<span style="color: #888888;">//}</span>
<span style="color: #888888;">//else {</span>
<span style="color: #888888;">// document.getElementById("LED8").innerHTML = "Abrir cortina (D8)/(D9)";</span>
<span style="color: #888888;">// LED8_state = 0;</span>
<span style="color: #888888;">//}</span>
<span style="color: #888888;">// barra1 </span>
<span style="color: #888888;">//document.getElementById("b1").value = this.responseXML.getElementsByTagName('b1')[0].childNodes[0].nodeValue;</span>
<span style="color: #888888;">//document.getElementById("b2").value = this.responseXML.getElementsByTagName('b2')[0].childNodes[0].nodeValue;</span>
<span style="color: #888888;">//document.getElementById("b3").value = this.responseXML.getElementsByTagName('b3')[0].childNodes[0].nodeValue;</span>
<span style="color: #888888;">//document.getElementById("b4").value = this.responseXML.getElementsByTagName('b4')[0].childNodes[0].nodeValue;</span>
<span style="color: #888888;">//document.getElementById("b5").value = this.responseXML.getElementsByTagName('b5')[0].childNodes[0].nodeValue;</span>
<span style="color: #888888;">// LED 22</span>
<span style="color: #008800; font-weight: bold;">if</span> (<span style="color: #008800; font-weight: bold;">this</span>.responseXML.getElementsByTagName(<span style="background-color: #fff0f0;">'LED22'</span>)[<span style="color: #0000dd; font-weight: bold;">0</span>].childNodes[<span style="color: #0000dd; font-weight: bold;">0</span>].nodeValue <span style="color: #333333;">===</span> <span style="background-color: #fff0f0;">"on"</span>) {
<span style="color: #007020;">document</span>.getElementById(<span style="background-color: #fff0f0;">"LED22"</span>).innerHTML <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">"Desligar ventiladores (D22)"</span>;
ventiladores_state <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">1</span>;
}
<span style="color: #008800; font-weight: bold;">else</span> {
<span style="color: #007020;">document</span>.getElementById(<span style="background-color: #fff0f0;">"LED22"</span>).innerHTML <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">"Ligar ventiladores (D22)"</span>;
ventiladores_state <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">0</span>;
}
<span style="color: #888888;">// LED 31</span>
<span style="color: #008800; font-weight: bold;">if</span> (<span style="color: #008800; font-weight: bold;">this</span>.responseXML.getElementsByTagName(<span style="background-color: #fff0f0;">'LED31'</span>)[<span style="color: #0000dd; font-weight: bold;">0</span>].childNodes[<span style="color: #0000dd; font-weight: bold;">0</span>].nodeValue <span style="color: #333333;">===</span> <span style="background-color: #fff0f0;">"on"</span>) {
<span style="color: #007020;">document</span>.getElementById(<span style="background-color: #fff0f0;">"LED31"</span>).innerHTML <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">"Desligar incadescentes 1 "</span>;
LED31_state <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">1</span>;
}
<span style="color: #008800; font-weight: bold;">else</span> {
<span style="color: #007020;">document</span>.getElementById(<span style="background-color: #fff0f0;">"LED31"</span>).innerHTML <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">"Ligar incadescentes 1 "</span>;
LED31_state <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">0</span>;
}
<span style="color: #888888;">// LED 33</span>
<span style="color: #008800; font-weight: bold;">if</span> (<span style="color: #008800; font-weight: bold;">this</span>.responseXML.getElementsByTagName(<span style="background-color: #fff0f0;">'LED33'</span>)[<span style="color: #0000dd; font-weight: bold;">0</span>].childNodes[<span style="color: #0000dd; font-weight: bold;">0</span>].nodeValue <span style="color: #333333;">===</span> <span style="background-color: #fff0f0;">"on"</span>) {
<span style="color: #007020;">document</span>.getElementById(<span style="background-color: #fff0f0;">"LED33"</span>).innerHTML <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">"Desligar incadescentes 2 "</span>;
LED33_state <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">1</span>;
}
<span style="color: #008800; font-weight: bold;">else</span> {
<span style="color: #007020;">document</span>.getElementById(<span style="background-color: #fff0f0;">"LED33"</span>).innerHTML <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">"Ligar incadescentes 2 "</span>;
LED33_state <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">0</span>;
}
<span style="color: #888888;">// LED 35</span>
<span style="color: #008800; font-weight: bold;">if</span> (<span style="color: #008800; font-weight: bold;">this</span>.responseXML.getElementsByTagName(<span style="background-color: #fff0f0;">'LED35'</span>)[<span style="color: #0000dd; font-weight: bold;">0</span>].childNodes[<span style="color: #0000dd; font-weight: bold;">0</span>].nodeValue <span style="color: #333333;">===</span> <span style="background-color: #fff0f0;">"on"</span>) {
<span style="color: #007020;">document</span>.getElementById(<span style="background-color: #fff0f0;">"LED35"</span>).innerHTML <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">"Desligar incadescentes 3 "</span>;
LED35_state <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">1</span>;
}
<span style="color: #008800; font-weight: bold;">else</span> {
<span style="color: #007020;">document</span>.getElementById(<span style="background-color: #fff0f0;">"LED35"</span>).innerHTML <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">"Ligar incadescentes 3 "</span>;
LED35_state <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">0</span>;
}
<span style="color: #888888;">// LED 37</span>
<span style="color: #008800; font-weight: bold;">if</span> (<span style="color: #008800; font-weight: bold;">this</span>.responseXML.getElementsByTagName(<span style="background-color: #fff0f0;">'LED37'</span>)[<span style="color: #0000dd; font-weight: bold;">0</span>].childNodes[<span style="color: #0000dd; font-weight: bold;">0</span>].nodeValue <span style="color: #333333;">===</span> <span style="background-color: #fff0f0;">"on"</span>) {
<span style="color: #007020;">document</span>.getElementById(<span style="background-color: #fff0f0;">"LED37"</span>).innerHTML <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">"Desligar incadescentes 4 "</span>;
LED37_state <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">1</span>;
}
<span style="color: #008800; font-weight: bold;">else</span> {
<span style="color: #007020;">document</span>.getElementById(<span style="background-color: #fff0f0;">"LED37"</span>).innerHTML <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">"Ligar incadescentes 4 "</span>;
LED37_state <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">0</span>;
}
<span style="color: #888888;">// LED 39</span>
<span style="color: #008800; font-weight: bold;">if</span> (<span style="color: #008800; font-weight: bold;">this</span>.responseXML.getElementsByTagName(<span style="background-color: #fff0f0;">'LED39'</span>)[<span style="color: #0000dd; font-weight: bold;">0</span>].childNodes[<span style="color: #0000dd; font-weight: bold;">0</span>].nodeValue <span style="color: #333333;">===</span> <span style="background-color: #fff0f0;">"on"</span>) {
<span style="color: #007020;">document</span>.getElementById(<span style="background-color: #fff0f0;">"LED39"</span>).innerHTML <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">"Desligar incadescentes 5 "</span>;
LED39_state <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">1</span>;
}
<span style="color: #008800; font-weight: bold;">else</span> {
<span style="color: #007020;">document</span>.getElementById(<span style="background-color: #fff0f0;">"LED39"</span>).innerHTML <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">"Ligar incadescentes 5 "</span>;
LED39_state <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">0</span>;
}
}
}
}
}
<span style="color: #888888;">// send HTTP GET request with LEDs to switch on/off if any</span>
request.open(<span style="background-color: #fff0f0;">"GET"</span>, <span style="background-color: #fff0f0;">"ajax_inputs"</span> <span style="color: #333333;">+</span> strLED1 <span style="color: #333333;">+</span> strLED2 <span style="color: #333333;">+</span> strLED3 <span style="color: #333333;">+</span> strLED4 <span style="color: #333333;">+</span> strLED5 <span style="color: #333333;">+</span> strLED6 <span style="color: #333333;">+</span> strLED7 <span style="color: #333333;">+</span> strLED8 <span style="color: #333333;">+</span> strLED9 <span style="color: #333333;">+</span> strbarra1 <span style="color: #333333;">+</span>
strbarra2 <span style="color: #333333;">+</span> strbarra3 <span style="color: #333333;">+</span> strbarra4 <span style="color: #333333;">+</span> strbarra5 <span style="color: #333333;">+</span> strventiladores <span style="color: #333333;">+</span> strdata <span style="color: #333333;">+</span> strLED31 <span style="color: #333333;">+</span>
strLED33 <span style="color: #333333;">+</span> strLED35 <span style="color: #333333;">+</span> strLED37 <span style="color: #333333;">+</span> strLED39 <span style="color: #333333;">+</span> nocache, <span style="color: #008800; font-weight: bold;">true</span>);
request.send(<span style="color: #008800; font-weight: bold;">null</span>);
setTimeout(<span style="background-color: #fff0f0;">'GetArduinoIO()'</span>, <span style="color: #0000dd; font-weight: bold;">1000</span>);
strLED1 <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">""</span>;
strLED2 <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">""</span>;
strLED3 <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">""</span>;
strLED4 <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">""</span>;
strLED5 <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">""</span>;
strLED6 <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">""</span>;
strLED7 <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">""</span>;
strLED8 <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">""</span>;
strLED9 <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">""</span>;
strbarra1 <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">""</span>;
strbarra2 <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">""</span>;
strbarra3 <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">""</span>;
strbarra4 <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">""</span>;
strbarra5 <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">""</span>;
strventiladores <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">""</span>;
strdata <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">""</span>;
strLED31 <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">""</span>;
strLED33 <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">""</span>;
strLED35 <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">""</span>;
strLED37 <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">""</span>;
strLED39 <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">""</span>;
}
<span style="color: #008800; font-weight: bold;">function</span> GetLed2() {
<span style="color: #008800; font-weight: bold;">if</span> (LED2_state <span style="color: #333333;">===</span> <span style="color: #0000dd; font-weight: bold;">1</span>) {
LED2_state <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">0</span>;
strLED2 <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">"&LED2=0"</span>;
}
<span style="color: #008800; font-weight: bold;">else</span> {
LED2_state <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">1</span>;
strLED2 <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">"&LED2=1"</span>;
}
}
<span style="color: #008800; font-weight: bold;">function</span> GetLed3() {
<span style="color: #008800; font-weight: bold;">if</span> (LED3_state <span style="color: #333333;">===</span> <span style="color: #0000dd; font-weight: bold;">1</span>) {
LED3_state <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">0</span>;
strLED3 <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">"&LED3=0"</span>;
}
<span style="color: #008800; font-weight: bold;">else</span> {
LED3_state <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">1</span>;
strLED3 <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">"&LED3=1"</span>;
}
}
<span style="color: #008800; font-weight: bold;">function</span> GetLed5() {
<span style="color: #008800; font-weight: bold;">if</span> (LED5_state <span style="color: #333333;">===</span> <span style="color: #0000dd; font-weight: bold;">1</span>) {
LED5_state <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">0</span>;
strLED5 <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">"&LED5=0"</span>;
}
<span style="color: #008800; font-weight: bold;">else</span> {
LED5_state <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">1</span>;
strLED5 <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">"&LED5=1"</span>;
}
}
<span style="color: #008800; font-weight: bold;">function</span> GetLed6() {
<span style="color: #008800; font-weight: bold;">if</span> (LED6_state <span style="color: #333333;">===</span> <span style="color: #0000dd; font-weight: bold;">1</span>) {
LED6_state <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">0</span>;
strLED5 <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">"&LED6=0"</span>;
}
<span style="color: #008800; font-weight: bold;">else</span> {
LED6_state <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">1</span>;
strLED6 <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">"&LED6=1"</span>;
}
}
<span style="color: #008800; font-weight: bold;">function</span> GetLed7() {
<span style="color: #008800; font-weight: bold;">if</span> (LED7_state <span style="color: #333333;">===</span> <span style="color: #0000dd; font-weight: bold;">1</span>) {
LED7_state <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">0</span>;
strLED7 <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">"&LED7=0"</span>;
}
<span style="color: #008800; font-weight: bold;">else</span> {
LED7_state <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">1</span>;
strLED7 <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">"&LED7=1"</span>;
}
}
<span style="color: #008800; font-weight: bold;">function</span> GetVentiladores() {
<span style="color: #008800; font-weight: bold;">if</span> (ventiladores_state <span style="color: #333333;">===</span> <span style="color: #0000dd; font-weight: bold;">1</span>) {
ventiladores_state <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">0</span>;
strventiladores <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">"&LED22=0"</span>;
}
<span style="color: #008800; font-weight: bold;">else</span> {
ventiladores_state <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">1</span>;
strventiladores <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">"&LED22=1"</span>;
}
}
<span style="color: #008800; font-weight: bold;">function</span> GetLed8() {
strLED8 <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">"&LED8=1"</span>;
}
<span style="color: #008800; font-weight: bold;">function</span> GetLed9() {
strLED9 <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">"&LED9=1"</span>;
}
<span style="color: #008800; font-weight: bold;">function</span> GetBarra1(){
strbarra1 <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">"&b1="</span><span style="color: #333333;">+</span><span style="color: #007020;">document</span>.getElementById(<span style="background-color: #fff0f0;">'b1'</span>).value;
}
<span style="color: #008800; font-weight: bold;">function</span> GetBarra2(){
strbarra1 <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">"&b2="</span><span style="color: #333333;">+</span><span style="color: #007020;">document</span>.getElementById(<span style="background-color: #fff0f0;">'b2'</span>).value;
}
<span style="color: #008800; font-weight: bold;">function</span> GetBarra3(){
strbarra1 <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">"&b3="</span><span style="color: #333333;">+</span><span style="color: #007020;">document</span>.getElementById(<span style="background-color: #fff0f0;">'b3'</span>).value;
}
<span style="color: #008800; font-weight: bold;">function</span> GetBarra4(){
strbarra1 <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">"&b4="</span><span style="color: #333333;">+</span><span style="color: #007020;">document</span>.getElementById(<span style="background-color: #fff0f0;">'b4'</span>).value;
}
<span style="color: #008800; font-weight: bold;">function</span> GetBarra5(){
strbarra1 <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">"&b5="</span><span style="color: #333333;">+</span><span style="color: #007020;">document</span>.getElementById(<span style="background-color: #fff0f0;">'b5'</span>).value;
}
<span style="color: #008800; font-weight: bold;">function</span> GetData() {
strdata <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">"&LED53=1"</span>;
}
<span style="color: #008800; font-weight: bold;">function</span> GetLed31() {
<span style="color: #008800; font-weight: bold;">if</span> (LED31_state <span style="color: #333333;">===</span> <span style="color: #0000dd; font-weight: bold;">1</span>) {
LED31_state <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">0</span>;
strLED31 <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">"&LED31=0"</span>;
}
<span style="color: #008800; font-weight: bold;">else</span> {
LED2_state <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">1</span>;
strLED31 <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">"&LED31=1"</span>;
}
}
<span style="color: #008800; font-weight: bold;">function</span> GetLed33() {
<span style="color: #008800; font-weight: bold;">if</span> (LED33_state <span style="color: #333333;">===</span> <span style="color: #0000dd; font-weight: bold;">1</span>) {
LED33_state <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">0</span>;
strLED33 <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">"&LED33=0"</span>;
}
<span style="color: #008800; font-weight: bold;">else</span> {
LED3_state <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">1</span>;
strLED33 <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">"&LED33=1"</span>;
}
}
<span style="color: #008800; font-weight: bold;">function</span> GetLed35() {
<span style="color: #008800; font-weight: bold;">if</span> (LED35_state <span style="color: #333333;">===</span> <span style="color: #0000dd; font-weight: bold;">1</span>) {
LED35_state <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">0</span>;
strLED35 <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">"&LED35=0"</span>;
}
<span style="color: #008800; font-weight: bold;">else</span> {
LED5_state <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">1</span>;
strLED35 <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">"&LED35=1"</span>;
}
}
<span style="color: #008800; font-weight: bold;">function</span> GetLed37() {
<span style="color: #008800; font-weight: bold;">if</span> (LED37_state <span style="color: #333333;">===</span> <span style="color: #0000dd; font-weight: bold;">1</span>) {
LED37_state <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">0</span>;
strLED37 <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">"&LED37=0"</span>;
}
<span style="color: #008800; font-weight: bold;">else</span> {
LED7_state <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">1</span>;
strLED37 <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">"&LED37=1"</span>;
}
}
<span style="color: #008800; font-weight: bold;">function</span> GetLed39() {
<span style="color: #008800; font-weight: bold;">if</span> (LED39_state <span style="color: #333333;">===</span> <span style="color: #0000dd; font-weight: bold;">1</span>) {
LED39_state <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">0</span>;
strLED39 <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">"&LED39=0"</span>;
}
<span style="color: #008800; font-weight: bold;">else</span> {
LED9_state <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">1</span>;
strLED39 <span style="color: #333333;">=</span> <span style="background-color: #fff0f0;">"&LED39=1"</span>;
}
}
<span style="color: #007700;"></script></span>
<span style="color: #007700;"><style></span>
<span style="color: #bb0066; font-weight: bold;">.IO_box</span> {
<span style="color: #008800; font-weight: bold;">margin</span><span style="color: #333333;">:</span> <span style="color: #6600ee; font-weight: bold;">0</span> <span style="color: #6600ee; font-weight: bold;">20px</span> <span style="color: #6600ee; font-weight: bold;">20px</span> <span style="color: #6600ee; font-weight: bold;">0</span>;
<span style="color: #008800; font-weight: bold;">border</span><span style="color: #333333;">:</span> <span style="color: #6600ee; font-weight: bold;">1px</span> <span style="color: #008800; font-weight: bold;">solid</span> <span style="color: #007020;">blue</span>;
<span style="color: #008800; font-weight: bold;">padding</span><span style="color: #333333;">:</span> <span style="color: #6600ee; font-weight: bold;">0</span> <span style="color: #6600ee; font-weight: bold;">5px</span> <span style="color: #6600ee; font-weight: bold;">0</span> <span style="color: #6600ee; font-weight: bold;">5px</span>;
<span style="color: #008800; font-weight: bold;">width</span><span style="color: #333333;">:</span> <span style="color: #6600ee; font-weight: bold;">240px</span>;
}
<span style="color: #007700;">h1</span> {
<span style="color: #008800; font-weight: bold;">font-size</span><span style="color: #333333;">:</span> <span style="color: #6600ee; font-weight: bold;">120</span><span style="color: #333333;">%</span>;
<span style="color: #008800; font-weight: bold;">color</span><span style="color: #333333;">:</span> <span style="color: #007020;">blue</span>;
<span style="color: #008800; font-weight: bold;">margin</span><span style="color: #333333;">:</span> <span style="color: #6600ee; font-weight: bold;">0</span> <span style="color: #6600ee; font-weight: bold;">0</span> <span style="color: #6600ee; font-weight: bold;">10px</span> <span style="color: #6600ee; font-weight: bold;">0</span>;
}
<span style="color: #007700;">h2</span> {
<span style="color: #008800; font-weight: bold;">font-size</span><span style="color: #333333;">:</span> <span style="color: #6600ee; font-weight: bold;">85</span><span style="color: #333333;">%</span>;
<span style="color: #008800; font-weight: bold;">color</span><span style="color: #333333;">:</span> <span style="color: #6600ee; font-weight: bold;">#5734E6</span>;
<span style="color: #008800; font-weight: bold;">margin</span><span style="color: #333333;">:</span> <span style="color: #6600ee; font-weight: bold;">5px</span> <span style="color: #6600ee; font-weight: bold;">0</span> <span style="color: #6600ee; font-weight: bold;">5px</span> <span style="color: #6600ee; font-weight: bold;">0</span>;
}
<span style="color: #007700;">p</span><span style="color: #333333;">,</span> <span style="color: #007700;">form</span><span style="color: #333333;">,</span> <span style="color: #007700;">button</span> {
<span style="color: #008800; font-weight: bold;">font-size</span><span style="color: #333333;">:</span> <span style="color: #6600ee; font-weight: bold;">80</span><span style="color: #333333;">%</span>;
<span style="color: #008800; font-weight: bold;">color</span><span style="color: #333333;">:</span> <span style="color: #6600ee; font-weight: bold;">#252525</span>;
}
<span style="color: #bb0066; font-weight: bold;">.small_text</span> {
<span style="color: #008800; font-weight: bold;">font-size</span><span style="color: #333333;">:</span> <span style="color: #6600ee; font-weight: bold;">70</span><span style="color: #333333;">%</span>;
<span style="color: #008800; font-weight: bold;">color</span><span style="color: #333333;">:</span> <span style="color: #6600ee; font-weight: bold;">#737373</span>;
}
<span style="color: #007700;"></style></span>
<span style="color: #007700;"></head></span>
<span style="color: #007700;"><body</span> <span style="color: #0000cc;">onload=</span><span style="background-color: #fff0f0;">"GetArduinoIO()"</span><span style="color: #007700;">></span>
<span style="color: #007700;"><div</span> <span style="color: #0000cc;">class=</span><span style="background-color: #fff0f0;">"IO_box"</span><span style="color: #007700;">></span>
<span style="color: #007700;"><h2></span>Iluminação<span style="color: #007700;"></h2></span>
<span style="color: #007700;"><button</span> <span style="color: #0000cc;">type=</span><span style="background-color: #fff0f0;">"button"</span> <span style="color: #0000cc;">id=</span><span style="background-color: #fff0f0;">"LED2"</span> <span style="color: #0000cc;">onclick=</span><span style="background-color: #fff0f0;">"GetLed2()"</span><span style="color: #007700;">></span>Ligar fluorescentes 1 (D2)<span style="color: #007700;"></button><br</span> <span style="color: #007700;">/><br</span> <span style="color: #007700;">/></span>
<span style="color: #007700;"><button</span> <span style="color: #0000cc;">type=</span><span style="background-color: #fff0f0;">"button"</span> <span style="color: #0000cc;">id=</span><span style="background-color: #fff0f0;">"LED3"</span> <span style="color: #0000cc;">onclick=</span><span style="background-color: #fff0f0;">"GetLed3()"</span><span style="color: #007700;">></span>Ligar fluorescentes 2 (D3)<span style="color: #007700;"></button><br</span> <span style="color: #007700;">/><br</span> <span style="color: #007700;">/></span>
<span style="color: #007700;"><button</span> <span style="color: #0000cc;">type=</span><span style="background-color: #fff0f0;">"button"</span> <span style="color: #0000cc;">id=</span><span style="background-color: #fff0f0;">"LED5"</span> <span style="color: #0000cc;">onclick=</span><span style="background-color: #fff0f0;">"GetLed5()"</span><span style="color: #007700;">></span>Ligar fluorescentes 3 (D5)<span style="color: #007700;"></button><br</span> <span style="color: #007700;">/><br</span> <span style="color: #007700;">/></span>
<span style="color: #007700;"><button</span> <span style="color: #0000cc;">type=</span><span style="background-color: #fff0f0;">"button"</span> <span style="color: #0000cc;">id=</span><span style="background-color: #fff0f0;">"LED6"</span> <span style="color: #0000cc;">onclick=</span><span style="background-color: #fff0f0;">"GetLed6()"</span><span style="color: #007700;">></span>Ligar fluorescentes 4 (D6)<span style="color: #007700;"></button><br</span> <span style="color: #007700;">/><br</span> <span style="color: #007700;">/></span>
<span style="color: #007700;"><button</span> <span style="color: #0000cc;">type=</span><span style="background-color: #fff0f0;">"button"</span> <span style="color: #0000cc;">id=</span><span style="background-color: #fff0f0;">"LED31"</span> <span style="color: #0000cc;">onclick=</span><span style="background-color: #fff0f0;">"GetLed31()"</span><span style="color: #007700;">></span>Ligar incandescentes 1 <span style="color: #007700;"></button><br</span> <span style="color: #007700;">/><br</span> <span style="color: #007700;">/></span>
<span style="color: #007700;"><button</span> <span style="color: #0000cc;">type=</span><span style="background-color: #fff0f0;">"button"</span> <span style="color: #0000cc;">id=</span><span style="background-color: #fff0f0;">"LED33"</span> <span style="color: #0000cc;">onclick=</span><span style="background-color: #fff0f0;">"GetLed33()"</span><span style="color: #007700;">></span>Ligar incandescentes 2 <span style="color: #007700;"></button><br</span> <span style="color: #007700;">/><br</span> <span style="color: #007700;">/></span>
<span style="color: #007700;"><button</span> <span style="color: #0000cc;">type=</span><span style="background-color: #fff0f0;">"button"</span> <span style="color: #0000cc;">id=</span><span style="background-color: #fff0f0;">"LED35"</span> <span style="color: #0000cc;">onclick=</span><span style="background-color: #fff0f0;">"GetLed35()"</span><span style="color: #007700;">></span>Ligar incandescentes 3 <span style="color: #007700;"></button><br</span> <span style="color: #007700;">/><br</span> <span style="color: #007700;">/></span>
<span style="color: #007700;"><button</span> <span style="color: #0000cc;">type=</span><span style="background-color: #fff0f0;">"button"</span> <span style="color: #0000cc;">id=</span><span style="background-color: #fff0f0;">"LED37"</span> <span style="color: #0000cc;">onclick=</span><span style="background-color: #fff0f0;">"GetLed37()"</span><span style="color: #007700;">></span>Ligar incandescentes 4 <span style="color: #007700;"></button><br</span> <span style="color: #007700;">/><br</span> <span style="color: #007700;">/></span>
<span style="color: #007700;"><button</span> <span style="color: #0000cc;">type=</span><span style="background-color: #fff0f0;">"button"</span> <span style="color: #0000cc;">id=</span><span style="background-color: #fff0f0;">"LED39"</span> <span style="color: #0000cc;">onclick=</span><span style="background-color: #fff0f0;">"GetLed39()"</span><span style="color: #007700;">></span>Ligar incandescentes 5 <span style="color: #007700;"></button><br</span> <span style="color: #007700;">/><br</span> <span style="color: #007700;">/></span>
<span style="color: #888888;"><!-- <label id="barra">Barra 1 - A2</label><br /> </span>
<span style="color: #888888;"> <input type="range" id="b1" name="rangeInput" min="0" max="9" onchange="GetBarra1();"><br /> <br /> </span>
<span style="color: #888888;"> </span>
<span style="color: #888888;"> <label id="barra">Barra 2 - A3</label><br /> </span>
<span style="color: #888888;"> <input type="range" id="b2" name="rangeInput" min="0" max="9" onchange="GetBarra2();"> <br /> <br /> </span>
<span style="color: #888888;"> </span>
<span style="color: #888888;"> <label id="barra">Barra 3 - A4</label><br /> </span>
<span style="color: #888888;"> <input type="range" id="b3" name="rangeInput" min="0" max="9" onchange="GetBarra3();"> <br /> <br /> </span>
<span style="color: #888888;"> <label id="barra">Barra 4 - A5</label><br /> </span>
<span style="color: #888888;"> <input type="range" id="b4" name="rangeInput" min="0" max="9" onchange="GetBarra4();"><br /> <br /> </span>
<span style="color: #888888;"> </span>
<span style="color: #888888;"> <label id="barra">Barra 5 - A6</label><br /> </span>
<span style="color: #888888;"> <input type="range" id="b5" name="rangeInput" min="0" max="9" onchange="GetBarra5();"><br /> <br /> </span>
<span style="color: #888888;"> </span>
<span style="color: #888888;"> </span>
<span style="color: #888888;"> <div class="IO_box"></span>
<span style="color: #888888;"> <h2>Ar condicionado</h2></span>
<span style="color: #888888;"> <button type="button" id="LED47" onclick="GetLed7()">Ligar ar condicionado (D7)</button><br /><br /></span>
<span style="color: #888888;"> <button type="button" id="btnaumentar" disabled onclick="GetLed8()">- D8</button></span>
<span style="color: #888888;"> <input type="text" size="3" name="barra5"></span>
<span style="color: #888888;"> <button type="button" id="btndiminuir" disabled onclick="GetLed9()">+ D9</button><br /> <br /></span>
<span style="color: #888888;"> </div></span>
<span style="color: #888888;"> </span>
<span style="color: #888888;"> <button type="button" id="LED31" onclick="GetLed31()">Cena Festa (D31)</button><br /><br /></span>
<span style="color: #888888;"> <button type="button" id="LED32" onclick="GetLed32()">Cena Cinema (D32)</button><br /><br /></span>
<span style="color: #888888;"> <button type="button" id="LED33" onclick="GetLed33()">Cena Aula (D33)</button><br /><br /></span>
<span style="color: #888888;"> <button type="button" id="LED34" onclick="GetLed34()">Cena Penumbra (D34)</button><br /><br /></span>
<span style="color: #888888;"> <button type="button" id="LED35" onclick="GetLed35()">Cena x (D35)</button><br /><br /> --></span>
<span style="color: #007700;"></div></span>
<span style="color: #007700;"><div</span> <span style="color: #0000cc;">class=</span><span style="background-color: #fff0f0;">"IO_box"</span><span style="color: #007700;">></span>
<span style="color: #007700;"><h2></span>Som<span style="color: #007700;"></h2></span>
<span style="color: #007700;"><button</span> <span style="color: #0000cc;">type=</span><span style="background-color: #fff0f0;">"button"</span> <span style="color: #0000cc;">id=</span><span style="background-color: #fff0f0;">"LED7"</span> <span style="color: #0000cc;">onclick=</span><span style="background-color: #fff0f0;">"GetLed7()"</span><span style="color: #007700;">></span>Ligar som (D7)<span style="color: #007700;"></button><br</span> <span style="color: #007700;">/><br</span> <span style="color: #007700;">/></span>
<span style="color: #007700;"></div></span>
<span style="color: #007700;"><div</span> <span style="color: #0000cc;">class=</span><span style="background-color: #fff0f0;">"IO_box"</span><span style="color: #007700;">></span>
<span style="color: #007700;"><h2></span>Cortina<span style="color: #007700;"></h2></span>
<span style="color: #007700;"><button</span> <span style="color: #0000cc;">type=</span><span style="background-color: #fff0f0;">"button"</span> <span style="color: #0000cc;">id=</span><span style="background-color: #fff0f0;">"LED8"</span> <span style="color: #0000cc;">onclick=</span><span style="background-color: #fff0f0;">"GetLed8()"</span><span style="color: #007700;">></span>Abrir cortina <span style="color: #007700;"></button></span>
<span style="color: #007700;"><button</span> <span style="color: #0000cc;">type=</span><span style="background-color: #fff0f0;">"button"</span> <span style="color: #0000cc;">id=</span><span style="background-color: #fff0f0;">"LED9"</span> <span style="color: #0000cc;">onclick=</span><span style="background-color: #fff0f0;">"GetLed9()"</span><span style="color: #007700;">></span>Fechar cortina <span style="color: #007700;"></button><br</span> <span style="color: #007700;">/><br</span> <span style="color: #007700;">/></span>
<span style="color: #007700;"></div></span>
<span style="color: #007700;"><div</span> <span style="color: #0000cc;">class=</span><span style="background-color: #fff0f0;">"IO_box"</span><span style="color: #007700;">></span>
<span style="color: #007700;"><h2></span>Ventiladores<span style="color: #007700;"></h2></span>
<span style="color: #007700;"><button</span> <span style="color: #0000cc;">type=</span><span style="background-color: #fff0f0;">"button"</span> <span style="color: #0000cc;">id=</span><span style="background-color: #fff0f0;">"LED22"</span> <span style="color: #0000cc;">onclick=</span><span style="background-color: #fff0f0;">"GetVentiladores()"</span><span style="color: #007700;">></span>Ligar ventiladores<span style="color: #007700;"></button><br</span> <span style="color: #007700;">/><br</span> <span style="color: #007700;">/></span>
<span style="color: #007700;"></div></span>
<span style="color: #007700;"><div</span> <span style="color: #0000cc;">class=</span><span style="background-color: #fff0f0;">"IO_box"</span><span style="color: #007700;">></span>
<span style="color: #007700;"><h2></span>Tela Datashow<span style="color: #007700;"></h2></span>
<span style="color: #007700;"><button</span> <span style="color: #0000cc;">type=</span><span style="background-color: #fff0f0;">"button"</span> <span style="color: #0000cc;">id=</span><span style="background-color: #fff0f0;">"LED53"</span> <span style="color: #0000cc;">onclick=</span><span style="background-color: #fff0f0;">"GetData()"</span><span style="color: #007700;">></span>Acionar/Parar<span style="color: #007700;"></button><br</span> <span style="color: #007700;">/><br</span> <span style="color: #007700;">/></span>
<span style="color: #007700;"></div></span>
<span style="color: #007700;"></body></span>
<span style="color: #007700;"></html></span>
</pre>
</div>
<br />
<br />
<b>A programação no Arduino</b><br />
<form action="/" method="post">
<div id="container">
<div id="main">
<div id="html">
<div id="preview">
<div style="background: #ffffff; border-width: .1em .1em .1em .8em; border: solid gray; overflow: auto; padding: .2em .6em; width: auto;">
<pre style="line-height: 125%; margin: 0;"><span style="color: #557799;">#include <SPI.h></span>
<span style="color: #557799;">#include <Ethernet.h></span>
<span style="color: #557799;">#include <SD.h></span>
<span style="color: #888888;">// size of buffer used to capture HTTP requests</span>
<span style="color: #557799;">#define REQ_BUF_SZ 60</span>
<span style="color: #888888;">// MAC address from Ethernet shield sticker under board</span>
byte mac[] <span style="color: #333333;">=</span> { <span style="color: #005588; font-weight: bold;">0xDE</span>, <span style="color: #005588; font-weight: bold;">0xAD</span>, <span style="color: #005588; font-weight: bold;">0xBE</span>, <span style="color: #005588; font-weight: bold;">0xEF</span>, <span style="color: #005588; font-weight: bold;">0xFE</span>, <span style="color: #005588; font-weight: bold;">0xED</span> };
IPAddress <span style="color: #0066bb; font-weight: bold;">ip</span>(<span style="color: #0000dd; font-weight: bold;">10</span>, <span style="color: #0000dd; font-weight: bold;">1</span>, <span style="color: #0000dd; font-weight: bold;">1</span>, <span style="color: #0000dd; font-weight: bold;">200</span>); <span style="color: #888888;">// IP address, may need to change depending on network</span>
EthernetServer <span style="color: #0066bb; font-weight: bold;">server</span>(<span style="color: #0000dd; font-weight: bold;">80</span>); <span style="color: #888888;">// create a server at port 80</span>
File webFile; <span style="color: #888888;">// the web page file on the SD card</span>
<span style="color: #333399; font-weight: bold;">char</span> HTTP_req[REQ_BUF_SZ] <span style="color: #333333;">=</span> {<span style="color: #0000dd; font-weight: bold;">0</span>}; <span style="color: #888888;">// buffered HTTP request stored as null terminated string</span>
<span style="color: #333399; font-weight: bold;">char</span> req_index <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">0</span>; <span style="color: #888888;">// index into HTTP_req buffer</span>
boolean LED_state[<span style="color: #0000dd; font-weight: bold;">40</span>] <span style="color: #333333;">=</span> {<span style="color: #0000dd; font-weight: bold;">0</span>}; <span style="color: #888888;">// stores the states of the LEDs</span>
<span style="color: #333399; font-weight: bold;">int</span> valorb1 <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">0</span>;
<span style="color: #333399; font-weight: bold;">void</span> <span style="color: #0066bb; font-weight: bold;">setup</span>() {
<span style="color: #888888;">// disable Ethernet chip</span>
pinMode(<span style="color: #0000dd; font-weight: bold;">4</span>, OUTPUT);
digitalWrite(<span style="color: #0000dd; font-weight: bold;">4</span>, HIGH);
Serial.begin(<span style="color: #0000dd; font-weight: bold;">9600</span>); <span style="color: #888888;">// for debugging</span>
<span style="color: #888888;">// initialize SD card</span>
Serial.println(<span style="background-color: #fff0f0;">"Initializing SD card..."</span>);
<span style="color: #008800; font-weight: bold;">if</span> (<span style="color: #333333;">!</span>SD.begin(<span style="color: #0000dd; font-weight: bold;">4</span>)) {
Serial.println(<span style="background-color: #fff0f0;">"ERROR - SD card initialization failed!"</span>);
<span style="color: #008800; font-weight: bold;">return</span>; <span style="color: #888888;">// init failed</span>
}
Serial.println(<span style="background-color: #fff0f0;">"SUCCESS - SD card initialized."</span>);
<span style="color: #888888;">// check for index.htm file</span>
<span style="color: #008800; font-weight: bold;">if</span> (<span style="color: #333333;">!</span>SD.exists(<span style="background-color: #fff0f0;">"index.htm"</span>)) {
Serial.println(<span style="background-color: #fff0f0;">"ERROR - Can't find index.htm file!"</span>);
<span style="color: #008800; font-weight: bold;">return</span>; <span style="color: #888888;">// can't find index file</span>
}
Serial.println(<span style="background-color: #fff0f0;">"SUCCESS - Found index.htm file."</span>);
pinMode(<span style="color: #0000dd; font-weight: bold;">2</span>, OUTPUT);
pinMode(<span style="color: #0000dd; font-weight: bold;">3</span>, OUTPUT);
pinMode(<span style="color: #0000dd; font-weight: bold;">5</span>, OUTPUT);
pinMode(<span style="color: #0000dd; font-weight: bold;">6</span>, OUTPUT);
pinMode(<span style="color: #0000dd; font-weight: bold;">7</span>, OUTPUT);
pinMode(<span style="color: #0000dd; font-weight: bold;">8</span>, OUTPUT);
pinMode(<span style="color: #0000dd; font-weight: bold;">9</span>, OUTPUT);
pinMode(<span style="color: #0000dd; font-weight: bold;">47</span>, OUTPUT);
pinMode(<span style="color: #0000dd; font-weight: bold;">49</span>, OUTPUT);
pinMode(<span style="color: #0000dd; font-weight: bold;">53</span>, OUTPUT);
digitalWrite(<span style="color: #0000dd; font-weight: bold;">2</span>, HIGH);
digitalWrite(<span style="color: #0000dd; font-weight: bold;">3</span>, HIGH);
digitalWrite(<span style="color: #0000dd; font-weight: bold;">5</span>, HIGH);
digitalWrite(<span style="color: #0000dd; font-weight: bold;">6</span>, HIGH);
digitalWrite(<span style="color: #0000dd; font-weight: bold;">7</span>, HIGH);
digitalWrite(<span style="color: #0000dd; font-weight: bold;">24</span>, HIGH);
digitalWrite(<span style="color: #0000dd; font-weight: bold;">26</span>, HIGH);
digitalWrite(<span style="color: #0000dd; font-weight: bold;">47</span>, HIGH);
digitalWrite(<span style="color: #0000dd; font-weight: bold;">49</span>, HIGH);
digitalWrite(<span style="color: #0000dd; font-weight: bold;">53</span>, HIGH);
Ethernet.begin(mac, ip); <span style="color: #888888;">// initialize Ethernet device</span>
server.begin(); <span style="color: #888888;">// start to listen for clients</span>
}
<span style="color: #333399; font-weight: bold;">void</span> <span style="color: #0066bb; font-weight: bold;">loop</span>() {
EthernetClient client <span style="color: #333333;">=</span> server.available(); <span style="color: #888888;">// try to get client</span>
<span style="color: #008800; font-weight: bold;">if</span> (client) { <span style="color: #888888;">// got client?</span>
boolean currentLineIsBlank <span style="color: #333333;">=</span> <span style="color: #007020;">true</span>;
<span style="color: #008800; font-weight: bold;">while</span> (client.connected()) {
<span style="color: #008800; font-weight: bold;">if</span> (client.available()) { <span style="color: #888888;">// client data available to read</span>
<span style="color: #333399; font-weight: bold;">char</span> c <span style="color: #333333;">=</span> client.read(); <span style="color: #888888;">// read 1 byte (character) from client</span>
<span style="color: #888888;">// limit the size of the stored received HTTP request</span>
<span style="color: #888888;">// buffer first part of HTTP request in HTTP_req array (string)</span>
<span style="color: #888888;">// leave last element in array as 0 to null terminate string (REQ_BUF_SZ - 1)</span>
<span style="color: #008800; font-weight: bold;">if</span> (req_index <span style="color: #333333;"><</span> (REQ_BUF_SZ <span style="color: #333333;">-</span> <span style="color: #0000dd; font-weight: bold;">1</span>)) {
HTTP_req[req_index] <span style="color: #333333;">=</span> c; <span style="color: #888888;">// save HTTP request character</span>
req_index<span style="color: #333333;">++</span>;
}
<span style="color: #888888;">// last line of client request is blank and ends with \n</span>
<span style="color: #888888;">// respond to client only after last line received</span>
<span style="color: #008800; font-weight: bold;">if</span> (c <span style="color: #333333;">==</span> <span style="color: #0044dd;">'\n'</span> <span style="color: #333333;">&&</span> currentLineIsBlank) {
<span style="color: #888888;">// send a standard http response header</span>
client.println(<span style="background-color: #fff0f0;">"HTTP/1.1 200 OK"</span>);
<span style="color: #888888;">// remainder of header follows below, depending on if</span>
<span style="color: #888888;">// web page or XML page is requested</span>
<span style="color: #888888;">// Ajax request - send XML file</span>
<span style="color: #008800; font-weight: bold;">if</span> (StrContains(HTTP_req, <span style="background-color: #fff0f0;">"ajax_inputs"</span>)) {
<span style="color: #888888;">// send rest of HTTP header</span>
client.println(<span style="background-color: #fff0f0;">"Content-Type: text/xml"</span>);
client.println(<span style="background-color: #fff0f0;">"Connection: keep-alive"</span>);
client.println();
SetLEDs();
<span style="color: #888888;">// send XML file containing input states</span>
XML_response(client);
}
<span style="color: #008800; font-weight: bold;">else</span> { <span style="color: #888888;">// web page request</span>
<span style="color: #888888;">// send rest of HTTP header</span>
client.println(<span style="background-color: #fff0f0;">"Content-Type: text/html"</span>);
client.println(<span style="background-color: #fff0f0;">"Connection: keep-alive"</span>);
client.println();
<span style="color: #888888;">// send web page</span>
webFile <span style="color: #333333;">=</span> SD.open(<span style="background-color: #fff0f0;">"index.htm"</span>); <span style="color: #888888;">// open web page file</span>
<span style="color: #008800; font-weight: bold;">if</span> (webFile) {
<span style="color: #008800; font-weight: bold;">while</span> (webFile.available()) {
client.write(webFile.read()); <span style="color: #888888;">// send web page to client</span>
}
webFile.close();
}
}
<span style="color: #888888;">// display received HTTP request on serial port</span>
<span style="color: #888888;">//Serial.print(HTTP_req);</span>
<span style="color: #888888;">// reset buffer index and all buffer elements to 0</span>
req_index <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">0</span>;
StrClear(HTTP_req, REQ_BUF_SZ);
<span style="color: #008800; font-weight: bold;">break</span>;
}
<span style="color: #888888;">// every line of text received from the client ends with \r\n</span>
<span style="color: #008800; font-weight: bold;">if</span> (c <span style="color: #333333;">==</span> <span style="color: #0044dd;">'\n'</span>) {
<span style="color: #888888;">// last character on line of received text</span>
<span style="color: #888888;">// starting new line with next character read</span>
currentLineIsBlank <span style="color: #333333;">=</span> <span style="color: #007020;">true</span>;
}
<span style="color: #008800; font-weight: bold;">else</span> <span style="color: #008800; font-weight: bold;">if</span> (c <span style="color: #333333;">!=</span> <span style="color: #0044dd;">'\r'</span>) {
<span style="color: #888888;">// a text character was received from client</span>
currentLineIsBlank <span style="color: #333333;">=</span> <span style="color: #007020;">false</span>;
}
} <span style="color: #888888;">// end if (client.available())</span>
} <span style="color: #888888;">// end while (client.connected())</span>
delay(<span style="color: #0000dd; font-weight: bold;">1</span>); <span style="color: #888888;">// give the web browser time to receive the data</span>
client.stop(); <span style="color: #888888;">// close the connection</span>
} <span style="color: #888888;">// end if (client)</span>
}
<span style="color: #888888;">// checks if received HTTP request is switching on/off LEDs</span>
<span style="color: #888888;">// also saves the state of the LEDs</span>
<span style="color: #333399; font-weight: bold;">void</span> <span style="color: #0066bb; font-weight: bold;">SetLEDs</span>(<span style="color: #333399; font-weight: bold;">void</span>) {
<span style="color: #888888;">// LED 2</span>
<span style="color: #008800; font-weight: bold;">if</span> (StrContains(HTTP_req, <span style="background-color: #fff0f0;">"LED2=1"</span>)) {
LED_state[<span style="color: #0000dd; font-weight: bold;">2</span>] <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">1</span>; <span style="color: #888888;">// save LED state</span>
digitalWrite(<span style="color: #0000dd; font-weight: bold;">2</span>, LOW);
} <span style="color: #008800; font-weight: bold;">else</span> <span style="color: #008800; font-weight: bold;">if</span> (StrContains(HTTP_req, <span style="background-color: #fff0f0;">"LED2=0"</span>)) {
LED_state[<span style="color: #0000dd; font-weight: bold;">2</span>] <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">0</span>; <span style="color: #888888;">// save LED state</span>
digitalWrite(<span style="color: #0000dd; font-weight: bold;">2</span>, HIGH);
}
<span style="color: #888888;">// LED 3</span>
<span style="color: #008800; font-weight: bold;">if</span> (StrContains(HTTP_req, <span style="background-color: #fff0f0;">"LED3=1"</span>)) {
LED_state[<span style="color: #0000dd; font-weight: bold;">3</span>] <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">1</span>; <span style="color: #888888;">// save LED state</span>
digitalWrite(<span style="color: #0000dd; font-weight: bold;">3</span>, LOW);
} <span style="color: #008800; font-weight: bold;">else</span> <span style="color: #008800; font-weight: bold;">if</span> (StrContains(HTTP_req, <span style="background-color: #fff0f0;">"LED3=0"</span>)) {
LED_state[<span style="color: #0000dd; font-weight: bold;">3</span>] <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">0</span>; <span style="color: #888888;">// save LED state</span>
digitalWrite(<span style="color: #0000dd; font-weight: bold;">3</span>, HIGH);
}
<span style="color: #888888;">// LED 5</span>
<span style="color: #008800; font-weight: bold;">if</span> (StrContains(HTTP_req, <span style="background-color: #fff0f0;">"LED5=1"</span>)) {
LED_state[<span style="color: #0000dd; font-weight: bold;">5</span>] <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">1</span>; <span style="color: #888888;">// save LED state</span>
digitalWrite(<span style="color: #0000dd; font-weight: bold;">5</span>, LOW);
} <span style="color: #008800; font-weight: bold;">else</span> <span style="color: #008800; font-weight: bold;">if</span> (StrContains(HTTP_req, <span style="background-color: #fff0f0;">"LED5=0"</span>)) {
LED_state[<span style="color: #0000dd; font-weight: bold;">5</span>] <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">0</span>; <span style="color: #888888;">// save LED state</span>
digitalWrite(<span style="color: #0000dd; font-weight: bold;">5</span>, HIGH);
}
<span style="color: #888888;">// LED 6</span>
<span style="color: #008800; font-weight: bold;">if</span> (StrContains(HTTP_req, <span style="background-color: #fff0f0;">"LED6=1"</span>)) {
LED_state[<span style="color: #0000dd; font-weight: bold;">6</span>] <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">1</span>; <span style="color: #888888;">// save LED state</span>
digitalWrite(<span style="color: #0000dd; font-weight: bold;">6</span>, LOW);
} <span style="color: #008800; font-weight: bold;">else</span> <span style="color: #008800; font-weight: bold;">if</span> (StrContains(HTTP_req, <span style="background-color: #fff0f0;">"LED6=0"</span>)) {
LED_state[<span style="color: #0000dd; font-weight: bold;">6</span>] <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">0</span>; <span style="color: #888888;">// save LED state</span>
digitalWrite(<span style="color: #0000dd; font-weight: bold;">6</span>, HIGH);
}
<span style="color: #888888;">// LED 7</span>
<span style="color: #008800; font-weight: bold;">if</span> (StrContains(HTTP_req, <span style="background-color: #fff0f0;">"LED7=1"</span>)) {
LED_state[<span style="color: #0000dd; font-weight: bold;">7</span>] <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">1</span>; <span style="color: #888888;">// save LED state</span>
digitalWrite(<span style="color: #0000dd; font-weight: bold;">7</span>, LOW);
} <span style="color: #008800; font-weight: bold;">else</span> <span style="color: #008800; font-weight: bold;">if</span> (StrContains(HTTP_req, <span style="background-color: #fff0f0;">"LED7=0"</span>)) {
LED_state[<span style="color: #0000dd; font-weight: bold;">7</span>] <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">0</span>; <span style="color: #888888;">// save LED state</span>
digitalWrite(<span style="color: #0000dd; font-weight: bold;">7</span>, HIGH);
}
<span style="color: #888888;">// LED 9</span>
<span style="color: #008800; font-weight: bold;">if</span> (StrContains(HTTP_req, <span style="background-color: #fff0f0;">"LED9=1"</span>)) {
Serial.println(<span style="background-color: #fff0f0;">"Subindo"</span>);
digitalWrite(<span style="color: #0000dd; font-weight: bold;">47</span>, LOW);
digitalWrite(<span style="color: #0000dd; font-weight: bold;">49</span>, HIGH);
delay(<span style="color: #0000dd; font-weight: bold;">15500</span>);
digitalWrite(<span style="color: #0000dd; font-weight: bold;">47</span>, HIGH);
digitalWrite(<span style="color: #0000dd; font-weight: bold;">49</span>, HIGH);
}
<span style="color: #888888;">//led 8</span>
<span style="color: #008800; font-weight: bold;">if</span> (StrContains(HTTP_req, <span style="background-color: #fff0f0;">"LED8=1"</span>)) {
Serial.println(<span style="background-color: #fff0f0;">"Descendo"</span>);
digitalWrite(<span style="color: #0000dd; font-weight: bold;">47</span>, HIGH);
digitalWrite(<span style="color: #0000dd; font-weight: bold;">49</span>, LOW);
delay(<span style="color: #0000dd; font-weight: bold;">16500</span>);
digitalWrite(<span style="color: #0000dd; font-weight: bold;">47</span>, HIGH);
digitalWrite(<span style="color: #0000dd; font-weight: bold;">49</span>, HIGH);
}
<span style="color: #888888;">// LED 22 ventiladores</span>
<span style="color: #008800; font-weight: bold;">if</span> (StrContains(HTTP_req, <span style="background-color: #fff0f0;">"LED22=1"</span>)) {
Serial.println(<span style="background-color: #fff0f0;">"Ligando"</span>);
LED_state[<span style="color: #0000dd; font-weight: bold;">22</span>] <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">1</span>;
digitalWrite(<span style="color: #0000dd; font-weight: bold;">22</span>, HIGH);
} <span style="color: #008800; font-weight: bold;">else</span> <span style="color: #008800; font-weight: bold;">if</span> (StrContains(HTTP_req, <span style="background-color: #fff0f0;">"LED22=0"</span>)) {
Serial.println(<span style="background-color: #fff0f0;">"DesLigando"</span>);
LED_state[<span style="color: #0000dd; font-weight: bold;">22</span>] <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">0</span>;
digitalWrite(<span style="color: #0000dd; font-weight: bold;">22</span>, LOW);
}
<span style="color: #888888;">// LED 53 datashow</span>
<span style="color: #008800; font-weight: bold;">if</span> (StrContains(HTTP_req, <span style="background-color: #fff0f0;">"LED53=1"</span>)) {
Serial.println(<span style="background-color: #fff0f0;">"Tela"</span>);
digitalWrite(<span style="color: #0000dd; font-weight: bold;">53</span>, LOW);
delay(<span style="color: #0000dd; font-weight: bold;">150</span>);
digitalWrite(<span style="color: #0000dd; font-weight: bold;">53</span>, HIGH);
}
<span style="color: #888888;">// LED 31</span>
<span style="color: #008800; font-weight: bold;">if</span> (StrContains(HTTP_req, <span style="background-color: #fff0f0;">"LED31=1"</span>)) {
Serial.println(<span style="background-color: #fff0f0;">"Ligando porta 31"</span>);
LED_state[<span style="color: #0000dd; font-weight: bold;">31</span>] <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">1</span>; <span style="color: #888888;">// save LED state</span>
digitalWrite(<span style="color: #0000dd; font-weight: bold;">31</span>, HIGH);
} <span style="color: #008800; font-weight: bold;">else</span> <span style="color: #008800; font-weight: bold;">if</span> (StrContains(HTTP_req, <span style="background-color: #fff0f0;">"LED31=0"</span>)) {
LED_state[<span style="color: #0000dd; font-weight: bold;">31</span>] <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">0</span>; <span style="color: #888888;">// save LED state</span>
digitalWrite(<span style="color: #0000dd; font-weight: bold;">31</span>, LOW);
}
<span style="color: #888888;">// LED 33</span>
<span style="color: #008800; font-weight: bold;">if</span> (StrContains(HTTP_req, <span style="background-color: #fff0f0;">"LED33=1"</span>)) {
Serial.println(<span style="background-color: #fff0f0;">"Ligando porta 33"</span>);
LED_state[<span style="color: #0000dd; font-weight: bold;">33</span>] <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">1</span>; <span style="color: #888888;">// save LED state</span>
digitalWrite(<span style="color: #0000dd; font-weight: bold;">33</span>, HIGH);
} <span style="color: #008800; font-weight: bold;">else</span> <span style="color: #008800; font-weight: bold;">if</span> (StrContains(HTTP_req, <span style="background-color: #fff0f0;">"LED33=0"</span>)) {
LED_state[<span style="color: #0000dd; font-weight: bold;">33</span>] <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">0</span>; <span style="color: #888888;">// save LED state</span>
digitalWrite(<span style="color: #0000dd; font-weight: bold;">33</span>, LOW);
}
<span style="color: #888888;">// LED 35</span>
<span style="color: #008800; font-weight: bold;">if</span> (StrContains(HTTP_req, <span style="background-color: #fff0f0;">"LED35=1"</span>)) {
Serial.println(<span style="background-color: #fff0f0;">"Ligando porta 35"</span>);
LED_state[<span style="color: #0000dd; font-weight: bold;">35</span>] <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">1</span>; <span style="color: #888888;">// save LED state</span>
digitalWrite(<span style="color: #0000dd; font-weight: bold;">35</span>, HIGH);
} <span style="color: #008800; font-weight: bold;">else</span> <span style="color: #008800; font-weight: bold;">if</span> (StrContains(HTTP_req, <span style="background-color: #fff0f0;">"LED35=0"</span>)) {
LED_state[<span style="color: #0000dd; font-weight: bold;">35</span>] <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">0</span>; <span style="color: #888888;">// save LED state</span>
digitalWrite(<span style="color: #0000dd; font-weight: bold;">35</span>, LOW);
}
<span style="color: #888888;">// LED 37</span>
<span style="color: #008800; font-weight: bold;">if</span> (StrContains(HTTP_req, <span style="background-color: #fff0f0;">"LED37=1"</span>)) {
Serial.println(<span style="background-color: #fff0f0;">"Ligando porta 37"</span>);
LED_state[<span style="color: #0000dd; font-weight: bold;">37</span>] <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">1</span>; <span style="color: #888888;">// save LED state</span>
digitalWrite(<span style="color: #0000dd; font-weight: bold;">37</span>, HIGH);
} <span style="color: #008800; font-weight: bold;">else</span> <span style="color: #008800; font-weight: bold;">if</span> (StrContains(HTTP_req, <span style="background-color: #fff0f0;">"LED37=0"</span>)) {
LED_state[<span style="color: #0000dd; font-weight: bold;">37</span>] <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">0</span>; <span style="color: #888888;">// save LED state</span>
digitalWrite(<span style="color: #0000dd; font-weight: bold;">37</span>, LOW);
}
<span style="color: #888888;">// LED 39</span>
<span style="color: #008800; font-weight: bold;">if</span> (StrContains(HTTP_req, <span style="background-color: #fff0f0;">"LED39=1"</span>)) {
Serial.println(<span style="background-color: #fff0f0;">"Ligando porta 39"</span>);
LED_state[<span style="color: #0000dd; font-weight: bold;">39</span>] <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">1</span>; <span style="color: #888888;">// save LED state</span>
digitalWrite(<span style="color: #0000dd; font-weight: bold;">39</span>, HIGH);
} <span style="color: #008800; font-weight: bold;">else</span> <span style="color: #008800; font-weight: bold;">if</span> (StrContains(HTTP_req, <span style="background-color: #fff0f0;">"LED39=0"</span>)) {
LED_state[<span style="color: #0000dd; font-weight: bold;">39</span>] <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">0</span>; <span style="color: #888888;">// save LED state</span>
digitalWrite(<span style="color: #0000dd; font-weight: bold;">39</span>, LOW);
}
<span style="color: #888888;">//barra1</span>
<span style="color: #008800; font-weight: bold;">if</span> (StrContains(HTTP_req, <span style="background-color: #fff0f0;">"b1=0"</span>)) {
valorb1 <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">0</span>;
} <span style="color: #008800; font-weight: bold;">else</span> <span style="color: #008800; font-weight: bold;">if</span> (StrContains(HTTP_req, <span style="background-color: #fff0f0;">"b1=1"</span>)) {
valorb1 <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">28</span>;
} <span style="color: #008800; font-weight: bold;">else</span> <span style="color: #008800; font-weight: bold;">if</span> (StrContains(HTTP_req, <span style="background-color: #fff0f0;">"b1=2"</span>)) {
valorb1 <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">56</span>;
} <span style="color: #008800; font-weight: bold;">else</span> <span style="color: #008800; font-weight: bold;">if</span> (StrContains(HTTP_req, <span style="background-color: #fff0f0;">"b1=3"</span>)) {
valorb1 <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">84</span>;
} <span style="color: #008800; font-weight: bold;">else</span> <span style="color: #008800; font-weight: bold;">if</span> (StrContains(HTTP_req, <span style="background-color: #fff0f0;">"b1=4"</span>)) {
valorb1 <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">112</span>;
} <span style="color: #008800; font-weight: bold;">else</span> <span style="color: #008800; font-weight: bold;">if</span> (StrContains(HTTP_req, <span style="background-color: #fff0f0;">"b1=5"</span>)) {
valorb1 <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">140</span>;
} <span style="color: #008800; font-weight: bold;">else</span> <span style="color: #008800; font-weight: bold;">if</span> (StrContains(HTTP_req, <span style="background-color: #fff0f0;">"b1=6"</span>)) {
valorb1 <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">168</span>;
} <span style="color: #008800; font-weight: bold;">else</span> <span style="color: #008800; font-weight: bold;">if</span> (StrContains(HTTP_req, <span style="background-color: #fff0f0;">"b1=7"</span>)) {
valorb1 <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">196</span>;
} <span style="color: #008800; font-weight: bold;">else</span> <span style="color: #008800; font-weight: bold;">if</span> (StrContains(HTTP_req, <span style="background-color: #fff0f0;">"b1=8"</span>)) {
valorb1 <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">224</span>;
} <span style="color: #008800; font-weight: bold;">else</span> <span style="color: #008800; font-weight: bold;">if</span> (StrContains(HTTP_req, <span style="background-color: #fff0f0;">"b1=9"</span>)) {
valorb1 <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">255</span>;
}
analogWrite(<span style="color: #0000dd; font-weight: bold;">9</span>, valorb1);
}
<span style="color: #888888;">// send the XML file with analog values, switch status</span>
<span style="color: #888888;">// and LED status</span>
<span style="color: #333399; font-weight: bold;">void</span> <span style="color: #0066bb; font-weight: bold;">XML_response</span>(EthernetClient cl) {
<span style="color: #333399; font-weight: bold;">int</span> analog_val; <span style="color: #888888;">// stores value read from analog inputs</span>
<span style="color: #333399; font-weight: bold;">int</span> count; <span style="color: #888888;">// used by 'for' loops</span>
<span style="color: #333399; font-weight: bold;">int</span> sw_arr[] <span style="color: #333333;">=</span> {<span style="color: #0000dd; font-weight: bold;">2</span>, <span style="color: #0000dd; font-weight: bold;">3</span>, <span style="color: #0000dd; font-weight: bold;">5</span>}; <span style="color: #888888;">// pins interfaced to switches</span>
cl.println(<span style="background-color: #fff0f0;">"<?xml version = </span><span style="background-color: #fff0f0; color: #666666; font-weight: bold;">\"</span><span style="background-color: #fff0f0;">1.0</span><span style="background-color: #fff0f0; color: #666666; font-weight: bold;">\"</span><span style="background-color: #fff0f0;"> ?>"</span>);
cl.println(<span style="background-color: #fff0f0;">"<inputs>"</span>);
<span style="color: #888888;">// LED2</span>
cl.print(<span style="background-color: #fff0f0;">"<LED2>"</span>);
<span style="color: #008800; font-weight: bold;">if</span> (LED_state[<span style="color: #0000dd; font-weight: bold;">2</span>]) {
cl.print(<span style="background-color: #fff0f0;">"on"</span>);
} <span style="color: #008800; font-weight: bold;">else</span> {
cl.print(<span style="background-color: #fff0f0;">"off"</span>);
}
cl.println(<span style="background-color: #fff0f0;">"</LED2>"</span>);
<span style="color: #888888;">// LED3</span>
cl.print(<span style="background-color: #fff0f0;">"<LED3>"</span>);
<span style="color: #008800; font-weight: bold;">if</span> (LED_state[<span style="color: #0000dd; font-weight: bold;">3</span>]) {
cl.print(<span style="background-color: #fff0f0;">"on"</span>);
} <span style="color: #008800; font-weight: bold;">else</span> {
cl.print(<span style="background-color: #fff0f0;">"off"</span>);
}
cl.println(<span style="background-color: #fff0f0;">"</LED3>"</span>);
<span style="color: #888888;">// LED5</span>
cl.print(<span style="background-color: #fff0f0;">"<LED5>"</span>);
<span style="color: #008800; font-weight: bold;">if</span> (LED_state[<span style="color: #0000dd; font-weight: bold;">5</span>]) {
cl.print(<span style="background-color: #fff0f0;">"on"</span>);
} <span style="color: #008800; font-weight: bold;">else</span> {
cl.print(<span style="background-color: #fff0f0;">"off"</span>);
}
cl.println(<span style="background-color: #fff0f0;">"</LED5>"</span>);
<span style="color: #888888;">// LED6</span>
cl.print(<span style="background-color: #fff0f0;">"<LED6>"</span>);
<span style="color: #008800; font-weight: bold;">if</span> (LED_state[<span style="color: #0000dd; font-weight: bold;">6</span>]) {
cl.print(<span style="background-color: #fff0f0;">"on"</span>);
} <span style="color: #008800; font-weight: bold;">else</span> {
cl.print(<span style="background-color: #fff0f0;">"off"</span>);
}
cl.println(<span style="background-color: #fff0f0;">"</LED6>"</span>);
<span style="color: #888888;">// LED7</span>
cl.print(<span style="background-color: #fff0f0;">"<LED7>"</span>);
<span style="color: #008800; font-weight: bold;">if</span> (LED_state[<span style="color: #0000dd; font-weight: bold;">7</span>]) {
cl.print(<span style="background-color: #fff0f0;">"on"</span>);
} <span style="color: #008800; font-weight: bold;">else</span> {
cl.print(<span style="background-color: #fff0f0;">"off"</span>);
}
cl.println(<span style="background-color: #fff0f0;">"</LED7>"</span>);
<span style="color: #888888;">// LED22</span>
cl.print(<span style="background-color: #fff0f0;">"<LED22>"</span>);
<span style="color: #008800; font-weight: bold;">if</span> (LED_state[<span style="color: #0000dd; font-weight: bold;">22</span>]) {
cl.print(<span style="background-color: #fff0f0;">"on"</span>);
} <span style="color: #008800; font-weight: bold;">else</span> {
cl.print(<span style="background-color: #fff0f0;">"off"</span>);
}
cl.println(<span style="background-color: #fff0f0;">"</LED22>"</span>);
<span style="color: #888888;">// LED31</span>
cl.print(<span style="background-color: #fff0f0;">"<LED31>"</span>);
<span style="color: #008800; font-weight: bold;">if</span> (LED_state[<span style="color: #0000dd; font-weight: bold;">31</span>]) {
cl.print(<span style="background-color: #fff0f0;">"on"</span>);
} <span style="color: #008800; font-weight: bold;">else</span> {
cl.print(<span style="background-color: #fff0f0;">"off"</span>);
}
cl.println(<span style="background-color: #fff0f0;">"</LED31>"</span>);
<span style="color: #888888;">// LED33</span>
cl.print(<span style="background-color: #fff0f0;">"<LED33>"</span>);
<span style="color: #008800; font-weight: bold;">if</span> (LED_state[<span style="color: #0000dd; font-weight: bold;">33</span>]) {
cl.print(<span style="background-color: #fff0f0;">"on"</span>);
} <span style="color: #008800; font-weight: bold;">else</span> {
cl.print(<span style="background-color: #fff0f0;">"off"</span>);
}
cl.println(<span style="background-color: #fff0f0;">"</LED33>"</span>);
<span style="color: #888888;">// LED35</span>
cl.print(<span style="background-color: #fff0f0;">"<LED35>"</span>);
<span style="color: #008800; font-weight: bold;">if</span> (LED_state[<span style="color: #0000dd; font-weight: bold;">35</span>]) {
cl.print(<span style="background-color: #fff0f0;">"on"</span>);
} <span style="color: #008800; font-weight: bold;">else</span> {
cl.print(<span style="background-color: #fff0f0;">"off"</span>);
}
cl.println(<span style="background-color: #fff0f0;">"</LED35>"</span>);
<span style="color: #888888;">// LED37</span>
cl.print(<span style="background-color: #fff0f0;">"<LED37>"</span>);
<span style="color: #008800; font-weight: bold;">if</span> (LED_state[<span style="color: #0000dd; font-weight: bold;">37</span>]) {
cl.print(<span style="background-color: #fff0f0;">"on"</span>);
} <span style="color: #008800; font-weight: bold;">else</span> {
cl.print(<span style="background-color: #fff0f0;">"off"</span>);
}
cl.println(<span style="background-color: #fff0f0;">"</LED37>"</span>);
<span style="color: #888888;">// LED39</span>
cl.print(<span style="background-color: #fff0f0;">"<LED39>"</span>);
<span style="color: #008800; font-weight: bold;">if</span> (LED_state[<span style="color: #0000dd; font-weight: bold;">39</span>]) {
cl.print(<span style="background-color: #fff0f0;">"on"</span>);
} <span style="color: #008800; font-weight: bold;">else</span> {
cl.print(<span style="background-color: #fff0f0;">"off"</span>);
}
cl.println(<span style="background-color: #fff0f0;">"</LED39>"</span>);
<span style="color: #888888;">// B1</span>
<span style="color: #888888;">//cl.print("<B1>");</span>
<span style="color: #888888;">//Serial.println(analogRead(A2));</span>
<span style="color: #888888;">//int valor = analogRead(A2);</span>
<span style="color: #888888;">//cl.print(valor);</span>
<span style="color: #888888;">//cl.println("</B1>");</span>
<span style="color: #888888;">// B2</span>
<span style="color: #888888;">//cl.print("<B2>");</span>
<span style="color: #888888;">//int valor = analogRead(A3);</span>
<span style="color: #888888;">//cl.print(valor);</span>
<span style="color: #888888;">//cl.println("</B2>");</span>
<span style="color: #888888;">// B3</span>
<span style="color: #888888;">//cl.print("<B3>");</span>
<span style="color: #888888;">//valor = analogRead(A4);</span>
<span style="color: #888888;">//cl.print(valor);</span>
<span style="color: #888888;">//cl.println("</B3>");</span>
<span style="color: #888888;">// B4</span>
<span style="color: #888888;">//cl.print("<B4>");</span>
<span style="color: #888888;">// valor = analogRead(A5);</span>
<span style="color: #888888;">//cl.print(valor);</span>
<span style="color: #888888;">// cl.println("</B4>");</span>
<span style="color: #888888;">// B5</span>
<span style="color: #888888;">//cl.print("<B5>");</span>
<span style="color: #888888;">//valor = analogRead(A6);</span>
<span style="color: #888888;">//cl.print(valor);</span>
<span style="color: #888888;">//cl.println("</B5>");</span>
cl.print(<span style="background-color: #fff0f0;">"</inputs>"</span>);
}
<span style="color: #888888;">// sets every element of str to 0 (clears array)</span>
<span style="color: #333399; font-weight: bold;">void</span> <span style="color: #0066bb; font-weight: bold;">StrClear</span>(<span style="color: #333399; font-weight: bold;">char</span> <span style="color: #333333;">*</span>str, <span style="color: #333399; font-weight: bold;">char</span> length)
{
<span style="color: #008800; font-weight: bold;">for</span> (<span style="color: #333399; font-weight: bold;">int</span> i <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">0</span>; i <span style="color: #333333;"><</span> length; i<span style="color: #333333;">++</span>) {
str[i] <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">0</span>;
}
}
<span style="color: #888888;">// searches for the string sfind in the string str</span>
<span style="color: #888888;">// returns 1 if string found</span>
<span style="color: #888888;">// returns 0 if string not found</span>
<span style="color: #333399; font-weight: bold;">char</span> <span style="color: #0066bb; font-weight: bold;">StrContains</span>(<span style="color: #333399; font-weight: bold;">char</span> <span style="color: #333333;">*</span>str, <span style="color: #333399; font-weight: bold;">char</span> <span style="color: #333333;">*</span>sfind)
{
<span style="color: #333399; font-weight: bold;">char</span> found <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">0</span>;
<span style="color: #333399; font-weight: bold;">char</span> index <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">0</span>;
<span style="color: #333399; font-weight: bold;">char</span> len;
len <span style="color: #333333;">=</span> strlen(str);
<span style="color: #008800; font-weight: bold;">if</span> (strlen(sfind) <span style="color: #333333;">></span> len) {
<span style="color: #008800; font-weight: bold;">return</span> <span style="color: #0000dd; font-weight: bold;">0</span>;
}
<span style="color: #008800; font-weight: bold;">while</span> (index <span style="color: #333333;"><</span> len) {
<span style="color: #008800; font-weight: bold;">if</span> (str[index] <span style="color: #333333;">==</span> sfind[found]) {
found<span style="color: #333333;">++</span>;
<span style="color: #008800; font-weight: bold;">if</span> (strlen(sfind) <span style="color: #333333;">==</span> found) {
<span style="color: #008800; font-weight: bold;">return</span> <span style="color: #0000dd; font-weight: bold;">1</span>;
}
}
<span style="color: #008800; font-weight: bold;">else</span> {
found <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">0</span>;
}
index<span style="color: #333333;">++</span>;
}
<span style="color: #008800; font-weight: bold;">return</span> <span style="color: #0000dd; font-weight: bold;">0</span>;
}
</pre>
</div>
</div>
</div>
</div>
</div>
</form>
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<br />
<b>Fonte</b>:https://startingelectronics.org/tutorials/arduino/ethernet-shield-web-server-tutorial/web-server-read-switch-using-AJAX/ <br />
<br />
<br />Uberdam Cavalettihttp://www.blogger.com/profile/04292374654714665881noreply@blogger.com0tag:blogger.com,1999:blog-5580540121626250840.post-90350336796849771912016-09-19T19:00:00.000-03:002016-09-19T19:00:14.179-03:00Como saber o tempo em que você gasta na web ??<br />
<br />
Olá leitores, você já se perguntou quando tempo você fica desperdiçando na internet, em sites que não te trazem nada de bom.?<br />
<br />
Já tentou somar todo esse tempo gasto em um mês para ver o número exorbitante ? <br />
<br />
Pois é, então compartilhamos da mesma ideia.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwzQuN7L-k1hT-8uxHM9-SnEB1oBK1bTFJt6W6yDkDXSz1D1ez_Gp3V2sYKwWBFpfNLGlrJ088cxwdyl8bjLQo_mJS30vFeU04i9S3Wvwp9_XcpoyhpLozYXWnsPtn8NSAsGCZsVutLUsv/s1600/images.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="293" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgwzQuN7L-k1hT-8uxHM9-SnEB1oBK1bTFJt6W6yDkDXSz1D1ez_Gp3V2sYKwWBFpfNLGlrJ088cxwdyl8bjLQo_mJS30vFeU04i9S3Wvwp9_XcpoyhpLozYXWnsPtn8NSAsGCZsVutLUsv/s320/images.jpg" width="320" /> </a></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
Para ajudar a esclarecer essa dúvida segue um plugin muito interessante que utilizo no meu navegador da raposa vermelha , <b>Firefox. </b>O nome do plugin é <a href="https://addons.mozilla.org/en-US/firefox/addon/mind-the-time/" target="_blank">Mind in Time</a>.</div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
O plugin é interessante pois agrupa esses dados diariamente, semanalmente e mensalmente conforme imagem abaixo, e acredite você vai se espantar com a quantidade de horas, muitas delas vendo coisa que não presta na internet.</div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjz_9qv7-peiQytBGeE_seaiMN2sAhqlcE44vjPM7V-wkQd0skYhAPpYADJ8HmY-7vMV7cQCNO-qttUMuflZvNlHn8BSoQh9Ye3e8VnnF11MddH3CH44PQbCP5GaKpHFnWO0V4dHt1j8XEl/s1600/117899.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="225" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjz_9qv7-peiQytBGeE_seaiMN2sAhqlcE44vjPM7V-wkQd0skYhAPpYADJ8HmY-7vMV7cQCNO-qttUMuflZvNlHn8BSoQh9Ye3e8VnnF11MddH3CH44PQbCP5GaKpHFnWO0V4dHt1j8XEl/s400/117899.png" width="400" /></a></div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
Ah, e para o Google<b> </b>Chrome também existe um plugin parecido chamado <a href="https://chrome.google.com/webstore/detail/time-tracker/mokmnbikneoaenmckfmgjgjimphfojkd" target="_blank">Time Tracker</a><b>.</b></div>
<div class="separator" style="clear: both; text-align: justify;">
<b><br /></b></div>
<div class="separator" style="clear: both; text-align: justify;">
Até mais<b><br /></b></div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<div class="separator" style="clear: both; text-align: justify;">
<br /></div>
<br />Uberdam Cavalettihttp://www.blogger.com/profile/04292374654714665881noreply@blogger.com0tag:blogger.com,1999:blog-5580540121626250840.post-86711418161155913942016-07-04T16:54:00.000-03:002020-02-25T19:20:14.022-03:00Ligando motor monofásico com Arduino<br />
<br />
Ola pessoal, hoje vamos aprender a ligar um motor monofásico com Arduino.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj866YZ7Wo9cYQWccYwW7B3pHSPhOjLvHfYf-SOMuTh4YmDjOqNEZMHpeLbIRjStp5OpuDD9Ezf9nzlLidmCoVuxFxnwie71wjsdPvrJPnU0lLM0co9txW3-j4P7c122N5WnsYc5xU7df4a/s1600/Motor+Arduino.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="264" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj866YZ7Wo9cYQWccYwW7B3pHSPhOjLvHfYf-SOMuTh4YmDjOqNEZMHpeLbIRjStp5OpuDD9Ezf9nzlLidmCoVuxFxnwie71wjsdPvrJPnU0lLM0co9txW3-j4P7c122N5WnsYc5xU7df4a/s320/Motor+Arduino.png" width="320" /></a></div>
<br />
<div style="text-align: center;">
<span style="color: red;"><span style="font-size: x-large;">Cuidado, você está trabalhando com tensões altas, que podem ocasionar danos e choques elétricos</span></span></div>
<br />
<br />
<b>Itens que você vai precisar</b><br />
<br />
1 Arduino - 70 reais<br />
1 Relé 250V 10A - 15 reais<br />
1 <a href="https://pt.wikipedia.org/wiki/Contator">Contator - 40 reais</a><br />
1 Motor monofásico (Utilizei marca Weg) - 600 reais<br />
<br />
<br />
<a name='more'></a><br /><br />
<h4>
<span style="color: red;"><a href="https://go.hotmart.com/H22565755Q" target="_blank">Compre </a>um curso agora e aprenda a montar seu projetos com Arduino.</span></h4>
<br />
<b>Ligação </b><br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9jiqVuG-C415dzadcO_-Ywih_JXpFelxfe5CagTvctwsD2e6q0H9CSQnpVE3HctCFhqcYB0nQiDnRiFF0lhiVwZe5I28H9OX0sBzkWuVdhLueitEgB2sUun44Fk27UwU6qdnasvyo-QWD/s1600/Arduino-Motor+Monof%25C3%25A1sico.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="212" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9jiqVuG-C415dzadcO_-Ywih_JXpFelxfe5CagTvctwsD2e6q0H9CSQnpVE3HctCFhqcYB0nQiDnRiFF0lhiVwZe5I28H9OX0sBzkWuVdhLueitEgB2sUun44Fk27UwU6qdnasvyo-QWD/s400/Arduino-Motor+Monof%25C3%25A1sico.png" width="400" /></a></div>
<br />
<div style="text-align: center;">
<b> </b></div>
<br />
<br />
<a href="https://www.blogger.com/blogger.g?blogID=5580540121626250840" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><br /></a><a href="https://www.blogger.com/blogger.g?blogID=5580540121626250840" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><br /></a><a href="https://www.blogger.com/blogger.g?blogID=5580540121626250840" imageanchor="1" style="clear: left; float: left; margin-bottom: 1em; margin-right: 1em;"><br /></a><br />
<b>Ligação do motor.</b><br />
<br />
<b> </b>O motor monofásico utilizado aceita tensão de 127 /220 Volts, o processo para configurá-lo é simples, basta seguir o próprio manual do motor. Segue abaixo uma tabela de ligação dos fios para acioná-lo em 127 ou 220 volts.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHInHbqWQYTha3RVDFJkmQmbjMJJ1t_u90nRaXHOQVCav8gPxHssDl64dFYgrYzTawDrbkloRNx80rFlT1Xxtzmmoj-c1Z2uO4-tisl2pwhhdG3lxzzZOef3Z3byakneFntcROlCizLPaT/s1600/Ligacao+motor.png" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="144" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHInHbqWQYTha3RVDFJkmQmbjMJJ1t_u90nRaXHOQVCav8gPxHssDl64dFYgrYzTawDrbkloRNx80rFlT1Xxtzmmoj-c1Z2uO4-tisl2pwhhdG3lxzzZOef3Z3byakneFntcROlCizLPaT/s320/Ligacao+motor.png" width="320" /></a></div>
<br />
<br />
<br />
<br />
<br />
Tentarei explicar aqui a ligação dos fios, mas acredito que é interessante a presença de um profissional da área de elétrica nesse processo e na ligação dos fios. Utilizar uma chave de teste para testar todas as ligações<br />
<br />
Os terminais <b>L1 </b>e <b>L2 </b>são os terminais onde será ligado <b>Fase </b>e <b>Neutro</b><br />
<br />
Para ligar 220 V (Maior tensão)<br />
- conecte a fiação 5 e 1 onde ficará ligado a <b>Fase</b><br />
<b> - </b>junte os fios 2,3,8 esses fios não serão utilizados<br />
- Fio 4, onde será ligado o <b>neutro</b><br />
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<div class="separator" style="clear: both; text-align: center;">
</div>
<br />
<br />
<a href="https://www.blogger.com/blogger.g?blogID=5580540121626250840" imageanchor="1" style="clear: right; float: right; margin-bottom: 1em; margin-left: 1em;"></a><b> </b><br />
<b> Código Fonte para arduíno</b><br />
<br />
<br />
<!-- HTML generated using hilite.me --><br />
<div style="background: #ffffff; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;">
<pre style="line-height: 125%; margin: 0;">void setup() {
pinMode(<span style="color: #0000dd; font-weight: bold;">7</span>, OUTPUT);
}
void loop() {
digitalWrite(<span style="color: #0000dd; font-weight: bold;">7</span>, LOW);
delay(<span style="color: #0000dd; font-weight: bold;">2000</span>);
digitalWrite(<span style="color: #0000dd; font-weight: bold;">7</span>, HIGH);
delay(<span style="color: #0000dd; font-weight: bold;">2000</span>);
}
</pre>
</div>
<br />
<br />Uberdam Cavalettihttp://www.blogger.com/profile/04292374654714665881noreply@blogger.com2tag:blogger.com,1999:blog-5580540121626250840.post-82864225808956986832016-05-05T15:28:00.000-03:002016-05-05T15:50:57.657-03:00Como tocar Fear of the Dark em seu Arduíno<div class="separator" style="clear: both; text-align: center;">
</div>
<div style="margin-left: 1em; margin-right: 1em;">
</div>
<br />
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
Todo mundo gosta de música, Isso é fato, mas algo realmente bom de ouvir é solo ou riffs, seja a música do tipo que for. Quem "ouve" a música sabe o que estou falando.<a href="http://cdn.gamerant.com/wp-content/uploads/Iron-Maiden-Eddie-700x389.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img alt="" border="0" class="irc_mi iA6ZRA1NI39I-pQOPx8XEepE" src="http://cdn.gamerant.com/wp-content/uploads/Iron-Maiden-Eddie-700x389.jpg" height="221" style="margin-top: 76px;" width="400" /></a></div>
<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen='allowfullscreen' webkitallowfullscreen='webkitallowfullscreen' mozallowfullscreen='mozallowfullscreen' width='320' height='266' src='https://www.blogger.com/video.g?token=AD6v5dw06SE6_2pld6Wxat7thhMMDKXIfQT_nz22xY8IM7TVSivPh2B_EJXZa8O-Idk3vZOfWMblrvKW5CCWHIk19w' class='b-hbp-video b-uploaded' frameborder='0'></iframe></div>
<br />
<br />
<br />
<div style="text-align: center;">
Vamos parando de enrolação e vamos logo para a parte da programação de seu Arduíno junto com o buzzer para tocar o solo da música Fear of the Dark da banda Iron Maiden. Ainda tem alguns probleminhas, mas dá para ouvir muito bem.<br />
<br />
<img alt="" class="irc_mi iDSZGrVfeDOk-pQOPx8XEepE" src="http://api.ning.com/files/ogRQRDkJ4jAJiKKQTdgenvEv2AAlA2G1J6MIMldNuJ3JLt2U*eCWlHTEuKB8FJsvPo3xAz2lRAVjZ4014GBlfy11Oa1YL3Pc/ArduinoUno_R3_Front.jpg" height="221" style="margin-top: 0px;" width="320" /><br />
<br />
<br />
Faça o download <a href="http://www.4shared.com/rar/kVScsgmeba/Fear.html">aqui </a>do código fonte<br />
<br />
<div style="text-align: left;">
Arquivo principal </div>
</div>
<!-- HTML generated using hilite.me --><br />
<div style="background: #ffffff; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;">
<pre style="line-height: 125%; margin: 0;"><span style="color: #557799;">#include "pitches.h"</span>
<span style="color: #557799;">#define NO_SOUND 0</span>
<span style="color: #333399; font-weight: bold;">int</span> melodia[] <span style="color: #333333;">=</span> {NOTE_D6,NOTE_A5,NOTE_A5,NOTE_D6,NOTE_D6,NOTE_E6,NOTE_E6,NOTE_F6,NOTE_F6,NOTE_E6,NOTE_E6,NOTE_D6,NOTE_D6,NOTE_E6,NOTE_E6,NOTE_C6,NOTE_G5,NOTE_G5,NOTE_C6,NOTE_C6,NOTE_D6,NOTE_D6,NOTE_E6,NOTE_E6,NOTE_D6,NOTE_D6,NOTE_C6,NOTE_C6,NOTE_E6,NOTE_E6,NOTE_C6,NOTE_C6,NOTE_D6,NOTE_A5,NOTE_A5,NOTE_D6,NOTE_D6,NOTE_E6,NOTE_E6,NOTE_F6,NOTE_F6,NOTE_E6,NOTE_E6,NOTE_D6,NOTE_D6,NOTE_E6,NOTE_E6,NOTE_C6,NOTE_G5,NOTE_G5,NOTE_C6,NOTE_C6,NOTE_D6,NOTE_D6,NOTE_E6,NOTE_E6,NOTE_D6,NOTE_D6,NOTE_C6,NOTE_C6,NOTE_E6,NOTE_E6,NOTE_C6,NOTE_C6,NOTE_A5,NOTE_A5,NOTE_E5,NOTE_E5,NOTE_A5,NOTE_A5,NOTE_B5,NOTE_B5,NOTE_C6,NOTE_C6,NOTE_B5,NOTE_B5,NOTE_A5,NOTE_A5,NOTE_B5,NOTE_B5,NOTE_A5,NOTE_A5,NOTE_D5,NOTE_D5,NOTE_G5,NOTE_G5,NOTE_A5,NOTE_A5,NOTE_B5,NOTE_B5,NOTE_A5,NOTE_A5,NOTE_G5,NOTE_G5,NOTE_B5,NOTE_G5,NOTE_A5,NOTE_A5,NOTE_E5,NOTE_E5,NOTE_A5,NOTE_A5,NOTE_B5,NOTE_B5,NOTE_C6,NOTE_C6,NOTE_B5,NOTE_B5,NOTE_A5,NOTE_A5,NOTE_B5,NOTE_B5,NOTE_F5,NOTE_F5,NOTE_D5,NOTE_D5,NOTE_F5,NOTE_F5,NOTE_A5,NOTE_A5,NOTE_G5,NOTE_G5,NOTE_F5,NOTE_F5,NOTE_G5,NOTE_F5} ;
<span style="color: #333399; font-weight: bold;">int</span> tempoNot[] <span style="color: #333333;">=</span> { <span style="color: #0000dd; font-weight: bold;">2</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">2</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">2</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">2</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span> , <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>, <span style="color: #0000dd; font-weight: bold;">4</span>};<span style="color: #888888;">// Duração d Not: Colcheia:8; Semínima: 4; Mínima:2; Semibreve:1</span>
<span style="color: #008800; font-weight: bold;">const</span> <span style="color: #333399; font-weight: bold;">int</span> compso <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">550</span>; <span style="color: #888888;">// Altera o compso da música </span>
<span style="color: #333399; font-weight: bold;">void</span> <span style="color: #0066bb; font-weight: bold;">setup</span>() {
<span style="color: #008800; font-weight: bold;">for</span> (<span style="color: #333399; font-weight: bold;">int</span> Nota <span style="color: #333333;">=</span> <span style="color: #0000dd; font-weight: bold;">0</span>; Nota <span style="color: #333333;"><</span> <span style="color: #0000dd; font-weight: bold;">128</span>; Nota<span style="color: #333333;">++</span>) {<span style="color: #888888;">//o número 80 indica quant not tem a nossa matriz.</span>
<span style="color: #333399; font-weight: bold;">int</span> tempo <span style="color: #333333;">=</span> compso<span style="color: #333333;">/</span>tempoNot[Nota]; <span style="color: #888888;">//Tempo = compso dividido pela indicação da matriz tempoNot.</span>
tone(<span style="color: #0000dd; font-weight: bold;">2</span>, melodia[Nota],tempo); <span style="color: #888888;">//Toca a nota indicada pela matriz melodia durante o tempo.</span>
<span style="color: #888888;">// Para distinguir not adicionamos um tempo entre elas (tempo da nota + 20%).</span>
delay(tempo<span style="color: #333333;">*</span><span style="color: #6600ee; font-weight: bold;">1.2</span>);
}
}
<span style="color: #333399; font-weight: bold;">void</span> <span style="color: #0066bb; font-weight: bold;">loop</span>(){
<span style="color: #888888;">//Não é necessária a repetição pois a mesma será feita pelo botão Reset.</span>
}
</pre>
</div>
<br />
<span style="color: #557799;">Arquivo </span><span style="color: #557799;">pitches.h</span><br />
<!-- HTML generated using hilite.me --><br />
<div style="background: #ffffff; border-width: 0.1em 0.1em 0.1em 0.8em; border: solid gray; overflow: auto; padding: 0.2em 0.6em; width: auto;">
<pre style="line-height: 125%; margin: 0;"><span style="color: #888888;">/*************************************************</span>
<span style="color: #888888;"> * Public Constants</span>
<span style="color: #888888;"> *************************************************/</span>
<span style="color: #557799;">#define NOTE_B0 31</span>
<span style="color: #557799;">#define NOTE_C1 33</span>
<span style="color: #557799;">#define NOTE_CS1 35</span>
<span style="color: #557799;">#define NOTE_D1 37</span>
<span style="color: #557799;">#define NOTE_DS1 39</span>
<span style="color: #557799;">#define NOTE_E1 41</span>
<span style="color: #557799;">#define NOTE_F1 44</span>
<span style="color: #557799;">#define NOTE_FS1 46</span>
<span style="color: #557799;">#define NOTE_G1 49</span>
<span style="color: #557799;">#define NOTE_GS1 52</span>
<span style="color: #557799;">#define NOTE_A1 55</span>
<span style="color: #557799;">#define NOTE_AS1 58</span>
<span style="color: #557799;">#define NOTE_B1 62</span>
<span style="color: #557799;">#define NOTE_C2 65</span>
<span style="color: #557799;">#define NOTE_CS2 69</span>
<span style="color: #557799;">#define NOTE_D2 73</span>
<span style="color: #557799;">#define NOTE_DS2 78</span>
<span style="color: #557799;">#define NOTE_E2 82</span>
<span style="color: #557799;">#define NOTE_F2 87</span>
<span style="color: #557799;">#define NOTE_FS2 93</span>
<span style="color: #557799;">#define NOTE_G2 98</span>
<span style="color: #557799;">#define NOTE_GS2 104</span>
<span style="color: #557799;">#define NOTE_A2 110</span>
<span style="color: #557799;">#define NOTE_AS2 117</span>
<span style="color: #557799;">#define NOTE_B2 123</span>
<span style="color: #557799;">#define NOTE_C3 131</span>
<span style="color: #557799;">#define NOTE_CS3 139</span>
<span style="color: #557799;">#define NOTE_D3 147</span>
<span style="color: #557799;">#define NOTE_DS3 156</span>
<span style="color: #557799;">#define NOTE_E3 165</span>
<span style="color: #557799;">#define NOTE_F3 175</span>
<span style="color: #557799;">#define NOTE_FS3 185</span>
<span style="color: #557799;">#define NOTE_G3 196</span>
<span style="color: #557799;">#define NOTE_GS3 208</span>
<span style="color: #557799;">#define NOTE_A3 220</span>
<span style="color: #557799;">#define NOTE_AS3 233</span>
<span style="color: #557799;">#define NOTE_B3 247</span>
<span style="color: #557799;">#define NOTE_C4 262</span>
<span style="color: #557799;">#define NOTE_CS4 277</span>
<span style="color: #557799;">#define NOTE_D4 294</span>
<span style="color: #557799;">#define NOTE_DS4 311</span>
<span style="color: #557799;">#define NOTE_E4 330</span>
<span style="color: #557799;">#define NOTE_F4 349</span>
<span style="color: #557799;">#define NOTE_FS4 370</span>
<span style="color: #557799;">#define NOTE_G4 392</span>
<span style="color: #557799;">#define NOTE_GS4 415</span>
<span style="color: #557799;">#define NOTE_A4 440</span>
<span style="color: #557799;">#define NOTE_AS4 466</span>
<span style="color: #557799;">#define NOTE_B4 494</span>
<span style="color: #557799;">#define NOTE_C5 523</span>
<span style="color: #557799;">#define NOTE_CS5 554</span>
<span style="color: #557799;">#define NOTE_D5 587</span>
<span style="color: #557799;">#define NOTE_DS5 622</span>
<span style="color: #557799;">#define NOTE_E5 659</span>
<span style="color: #557799;">#define NOTE_F5 698</span>
<span style="color: #557799;">#define NOTE_FS5 740</span>
<span style="color: #557799;">#define NOTE_G5 784</span>
<span style="color: #557799;">#define NOTE_GS5 831</span>
<span style="color: #557799;">#define NOTE_A5 880</span>
<span style="color: #557799;">#define NOTE_AS5 932</span>
<span style="color: #557799;">#define NOTE_B5 988</span>
<span style="color: #557799;">#define NOTE_C6 1047</span>
<span style="color: #557799;">#define NOTE_CS6 1109</span>
<span style="color: #557799;">#define NOTE_D6 1175</span>
<span style="color: #557799;">#define NOTE_DS6 1245</span>
<span style="color: #557799;">#define NOTE_E6 1319</span>
<span style="color: #557799;">#define NOTE_F6 1397</span>
<span style="color: #557799;">#define NOTE_FS6 1480</span>
<span style="color: #557799;">#define NOTE_G6 1568</span>
<span style="color: #557799;">#define NOTE_GS6 1661</span>
<span style="color: #557799;">#define NOTE_A6 1760</span>
<span style="color: #557799;">#define NOTE_AS6 1865</span>
<span style="color: #557799;">#define NOTE_B6 1976</span>
<span style="color: #557799;">#define NOTE_C7 2093</span>
<span style="color: #557799;">#define NOTE_CS7 2217</span>
<span style="color: #557799;">#define NOTE_D7 2349</span>
<span style="color: #557799;">#define NOTE_DS7 2489</span>
<span style="color: #557799;">#define NOTE_E7 2637</span>
<span style="color: #557799;">#define NOTE_F7 2794</span>
<span style="color: #557799;">#define NOTE_FS7 2960</span>
<span style="color: #557799;">#define NOTE_G7 3136</span>
<span style="color: #557799;">#define NOTE_GS7 3322</span>
<span style="color: #557799;">#define NOTE_A7 3520</span>
<span style="color: #557799;">#define NOTE_AS7 3729</span>
<span style="color: #557799;">#define NOTE_B7 3951</span>
<span style="color: #557799;">#define NOTE_C8 4186</span>
<span style="color: #557799;">#define NOTE_CS8 4435</span>
<span style="color: #557799;">#define NOTE_D8 4699</span>
<span style="color: #557799;">#define NOTE_DS8 4978</span>
</pre>
</div>
<div style="text-align: center;">
<br /></div>
<div style="text-align: center;">
<br /></div>
Uberdam Cavalettihttp://www.blogger.com/profile/04292374654714665881noreply@blogger.com0tag:blogger.com,1999:blog-5580540121626250840.post-85444624934508000032016-03-16T14:07:00.000-03:002016-03-16T14:25:18.905-03:00Flubaroo - Correção automática de provas<h3>
<span class="mw-headline" id="Crie_a_avalia.C3.A7.C3.A3o_no_Formul.C3.A1rio"><span style="font-weight: normal;">Todo professor sabe que a tarefa mais chata é corrigir provas, além disso perder-se um tempo enorme.. Pois bem, vamos parar de lenga-lenga e ir direto para a mão na massa.</span></span></h3>
<h3>
<span class="mw-headline" id="Crie_a_avalia.C3.A7.C3.A3o_no_Formul.C3.A1rio"><span style="font-weight: normal;">Para que gosta de vídeos, segue um vídeo do professor Sílvio Rocha, que explica também como criar uma avaliação.</span></span></h3>
<h3>
<span class="mw-headline" id="Crie_a_avalia.C3.A7.C3.A3o_no_Formul.C3.A1rio"><span style="font-weight: normal;"> </span></span></h3>
<div class="separator" style="clear: both; text-align: center;">
<iframe allowfullscreen="" class="YOUTUBE-iframe-video" data-thumbnail-src="https://i.ytimg.com/vi/DUCkOZXkYoU/0.jpg" frameborder="0" height="266" src="https://www.youtube.com/embed/DUCkOZXkYoU?feature=player_embedded" width="320"></iframe></div>
<h3>
<span class="mw-headline" id="Crie_a_avalia.C3.A7.C3.A3o_no_Formul.C3.A1rio"><span style="font-weight: normal;"> </span></span></h3>
<h3>
<span class="mw-headline" id="Crie_a_avalia.C3.A7.C3.A3o_no_Formul.C3.A1rio"><span style="font-weight: normal;"> </span></span></h3>
<h3>
<span class="mw-headline" id="Crie_a_avalia.C3.A7.C3.A3o_no_Formul.C3.A1rio"><span style="font-weight: normal;"> </span></span></h3>
<h3>
<span class="mw-headline" id="Crie_a_avalia.C3.A7.C3.A3o_no_Formul.C3.A1rio">Crie a avaliação no Formulário</span></h3>
<ul>
<li> Primeiramente, é preciso criar a prova/avaliação nos formulários Google.
</li>
<li> Neste formulário, procure fazer as perguntas do tipo "Múltipla escolha"
</li>
<li> Além disso, é obrigatório ter os campos: <b>Nome</b> e <b>E-mail</b>.
</li>
</ul>
<dl><dd>
<dl><dd><i>Obs. Se no formulário for marcada a opção "Exigir login de Centro
Tecnológico Frederico Jorge Logemann para ver este formulário" o e-mail
será coletado automaticamente então não precisará criar um campo para
ele no formulário.</i>
</dd></dl>
</dd></dl>
<ul>
<li> Se você não lembra como se cria um formulário, <a href="http://wiki.fahor.com.br/Criar_um_Formul%C3%A1rio" title="Criar um Formulário"> clique aqui</a> para ver o manual.
</li>
</ul>
<h3>
<span class="mw-headline" id="Responda_o_Gabarito">Responda o Gabarito</span></h3>
<ul>
<li> Você precisa responder duas vezes o formulário. Uma vez com as
respostas certas para dar a referência ao gabarito e outra para poder
ativar o Flubaroo (Ele não irá rodar se não houver no mínimo 2
respostas):
</li>
</ul>
<dl><dd><a class="image" href="http://wiki.fahor.com.br/Arquivo:ClipCapIt-150903-165745.PNG"><img alt="ClipCapIt-150903-165745.PNG" src="http://wiki.fahor.com.br/images/4/44/ClipCapIt-150903-165745.PNG" height="295" width="400" /></a>
</dd></dl>
<h3>
<span class="mw-headline" id="Instale_o_complemento_do_Flubaroo">Instale o complemento do Flubaroo</span></h3>
<ul>
<li> Vá até a planilha de respostas do formulário, clique em <b>[Complementos] > [Instalar complementos]</b>
</li>
</ul>
<dl><dd><a class="image" href="http://wiki.fahor.com.br/Arquivo:ClipCapIt-150903-163656.PNG"><img alt="ClipCapIt-150903-163656.PNG" src="http://wiki.fahor.com.br/images/b/b0/ClipCapIt-150903-163656.PNG" height="150" width="400" /></a>
</dd></dl>
<ul>
<li> Na tela que abrir, pesquise por <b>Flubaroo</b>. Serão listados os complementos que corresponderem à pesquisa, então clique em <b>[+ GRÁTIS]</b> ao lado do complemente Flubaroo.
</li>
</ul>
<dl><dd><a class="image" href="http://wiki.fahor.com.br/Arquivo:ClipCapIt-150903-163928.PNG"><img alt="ClipCapIt-150903-163928.PNG" src="http://wiki.fahor.com.br/images/c/c5/ClipCapIt-150903-163928.PNG" height="108" width="400" /></a>
</dd></dl>
<ul>
<li> Na tela que abrir, clique em <b>[Aceitar]</b>:
</li>
</ul>
<dl><dd><a class="image" href="http://wiki.fahor.com.br/Arquivo:ClipCapIt-150903-164037.PNG"><img alt="ClipCapIt-150903-164037.PNG" src="http://wiki.fahor.com.br/images/7/73/ClipCapIt-150903-164037.PNG" height="374" width="400" /></a>
</dd></dl>
<ul>
<li> Clique em <b>[OK]</b> na caixa de confirmação da instalação:
</li>
</ul>
<dl><dd><a class="image" href="http://wiki.fahor.com.br/Arquivo:ClipCapIt-150903-164127.PNG"><img alt="ClipCapIt-150903-164127.PNG" src="http://wiki.fahor.com.br/images/f/ff/ClipCapIt-150903-164127.PNG" height="220" width="400" /></a>
</dd></dl>
<h3>
<span class="mw-headline" id="Altere_a_linguagem_do_Flubaroo">Altere a linguagem do Flubaroo</span></h3>
<ul>
<li> O complemento vem, por padrão, em inglês, mas você pode alterar isso se quiser.
</li>
<li> Clique em <b>[Complementos] > [Flubaroo] > [Advanced] > [Set Language]</b>:
</li>
</ul>
<dl><dd><a class="image" href="http://wiki.fahor.com.br/Arquivo:ClipCapIt-150903-164337.PNG"><img alt="ClipCapIt-150903-164337.PNG" src="http://wiki.fahor.com.br/images/7/73/ClipCapIt-150903-164337.PNG" height="133" width="400" /></a>
</dd></dl>
<ul>
<li> Na caixa que abrir, selecione o idioma e clique em <b>[Continue]</b>:
</li>
</ul>
<dl><dd><a class="image" href="http://wiki.fahor.com.br/Arquivo:ClipCapIt-150903-164536.PNG"><img alt="ClipCapIt-150903-164536.PNG" src="http://wiki.fahor.com.br/images/f/f3/ClipCapIt-150903-164536.PNG" height="198" width="400" /></a>
</dd></dl>
<h3>
<span class="mw-headline" id="Habilitar_o_Flubaroo">Habilitar o Flubaroo</span></h3>
<ul>
<li> Após responder o formulário com o Gabrito e ter recebido, no mínimo, 2 respostas é preciso habilitar o Flubaroo.
</li>
<li> Dentro da planilha de respostas, clique em <b>[Complementos] > [Fubaroo] > [Enable Flubaroo in this sheet]:</b>
</li>
</ul>
<dl><dd><a class="image" href="http://wiki.fahor.com.br/Arquivo:ClipCapIt-150903-170450.PNG"><img alt="ClipCapIt-150903-170450.PNG" src="http://wiki.fahor.com.br/images/8/89/ClipCapIt-150903-170450.PNG" height="116" width="400" /></a>
</dd></dl>
<ul>
<li> Na tela de confirmação, clique em <b>[OK]</b>:
</li>
</ul>
<dl><dd><a class="image" href="http://wiki.fahor.com.br/Arquivo:ClipCapIt-150903-170652.PNG"><img alt="ClipCapIt-150903-170652.PNG" src="http://wiki.fahor.com.br/images/7/7d/ClipCapIt-150903-170652.PNG" height="133" width="400" /></a>
</dd></dl>
<h3>
<span class="mw-headline" id="Gerar_resultados_.2F_Corrigir">Gerar resultados / Corrigir</span></h3>
<ul>
<li> Para gerar os resultados através do Flubaroo, dentro da planilha de respostas, clique em <b>[Complementos] > [Flubaroo] > [Classificar tarefa]:</b>
</li>
</ul>
<dl><dd><a class="image" href="http://wiki.fahor.com.br/Arquivo:ClipCapIt-150903-170948.PNG"><img alt="ClipCapIt-150903-170948.PNG" src="http://wiki.fahor.com.br/images/3/39/ClipCapIt-150903-170948.PNG" height="137" width="400" /></a>
</dd></dl>
<ul>
<li>Na tela que abrir, faça as seguintes definições:
</li>
</ul>
<dl><dd><b>(1)</b> Defina o nome e e-mail do aluno como <b>[Identifica o aluno]</b> para que o valor dessas respostas não seja considerado.
</dd><dd><b>(2)</b> As questões que serão corrigidas devem ser marcadas como <b>[Normal Grading]</b>.
</dd><dd><b>(3)</b> Defina o peso de cada questão.
</dd><dd><b>(4)</b> Após configurar os campos, clique em <b>[Continue]</b>:
</dd><dd><a class="image" href="http://wiki.fahor.com.br/Arquivo:ClipCapIt-150903-171356.PNG"><img alt="ClipCapIt-150903-171356.PNG" src="http://wiki.fahor.com.br/images/c/ce/ClipCapIt-150903-171356.PNG" height="382" width="400" /></a>
</dd></dl>
<ul>
<li>Na tela seguinte, selecione a resposta que equivale ao <b>gabarito</b> e clique em <b>[Continue]</b>:
</li>
</ul>
<dl><dd><a class="image" href="http://wiki.fahor.com.br/Arquivo:ClipCapIt-150903-171532.PNG"><img alt="ClipCapIt-150903-171532.PNG" src="http://wiki.fahor.com.br/images/8/8d/ClipCapIt-150903-171532.PNG" height="296" width="400" /></a>
</dd></dl>
<ul>
<li>Feche a tela de confirmação:
</li>
</ul>
<dl><dd><a class="image" href="http://wiki.fahor.com.br/Arquivo:ClipCapIt-150903-171643.PNG"><img alt="ClipCapIt-150903-171643.PNG" src="http://wiki.fahor.com.br/images/a/a3/ClipCapIt-150903-171643.PNG" height="252" width="400" /></a>
</dd></dl>
<ul>
<li>Os resultados serão gerados em uma nova aba da planilha.
</li>
</ul>
<dl><dd><a class="image" href="http://wiki.fahor.com.br/Arquivo:ClipCapIt-150903-171806.PNG"><img alt="ClipCapIt-150903-171806.PNG" src="http://wiki.fahor.com.br/images/c/c7/ClipCapIt-150903-171806.PNG" height="204" width="400" /></a>
</dd></dl>
<ul>
<li>Você pode gerar esse processo quantas vezes quiser (se receber nova
resposta, se desejar trocar o peso das questões, trocar o gabarito,
etc).
</li>
</ul>
<h3>
<span class="mw-headline" id="Enviar_e-mail_a_quem_respondeu">Enviar e-mail a quem respondeu</span></h3>
<ul>
<li> Para enviar e-mail aos que responderam o formulário, clique em <b>[Complementos] > [Flubaroo] > [Enviar classificações por e-mail]:</b>
</li>
</ul>
<dl><dd><a class="image" href="http://wiki.fahor.com.br/Arquivo:ClipCapIt-150903-171959.PNG"><img alt="ClipCapIt-150903-171959.PNG" src="http://wiki.fahor.com.br/images/5/51/ClipCapIt-150903-171959.PNG" height="113" width="400" /></a>
</dd></dl>
<ul>
<li>Na tela que abrir, selecione o campo que contem o <b>[E-mail]</b>, Marque as opções <b>[Incluir lista de questões e pontuações]</b>(para o aluno receber suas questões) e <b>[Incluir chave de respostas]</b>(para o aluno receber a resposta certa). Em seguida, Informe uma mensagem e clique em <b>[Continuar]</b>:
</li>
</ul>
<dl><dd><a class="image" href="http://wiki.fahor.com.br/Arquivo:ClipCapIt-150903-172410.PNG"><img alt="ClipCapIt-150903-172410.PNG" src="http://wiki.fahor.com.br/images/6/66/ClipCapIt-150903-172410.PNG" height="400" width="312" /></a>
</dd></dl>
<ul>
<li>Clique em <b>[Ok]</b> na tela de confirmação:
</li>
</ul>
<h4>
<span class="mw-headline" id="E-mail_recebido_pelo_professor_.28dono_do_formul.C3.A1rio.29">E-mail recebido pelo professor (dono do formulário)</span></h4>
<ul>
<li>Este é o e-mail que o dono do formulário recebe ao rodar o processo de envio de e-mail:
</li>
</ul>
<dl><dd><a class="image" href="http://wiki.fahor.com.br/Arquivo:ClipCapIt-150903-172636.PNG"><img alt="ClipCapIt-150903-172636.PNG" src="http://wiki.fahor.com.br/images/5/50/ClipCapIt-150903-172636.PNG" height="245" width="400" /></a>
</dd></dl>
<h4>
<span class="mw-headline" id="E-mail_recebido_pelo_aluno_.28quem_respondeu_formul.C3.A1rio.29">E-mail recebido pelo aluno (quem respondeu formulário)</span></h4>
<ul>
<li>Este é o e-mail que o aluno recebe por e-mail:
</li>
</ul>
<dl><dd><a class="image" href="http://wiki.fahor.com.br/Arquivo:ClipCapIt-150903-172736.PNG"><img alt="ClipCapIt-150903-172736.PNG" src="http://wiki.fahor.com.br/images/7/7f/ClipCapIt-150903-172736.PNG" height="355" width="400" /> </a></dd><dd></dd><dd></dd><dd>Fonte : http://wiki.fahor.com.br/Flubaroo_-_Corre%C3%A7%C3%A3o_autom%C3%A1tica_de_provas
</dd></dl>
Uberdam Cavalettihttp://www.blogger.com/profile/04292374654714665881noreply@blogger.com0tag:blogger.com,1999:blog-5580540121626250840.post-47758370352757144272016-01-18T09:34:00.001-02:002016-01-18T09:34:29.107-02:00Como desenvolver um bom trabalho escolar ??<br />
<br />
Para você que vai começar esse ano escolar e a professora/professor
lhe encaminhar aquele trabalho e você não sabe nem por onde começar,
segue um PDF <i>mui bueno</i>, que é quase um espelho de TCC.<br />
<br />
<a href="http://www.4shared.com/office/47q_G3sEce/Guia_trabalho_escolar.html">Baixe </a>leia e aprenda.<br />
<br />
<div class="separator" style="clear: both; text-align: center;">
<a href="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHZJkhd72LZvRZDHflBWe4rj9yO08-XlXaVAx8cYEXCJur0KPbtNcLIchzuDp8E4FzPb8Tn7PI8i8ErMCO7NOhdab-pjLCe-GXEfe-Ango3aAwy6Q_NElv6xn8RhywA0q7Hbz4AllmfO6k/s1600/353385-7-dicas-para-n%25C3%25A3o-ser-uma-pessoa-chata-1.jpg" imageanchor="1" style="margin-left: 1em; margin-right: 1em;"><img border="0" height="217" src="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgHZJkhd72LZvRZDHflBWe4rj9yO08-XlXaVAx8cYEXCJur0KPbtNcLIchzuDp8E4FzPb8Tn7PI8i8ErMCO7NOhdab-pjLCe-GXEfe-Ango3aAwy6Q_NElv6xn8RhywA0q7Hbz4AllmfO6k/s320/353385-7-dicas-para-n%25C3%25A3o-ser-uma-pessoa-chata-1.jpg" width="320" /></a></div>
<br />Uberdam Cavalettihttp://www.blogger.com/profile/04292374654714665881noreply@blogger.com0tag:blogger.com,1999:blog-5580540121626250840.post-69208843399221568202015-11-05T08:42:00.002-02:002015-11-05T08:42:48.435-02:00E você, sabe realizar formatação condicional no Excel ??<br />
<span id="goog_1672215741"></span><span id="goog_1672215742"></span><br />
<br />
<br />
<span id="goog_1672215741"></span><span id="goog_1672215742"></span><br />
<span id="goog_1672215741"></span><span id="goog_1672215742"></span><br />
<span id="goog_1672215741"></span><span id="goog_1672215742"></span><br />
<span id="goog_1672215741"></span><span id="goog_1672215742"></span><br />
<div class="separator" style="clear: both; text-align: center;">
<iframe width="320" height="266" class="YOUTUBE-iframe-video" data-thumbnail-src="https://i.ytimg.com/vi/ZMc4T14bJ2k/0.jpg" src="https://www.youtube.com/embed/ZMc4T14bJ2k?feature=player_embedded" frameborder="0" allowfullscreen></iframe></div>
<span id="goog_1672215741"></span><span id="goog_1672215742"></span><br />
Uberdam Cavalettihttp://www.blogger.com/profile/14380355077708595931noreply@blogger.com0