Manufaturação industrial
Internet das coisas industrial | Materiais industriais | Manutenção e reparo de equipamentos | Programação industrial |
home  MfgRobots >> Manufaturação industrial >  >> Manufacturing Technology >> Processo de manufatura

Sistema de alarme Arduino:SERENA

Componentes e suprimentos

Arduino Mega 2560
× 1
Tela de toque LCD TFT de 3,2 "
× 1

Aplicativos e serviços online

Arduino IDE

Sobre este projeto


Já vi muitos sistemas de alarme antes, verifiquei, pude ver como funcionam e decidi que queria fazer o meu próprio. Quero dizer, por que não? Por que não pegar algo e torná-lo ainda melhor? Quer dizer, eu sou um engenheiro de computação (um graduando, mas isso muda logo) afinal.





E foi assim que este projeto ganhou vida.


Eu verifiquei muitos sistemas e o que eles realmente podem oferecer e achei uma boa ideia colocar todas essas funções (e algumas minhas) em uma única placa Arduino que servirá como painel de controle do alarme.

Nada complicado aqui, só comprei a própria placa junto com uma tela de toque de 3,2 ". Para fazer a tela funcionar, é claro, eu precisava de algumas bibliotecas. Então, um grande obrigado a Henning Carlsen por todas as bibliotecas! Link para seu site nos créditos seção.





O programa


Agora isso me levou um tempo para ser concluído. Não se deixe confundir pelo código, sempre comento quando necessário!





As principais funções do alarme


Decidi incluir três senhas diferentes. Um de 4 dígitos, um de 5 dígitos e um de 6 dígitos. Sei que são muitos, mas em uma atualização futura darei ao usuário a opção de desativar o código de 4 dígitos.
  • O passe de 4 dígitos é usado para armar o alarme.
  • O passe de 5 dígitos é usado para desarmar parcialmente o alarme.
  • O passe de 6 dígitos é usado para desarmar completamente o alarme.

O alarme também pode se armar automaticamente. Depois de inserir o código de 5 dígitos, o programa iniciará uma contagem regressiva (padrão de 40 segundos). Após o término dessa contagem regressiva, o alarme será armado automaticamente. Isso pode ser muito útil quando você geralmente se esquece de armar o sistema.





Menu de opções


No menu de opções, você pode alterar as três senhas, bem como o tempo de auto-armar.





Atualizações futuras


As atualizações futuras incluirão configurações de data / hora, suporte para cartão SD (no caso de haver uma falha de energia e não quisermos perder dados), a opção de desabilitar o auto-arme, a opção de desabilitar o passe de 4 dígitos e muito mais .





Vídeo de demonstração



Código

  • SERENA v.1.01
SERENA v.1.01 Arduino
Basta fazer o upload do código para sua placa Arduino.
Alguns comentários estão em grego, isso vai mudar em breve.
 ////////////////////////////////////// //////////////////////////////////////////////////////// //////////////////////////////////////////////////////// //////////////////////////////////////////////////////// //////////////////////////////////////////////////////// ////////////////////// Sistema de alarme SERENA // Autor:Michael Marinis // Copyright (C) 2016 Michael Marinis. Todos os direitos reservados // Site:http://www.youtube.com/SauROnmiKE////Este é o Sistema de Alarme SERENA, um sistema de alarme de duas funções que dá // ao usuário a capacidade de armar automaticamente o alarme, ou arme-o manualmente quando o usuário quiser.//// Este programa requer as bibliotecas UTFT e URTouch de Henning Karlsen e uma tela LCD // compatível com seu escudo.//////////////// VERSÕES ////////////// 0.10a:Primeira construção, funções básicas // 0.20a:Pequenas melhorias // 0.30a:Passar entrada e confirmação para uma nova senha de arme manual feito (12/11 /2016)//0.40a:A entrada de aprovação e a confirmação para uma nova senha de arme automático são feitas (12/11/2016) // 1.00a:Entrada e verificação concluídas da senha de arme (12/11/2016, 19:16) //1.10a:Menu completo quando o sistema está armado (sem enviar sinal a um relé ou outra coisa). A hora e a data serão adicionadas posteriormente. O botão Desarmar só é adicionado (13/11/2016, 13:04) // 1.20a:Programado o botão "DESARMAR". Ele solicita a entrada de senha de 5 dígitos. Também é feita a verificação de senha, que desarma o alarme (sem enviar sinal a um relé ou outra coisa) (13/11/2016, 14h15) // 1.21a:Corrigido problema em que o usuário não conseguia digitar nenhum número após a verificação da confirmação da senha. Se o usuário pressionasse "NÃO", ele não poderia digitar uma nova senha até que o botão "CLEAR" fosse pressionado. Isso foi corrigido (14/11/2016, 13:32) // 1.22a:O cronômetro de contagem regressiva para o arme automático está concluído (14/11/2016, 15:46) // 1.30a:Auto-arme O menu está completo. O menu Armar automático exibe os segundos restantes para o braço ser armado automaticamente novamente. O menu de desarme completo será acessado através de um botão devido às limitações da biblioteca (14/11/2016, 21:42) // 1.31a:Alterada a variável "buf" de "-1" para "0". Isso resolveu o bug, onde o primeiro toque de qualquer botão numérico não faria nada (16/11/2016, 00:45) // 1.40b:Adicionado o botão "SET ARM PASSWORD" que permite ao usuário modificar os 4 senha de dígitos usada para armar o alarme (16/11/2016, 14:33) // 1.41b:Os botões "BACK" de "SET AUTO-ARM PASS", agora redirecionam para a segunda página do menu de opções, em vez do primeiro (16/11/2016, 16:21) // 1.42b:Preenchido o terceiro menu de opções. Ele contém os botões "DEFINIR HORA" e "DEFINIR DATA" (16/11/2016, 16:37) // 1.43b:Corrigido um bug onde o botão limpar na entrada do passe de desarme não redefinia realmente a "entrada automática" array (17/11/2016, 00:05) // 1.44b:O botão "SET AUTO-ARM PASS", agora solicitará ao usuário o segundo menu de opções quando a senha for alterada, em vez do primeiro (18 / 11/2016, 10:02) // As alterações ficarão registradas até a versão final 1.00. Após 1,00, as alterações serão registradas no arquivo SERENA_changelog.txt.//1.00:Desenho da função de desarme total. A função exigirá a senha de 6 dígitos e levará ao menu principal do programa de alarme. Uma campainha é ouvida a cada clique de um botão (01/08/2017, 20:53) ////////// VERSÕES FUTURAS //////////// * IDEIAS PARA NOVAS VERSÕES ESTARÁ AQUI * /////////////////////////////////////////////// //////////////////////////////////////////////////////// //////////////////////////////////////////////////////// //////////////////////////////////////////////////////// //////////////////////////////////////////////////////// /////////// # include  #include  UTFT myGLCD (ITDB32WC, 38, 39, 40, 41); URTouch myTouch (6, 5, 4, 3, 2); extern uint8_t SmallFont []; extern uint8_t BigFont []; extern uint8_t SevenSegNumFont []; int x; int y; int armpass [4] ={1, 2, 3, 4}; int autopass [5] ={ 1, 2, 3, 4, 5}; passagem manual interna [6] ={1, 1, 1, 1, 1, 1}; entrada de tempo int [4]; entrada de tempo interna [4]; entrada automática interna [5]; entrada interna entrada manual [6]; int autolength =0; int manuallength =0; int buzzerpin =8; int systarm =9; int serenapin =10; int buttonpin =13; int autoarmtime =40; int autoarmtimemem =autoarmtime; int mês =1; int day =1; int year =2016; // FUNÇÕES PERSONALIZADAS void alarmtitle () {myGLCD.setFont (SmallFont); myGLCD.setBackColor (0, 0, 0); myGLCD.clrScr (); myGLCD.setColor (255, 255, 255); myGLCD.setBackColor (255, 0, 0); myGLCD.drawLine (0, 14, 319, 14); myGLCD.print ("SERENA ALARM SYSTEM v.1.01", CENTER, 1);} void title () // SEPARADO PORQUE O NOME NÃO É QUERIDO ALGUMAS VEZES {alarmtitle (); myGLCD.print ("BY MICHAEL MARINIS", CENTER, 30);} void drawbutton1 () {myGLCD.setColor (192, 192, 192); myGLCD.fillRoundRect (20, 60, 300, 100);} void drawbutton2 () {myGLCD.setColor (192, 192, 192); myGLCD.fillRoundRect (20, 120, 300, 160);} void drawdisarm () {myGLCD.setColor (192, 192, 192); myGLCD.fillRoundRect (20, 180, 300, 220); myGLCD.setColor (0, 0, 0); myGLCD.setBackColor (192, 192, 192); myGLCD.setFont (BigFont); myGLCD.print ("DISARM", CENTER, 193);} void drawback () {myGLCD.setColor (192, 192, 192); myGLCD.fillRoundRect (20, 180, 150, 210); myGLCD.setBackColor (192, 192, 192); myGLCD.setColor (0, 0, 0); myGLCD.setFont (SmallFont); myGLCD.print ("BACK", 70, 190);} void drawno () {myGLCD.setColor (192, 192, 192); myGLCD.fillRoundRect (20, 180, 150, 210); myGLCD.setBackColor (192, 192, 192); myGLCD.setColor (0, 0, 0); myGLCD.setFont (SmallFont); myGLCD.print ("NÃO", 80, 190);} void drawyes () {myGLCD.setColor (192, 192, 192); myGLCD.fillRoundRect (170, 180, 300, 210); myGLCD.setBackColor (192, 192, 192); myGLCD.setColor (0, 0, 0); myGLCD.setFont (SmallFont); myGLCD.print ("SIM", 225, 190);} void drawnext () {myGLCD.setColor (192, 192, 192); myGLCD.fillRoundRect (170, 180, 300, 210); myGLCD.setBackColor (192, 192, 192); myGLCD.setColor (0, 0, 0); myGLCD.setFont (SmallFont); myGLCD.print ("NEXT", 220, 190);} void drawbuttons () {myGLCD.clrScr (); int z; myGLCD.setFont (SmallFont); para (z =0; z <3; z ++) {myGLCD.setColor (255, 0, 0); myGLCD.fillRoundRect (20 + (z * 60), 15, 60 + (z * 60), 55); myGLCD.setColor (255, 255, 255); myGLCD.setBackColor (255, 0, 0); myGLCD.printNumI (z + 1, 37 + (z * 60), 30); } para (z =0; z <3; z ++) {myGLCD.setColor (255, 0, 0); myGLCD.fillRoundRect (20 + (z * 60), 70, 60 + (z * 60), 110); myGLCD.setColor (255, 255, 255); myGLCD.setBackColor (255, 0, 0); myGLCD.printNumI (z + 4, 37 + (z * 60), 85); } para (z =0; z <3; z ++) {myGLCD.setColor (255, 0, 0); myGLCD.fillRoundRect (20 + (z * 60), 125, 60 + (z * 60), 165); myGLCD.setColor (255, 255, 255); myGLCD.setBackColor (255, 0, 0); myGLCD.printNumI (z + 7, 37 + (z * 60), 140); } para (z =0; z <3; z ++) {myGLCD.setColor (255, 0, 0); myGLCD.fillRoundRect (190, 15 + (z * 55), 290, 55 + (z * 55)); } myGLCD.setColor (255, 0, 0); myGLCD.fillRoundRect (20, 175, 80, 205); myGLCD.setColor (255, 255, 255); myGLCD.setBackColor (255, 0, 0); myGLCD.printNumI (0, 48, 185); myGLCD.setColor (255, 255, 255); myGLCD.setBackColor (255, 0, 0); myGLCD.print ("CLEAR", 221, 30); myGLCD.print ("OK", 232, 85); myGLCD.print ("BACK", 225, 140);} void optionsmenuend () {myGLCD.clrScr (); myGLCD.setFont (SmallFont); myGLCD.setColor (255, 255, 255); myGLCD.drawLine (0, 14, 319, 14); myGLCD.setBackColor (255, 0, 0); título do alarme (); myGLCD.setFont (SmallFont); myGLCD.setColor (255, 0, 0); myGLCD.setBackColor (0, 0, 0); myGLCD.print ("MENU DE OPÇÕES", CENTRO, 20); drawbutton1 (); drawbutton2 (); recua(); myGLCD.setFont (SmallFont); myGLCD.setColor (255, 255, 255); myGLCD.setBackColor (255, 0, 0);} void optionsmenu () {myGLCD.clrScr (); myGLCD.setFont (SmallFont); myGLCD.setColor (255, 255, 255); myGLCD.drawLine (0, 14, 319, 14); myGLCD.setBackColor (255, 0, 0); título do alarme (); myGLCD.setFont (SmallFont); myGLCD.setColor (255, 0, 0); myGLCD.setBackColor (0, 0, 0); myGLCD.print ("MENU DE OPÇÕES", CENTRO, 20); drawbutton1 (); drawbutton2 (); recua(); desenhadaext (); myGLCD.setFont (SmallFont); myGLCD.setColor (255, 255, 255); myGLCD.setBackColor (255, 0, 0);} void drawoptions () {myGLCD.setFont (BigFont); myGLCD.setColor (255, 0, 0); myGLCD.fillRoundRect (20, 70, 300, 120); myGLCD.setBackColor (255, 0, 0); myGLCD.setColor (255, 255, 255); myGLCD.print ("OPÇÕES", CENTRO, 90);} void drawarm () {myGLCD.setFont (BigFont); myGLCD.setColor (255, 0, 0); myGLCD.fillRoundRect (20, 140, 300, 190); myGLCD.setBackColor (255, 0, 0); myGLCD.setColor (255, 255, 255); myGLCD.print ("ARM", CENTER, 160);} void printmonth (int i) {myGLCD.setColor (255, 0, 0); myGLCD.setBackColor (0, 0, 0); myGLCD.setFont (BigFont); if (i ==1) {myGLCD.print ("JANEIRO", 95, 100); } if (i ==2) {myGLCD.print ("FEVEREIRO", 95, 100); } if (i ==3) {myGLCD.print ("MARCH", 95, 100); } if (i ==4) {myGLCD.print ("APRIL", 95, 100); } if (i ==5) {myGLCD.print ("MAIO", 70, 100); } if (i ==6) {myGLCD.print ("JUNE", 95, 100); } if (i ==7) {myGLCD.print ("JULHO", 95, 100); } if (i ==8) {myGLCD.print ("AGOSTO", 95, 100); } if (i ==9) {myGLCD.print ("SETEMBRO", 95, 100); } if (i ==10) {myGLCD.print ("OUTUBRO", 95, 100); } if (i ==11) {myGLCD.print ("NOVEMBER", 95, 100); } if (i ==12) {myGLCD.print ("DEZEMBRO", 95, 100); }} // int atualizado (int d, int m, int y) // {// if (y% 4 ==0) // DISEKTO ETOS // {// if ((m> =0) &&(m <=13)) // {// if (m ==1 || m ==3 || m ==5 || m ==7 || m ==8 || m ==10 || m ==12) // {// if ((d> =0) &&(d <=32)) // {// if (d ==0) // {// d =31; //} // // if (d ==32) // {// d =1; //} //} //} //} //} // DISEKTO ETOS END //} int armupdate (int i, int armlength) {if (comprimento do braço <4) {if (comprimento do braço ==0) {arminput [0] =i; myGLCD.setColor (255, 0, 0); myGLCD.setBackColor (0, 0, 0); myGLCD.printNumI (arminput [0], 100, 185); // + 35 gia kathe noumero meta digitalWrite (buzzerpin, HIGH); atraso (50); digitalWrite (buzzerpin, LOW); return arminput [0]; } if (comprimento do braço ==1) {arminput [1] =i; myGLCD.setColor (255, 0, 0); myGLCD.setBackColor (0, 0, 0); myGLCD.printNumI (arminput [1], 135, 185); digitalWrite (buzzerpin, HIGH); atraso (50); digitalWrite (buzzerpin, LOW); return arminput [1]; } if (comprimento do braço ==2) {arminput [2] =i; myGLCD.setColor (255, 0, 0); myGLCD.setBackColor (0, 0, 0); myGLCD.printNumI (arminput [2], 170, 185); digitalWrite (buzzerpin, HIGH); atraso (50); digitalWrite (buzzerpin, LOW); return arminput [2]; } if (comprimento do braço ==3) {arminput [3] =i; myGLCD.setColor (255, 0, 0); myGLCD.setBackColor (0, 0, 0); myGLCD.printNumI (arminput [3], 205, 185); digitalWrite (buzzerpin, HIGH); atraso (50); digitalWrite (buzzerpin, LOW); return arminput [3]; }}} int autoarmupdate (int i, int timelength) {if (timelength <5) {if (timelength ==1) {timeinput [0] =i; myGLCD.setColor (255, 0, 0); myGLCD.setBackColor (0, 0, 0); myGLCD.printNumI (timeinput [0], 100, 185); digitalWrite (buzzerpin, HIGH); atraso (50); digitalWrite (buzzerpin, LOW); return timeinput [0]; } if (timelength ==2) {timeinput [1] =i; myGLCD.setColor (255, 0, 0); myGLCD.setBackColor (0, 0, 0); myGLCD.printNumI (timeinput [1], 135, 185); digitalWrite (buzzerpin, HIGH); atraso (50); digitalWrite (buzzerpin, LOW); return timeinput [1]; } if (timelength ==3) {timeinput [2] =i; myGLCD.setColor (255, 0, 0); myGLCD.setBackColor (0, 0, 0); myGLCD.printNumI (timeinput [2], 170, 185); digitalWrite (buzzerpin, HIGH); atraso (50); digitalWrite (buzzerpin, LOW); return timeinput [2]; } if (timelength ==4) {timeinput [3] =i; myGLCD.setColor (255, 0, 0); myGLCD.setBackColor (0, 0, 0); myGLCD.printNumI (timeinput [3], 205, 185); digitalWrite (buzzerpin, HIGH); atraso (50); digitalWrite (buzzerpin, LOW); return timeinput [3]; }}} int atualização automática (int i, int autolength) {if (autolength <5) {if (autolength ==0) {autoinput [0] =i; myGLCD.setColor (255, 0, 0); myGLCD.setBackColor (0, 0, 0); myGLCD.printNumI (autoinput [0], 100, 185); // + 35 gia kathe noumero meta digitalWrite (buzzerpin, HIGH); atraso (50); digitalWrite (buzzerpin, LOW); return autoinput [0]; } if (autolength ==1) {autoinput [1] =i; myGLCD.setColor (255, 0, 0); myGLCD.setBackColor (0, 0, 0); myGLCD.printNumI (entrada automática [1], 135, 185); digitalWrite (buzzerpin, HIGH); atraso (50); digitalWrite (buzzerpin, LOW); return autoinput [1]; } if (autolength ==2) {autoinput [2] =i; myGLCD.setColor (255, 0, 0); myGLCD.setBackColor (0, 0, 0); myGLCD.printNumI (autoinput [2], 170, 185); digitalWrite (buzzerpin, HIGH); atraso (50); digitalWrite (buzzerpin, LOW); return autoinput [2]; } if (autolength ==3) {autoinput [3] =i; myGLCD.setColor (255, 0, 0); myGLCD.setBackColor (0, 0, 0); myGLCD.printNumI (autoinput [3], 205, 185); digitalWrite (buzzerpin, HIGH); atraso (50); digitalWrite (buzzerpin, LOW); return autoinput [3]; } if (autolength ==4) {autoinput [4] =i; myGLCD.setColor (255, 0, 0); myGLCD.setBackColor (0, 0, 0); myGLCD.printNumI (entrada automática [4], 240, 185); digitalWrite (buzzerpin, HIGH); atraso (50); digitalWrite (buzzerpin, LOW); return autoinput [4]; } if (autolength ==5) {autoinput [5] =i; myGLCD.setColor (255, 0, 0); myGLCD.setBackColor (0, 0, 0); myGLCD.printNumI (entrada automática [5], 275, 185); digitalWrite (buzzerpin, HIGH); atraso (50); digitalWrite (buzzerpin, LOW); return autoinput [5]; }}} int manualupdate (int i, int manuallength) {if (manuallength <6) {if (manuallength ==0) {manualinput [0] =i; // manuallength ++; myGLCD.setColor (255, 0, 0); myGLCD.setBackColor (0, 0, 0); myGLCD.printNumI (entrada manual [0], 100, 185); // + 35 gia kathe noumero meta digitalWrite (buzzerpin, HIGH); atraso (50); digitalWrite (buzzerpin, LOW); return manualinput [0]; } if (comprimento manual ==1) {entrada manual [1] =i; // manuallength ++; myGLCD.setColor (255, 0, 0); myGLCD.setBackColor (0, 0, 0); myGLCD.printNumI (entrada manual [1], 135, 185); digitalWrite (buzzerpin, HIGH); atraso (50); digitalWrite (buzzerpin, LOW); retornar entrada manual [1]; } if (comprimento manual ==2) {entrada manual [2] =i; // manuallength ++; myGLCD.setColor (255, 0, 0); myGLCD.setBackColor (0, 0, 0); myGLCD.printNumI (entrada manual [2], 170, 185); digitalWrite (buzzerpin, HIGH); atraso (50); digitalWrite (buzzerpin, LOW); retornar entrada manual [2]; } if (comprimento manual ==3) {entrada manual [3] =i; // manuallength ++; myGLCD.setColor (255, 0, 0); myGLCD.setBackColor (0, 0, 0); myGLCD.printNumI (entrada manual [3], 205, 185); digitalWrite (buzzerpin, HIGH); atraso (50); digitalWrite (buzzerpin, LOW); retornar entrada manual [3]; } if (comprimento manual ==4) {entrada manual [4] =i; // manuallength ++; myGLCD.setColor (255, 0, 0); myGLCD.setBackColor (0, 0, 0); myGLCD.printNumI (entrada manual [4], 240, 185); digitalWrite (buzzerpin, HIGH); atraso (50); digitalWrite (buzzerpin, LOW); retornar entrada manual [4]; } if (comprimento manual ==5) {entrada manual [5] =i; // manuallength ++; myGLCD.setColor (255, 0, 0); myGLCD.setBackColor (0, 0, 0); myGLCD.printNumI (entrada manual [5], 275, 185); digitalWrite (buzzerpin, HIGH); atraso (50); digitalWrite (buzzerpin, LOW); retornar entrada manual [5]; }}} void setup () {myGLCD.InitLCD (); myGLCD.clrScr (); myTouch.InitTouch (); myTouch.setPrecision (PREC_EXTREME); pinMode (buzzerpin, OUTPUT); pinMode (systarm, OUTPUT); pinMode (serenapina, OUTPUT); digitalWrite (buzzerpin, HIGH); atraso (1000); digitalWrite (buzzerpin, LOW); título(); drawoptions (); drawarm ();} void loop () {while (true) {mainmenu:if (myTouch.dataAvailable ()) {myTouch.read (); x =myTouch.getX (); y =myTouch.getY (); // BOTÃO DE OPÇÕES if ((x> =20) &&(x <=300) &&(y> =70) &&(y <=120)) {options:optionsmenu (); myGLCD.setBackColor (192, 192, 192); myGLCD.setColor (0, 0, 255); myGLCD.print ("CONFIGURAR SENHA MANUAL-ARM", CENTRO, 73); myGLCD.print ("SET ARM PASSWORD", CENTER, 133); digitalWrite (buzzerpin, HIGH); atraso (50); digitalWrite (buzzerpin, LOW); while (true) {if (myTouch.dataAvailable ()) {myTouch.read (); x =myTouch.getX (); y =myTouch.getY (); // DEFINIR O BOTÃO DE SENHA MANUAL if ((x> =20) &&(x <=300) &&(y> =60) &&(y <=100)) {title (); myGLCD.setBackColor (0, 0, 0); myGLCD.setColor (255, 0, 0); myGLCD.print ("DIGITE A SENHA DE 6 DÍGITOS", CENTRO, 119); recua(); desenhadaext (); digitalWrite (buzzerpin, HIGH); atraso (50); digitalWrite (buzzerpin, LOW); while (true) {if (myTouch.dataAvailable ()) {myTouch.read (); x =myTouch.getX (); y =myTouch.getY (); if ((x> =20) &&(x <=150) &&(y> =180) &&(y <=210)) {digitalWrite (buzzerpin, HIGH); atraso (50); digitalWrite (buzzerpin, LOW); goto options; } if ((x> =170) &&(x <=300) &&(y> =180) &&(y <=210)) // BOTÃO MENU {para (int o =0; o <6; o ++) { entrada manual [o] =0; } passinput:int buf =0; myGLCD.setFont (SmallFont); myGLCD.setColor (255, 255, 255); myGLCD.drawLine (0, 14, 319, 14); myGLCD.setColor (255, 255, 255); botões de tração (); digitalWrite (buzzerpin, HIGH); atraso (50); digitalWrite (buzzerpin, LOW); myGLCD.setFont (SevenSegNumFont); myGLCD.setBackColor (0, 0, 0); // akolouthei para while (true) &drawbuttons (TICK!) while (true) {if (myTouch.dataAvailable ()) {myTouch.read (); x =myTouch.getX (); y =myTouch.getY (); // BOTÕES 1-3 if ((y> =15) &&(y <=55)) {if ((x> =20) &&(x <=60)) // 1 {manualupdate (1, buf); buf ++; atraso (85); } if ((x> =80) &&(x <=120)) // 2 {atualização manual (2, buf); buf ++; atraso (85); } if ((x> =140) &&(x <=180)) // 3 {atualização manual (3, buf); buf ++; atraso (85); }} // BUTTONS 1-3 END if ((y> =70) &&(y <=110)) // BOTÕES 4-6 {if ((x> =20) &&(x <=60)) // 4 {atualização manual (4, buf); buf ++; atraso (85); } if ((x> =80) &&(x <=120)) // 5 {atualização manual (5, buf); buf ++; atraso (85); } if ((x> =140) &&(x <=180)) // 6 {atualização manual (6, buf); buf ++; atraso (85); }} // BOTÕES 4-6 END if ((y> =125) &&(y <=165)) // BOTÕES 7-9 {if ((x> =20) &&(x <=60)) // 7 {atualização manual (7, buf); buf ++; atraso (85); } if ((x> =80) &&(x <=120)) // 8 {atualização manual (8, buf); buf ++; atraso (85); } if ((x> =140) &&(x <=180)) // 9 {atualização manual (9, buf); buf ++; atraso (85); }} // BOTÕES 7-9 END if ((x> =20) &&(x <=80) &&(y> =175) &&(y <=205)) // 0 {manualupdate (0, buf); buf ++; atraso (85); } if ((x> =190) &&(x <=290) &&(y> =70) &&(y <=110)) // BOTÃO OK {bool flag =true; para (int t =0; t <6; t ++) {if (entrada manual [t]! =passagem manual [t]) {sinalizador =falso; }} if (flag ==true) // swstos kwdikos {for (int i =0; i <6; i ++) {manualinput [i] =0; } myGLCD.clrScr (); myGLCD.setFont (BigFont); myGLCD.print ("PASSA OK!", CENTRO, 100); digitalWrite (buzzerpin, HIGH); atraso (50); digitalWrite (buzzerpin, LOW); atraso (2000); título(); myGLCD.setBackColor (0, 0, 0); myGLCD.setColor (255, 0, 0); myGLCD.print ("DIGITE A NOVA SENHA", CENTRO, 119); recua(); desenhadaext (); while (true) {if (myTouch.dataAvailable ()) {myTouch.read (); x =myTouch.getX (); y =myTouch.getY (); int buf =0; // EISAGWGH NEOU KWDIKOU if ((x> =170) &&(x <=300) &&(y> =180) &&(y <=210)) {newmanpassinput:myGLCD.setFont (SmallFont); myGLCD.setColor (255, 255, 255); myGLCD.drawLine (0, 14, 319, 14); myGLCD.setColor (255, 255, 255); botões de tração (); digitalWrite (buzzerpin, HIGH); atraso (50); digitalWrite (buzzerpin, LOW); myGLCD.setFont (SevenSegNumFont); myGLCD.setBackColor (0, 0, 0); while (true) {if (myTouch.dataAvailable ()) {myTouch.read (); x =myTouch.getX (); y =myTouch.getY (); // BOTÕES 1-3 if ((y> =15) &&(y <=55)) {if ((x> =20) &&(x <=60)) // 1 {manualupdate (1, buf); buf ++; atraso (85); } if ((x> =80) &&(x <=120)) // 2 {atualização manual (2, buf); buf ++; atraso (85); } if ((x> =140) &&(x <=180)) // 3 {atualização manual (3, buf); buf ++; atraso (85); }} // BUTTONS 1-3 END if ((y> =70) &&(y <=110)) // BOTÕES 4-6 {if ((x> =20) &&(x <=60)) // 4 {atualização manual (4, buf); buf ++; atraso (85); } if ((x> =80) &&(x <=120)) // 5 {atualização manual (5, buf); buf ++; atraso (85); } if ((x> =140) &&(x <=180)) // 6 {atualização manual (6, buf); buf ++; atraso (85); }} // BOTÕES 4-6 END if ((y> =125) &&(y <=165)) // BOTÕES 7-9 {if ((x> =20) &&(x <=60)) // 7 {atualização manual (7, buf); buf ++; atraso (85); } if ((x> =80) &&(x <=120)) // 8 {atualização manual (8, buf); buf ++; atraso (85); } if ((x> =140) &&(x <=180)) // 9 {atualização manual (9, buf); buf ++; atraso (85); }} // BOTÕES 7-9 END if ((x> =20) &&(x <=80) &&(y> =175) &&(y <=205)) // 0 {manualupdate (0, buf); buf ++; atraso (85); } // EDW THA MPEI TO OK. THA RWTAW AN O KWDIKOS EINAI ENTAKSEI (2 KOUMPIA, SIM E NÃO). UM "SIM", TOTE THA EPISTREFEI STO ARXIKO MENOU, UM "NÃO" THA EPISTREFEI STHN EISAGWGH KWDIKOY if ((x> =190) &&(x <=290) &&(y> =70) &&(y <=110) ) // BOTÃO DE NOVO PASSAGEM OK {buf =0; myGLCD.clrScr (); title (); ... Este arquivo foi truncado, faça o download para ver seu conteúdo completo. 

Processo de manufatura

  1. Design à prova de falhas
  2. Sistema de alarme de detecção de movimento
  3. Decodificador DTMF usando apenas Arduino
  4. Sistema de rega automática de plantas com Arduino
  5. Segurança do sistema de alarme colocada em teste
  6. Sistema de ventilação porão / crawlspace
  7. Comunicação Python3 e Arduino
  8. Sistema de atendimento baseado em Arduino e planilha do Google
  9. Sistema de aviso de detecção de colisão baseado em Arduino
  10. Despertador simples com DS1302 RTC