Índice:

Relógio Arduino incrível: 4 etapas
Relógio Arduino incrível: 4 etapas

Vídeo: Relógio Arduino incrível: 4 etapas

Vídeo: Relógio Arduino incrível: 4 etapas
Vídeo: Relógio analógico quatro dígitos com arduíno e módulo Rtc Ds3231. 2024, Novembro
Anonim
Relógio Arduino incrível
Relógio Arduino incrível

Vimos muitos projetos com o arduino. Mas agora, vou mostrar a você como construir um relógio com arduino e 2 telas de LCD. É simples, mas totalmente divertido. Cada um pode experimentar. Então, prepare-se !!!

Etapa 1: Coletando Materiais

Coletando Materiais
Coletando Materiais

Se você quiser fazer, você precisará de alguns itens. Esses itens você pode comprar facilmente em sua loja de varejo mais próxima.

O que você vai precisar:

  1. Arduino UNO R3Neo
  2. Pixel Ring 24
  3. Tábua de pão
  4. LCD 16x2
  5. Resistor de 100 Ohm (2)
  6. Resistor de 120 Ohm (2)
  7. Resistor de 10 K Ohm (2)
  8. Botão de apertar

O diagrama dessas coisas é mostrado acima. Você pode usar qualquer placa de pão. Você precisa de 6 resistores, seus valores estão escritos acima na lista. Você também precisará de fios para conexão. Esses LCDs serão exibidos. O método de circuito de fiação você pode ver na próxima etapa.

Etapa 2: Fiação de todos os componentes

Fiação de todos os componentes
Fiação de todos os componentes
Fiação de todos os componentes
Fiação de todos os componentes
Fiação de todos os componentes
Fiação de todos os componentes

As coisas de que você precisa. Eu mostrei na etapa anterior, então leve o circuito do fio da placa de pão comigo.

Etapas de fiação:

  1. Coloque um resistor de 100 Ohm na parte superior da placa de pão na linha negativa.
  2. Coloque o resistor de 120 Ohm na parte superior da placa de pão na linha positiva.
  3. Coloque o botão de pressão (o diagrama é mostrado acima)
  4. Coloque o resistor de 10 K Ohm sob o botão de pressão
  5. Conecte resistores de 100 Ohms (ambos) ao display LCD com 'cátodo LED'
  6. Conecte resistores de 120 Ohms (ambos) ao display LCD com 'ânodo LED'
  7. Conecte o terminal negativo da placa de pão da linha superior para 'Leitura / Gravação'.
  8. Conecte o terminal negativo da placa de pão da linha superior para 'Contraste'.
  9. Conecte o terminal positivo da placa de pão da linha inferior a 'Vcc'.
  10. Conecte outro terminal negativo da placa do pão da linha superior da placa do pão ao 'GND ".
  11. Faça o mesmo no 2º LCD, conecte todos esses como antes.
  12. Conecte os resistores restantes à linha negativa da placa de pão.
  13. Conecte os botões de pressão à linha positiva.
  14. Conecte o terminal Positivo e Negativo da placa do pão ao "Neo Pixel Ring 24".

Agora, você conectou todos os componentes. Mas o arduino ainda está restando. Diagrama disso mostrado acima.

Etapas de fiação do arduino para todos os componentes:

  1. Conecte os botões (Terminal22) a A0 e A1 do Arduino.
  2. Conecte o GND ao terminal negativo da placa do pão.
  3. Conecte 5 V ao terminal positivo da placa do pão.
  4. Conecte o D13 do arduino ao "Power of" "Neo Pixel Ring 24"
  5. Conecte o D7 do arduino ao "Register Select" do LCD1.
  6. Conecte o D8 do arduino a "Ativar" do LCD 2.
  7. Conecte o D9 do arduino a "DB4" do LCD 2.
  8. Conecte o D10 do arduino a "DB5" do LCD 2.
  9. Conecte o D11 do arduino a "DB6" do LCD 2.
  10. Conecte D12 do arduino a "DB7" do LCD 2.
  11. Conecte D1 do arduino ao "Register Select" do LCD 1.
  12. Conecte o D2 do arduino a "Ativar" do LCD 1.
  13. Conecte o D3 do arduino a "DB4" do LCD 2.
  14. Conecte o D4 do arduino a "DB5" do LCD 2.
  15. Conecte o D5 do arduino a "DB6" do LCD 2.
  16. Conecte o D6 do arduino a "DB7" do LCD 2.

O diagrama de todos os componentes após a fiação é mostrado acima.

Etapa 3: Programação

Programação
Programação

Você completou o circuito. Mas não funciona até que você o programe para este projeto. Se você for um especialista e tiver experiência, irá programá-lo facilmente. Espero que conheça o software utilizado para este fim. Programe-o de acordo se quiser criar mudanças na programação, mas lembre-se de que deve estar correto. Caso contrário, não funcionará. Se você não pode programá-lo, você pode copiar daqui ou retirá-lo de outra fonte.

#incluir

// LCD esquerdo LiquidCrystal lcd1 (7, 8, 9, 10, 11, 12); // LCD direito LiquidCrystal lcd2 (1, 2, 3, 4, 5, 6); # include #ifdef _AVR_ #include # endif / / NeoPixel Ring 24 #define PIN 13 # define NUMPIXELS 24Adafruit_NeoPixel pixels = Adafruit_NeoPixel (NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800); int delayval = 50; long anteriorMillis = 0; intervalo longo = 950; segundos inteiros = 0; int hora = 0; int horaButtonState = 0; int minButtonState = 0; byte full [8] = {B11111, B11111, B11111, B11111, B11111, B11111, B11111, B11111,}; byte halfL [8] = {B11111, B11111, B11111, B11111, B00000, B00000, B00000, B00000,}; byte halfR [8] = {B00000, B00000, B00000, B00000, B11111, B11111, B11111, B11111,}; // a rotina de configuração é executada uma vez quando você pressiona reset: void setup () {// definir pinMode do botão (14, INPUT); // definir minuto pinMode (15, INPUT); // definir hora // criar caracteres personalizados lcd1.createChar (0, halfR); lcd1.createChar (1, metadeL); lcd1.createChar (2, completo); lcd2.createChar (0, halfR); lcd2.createChar (1, metadeL); lcd2.createChar (2, completo); // define o tamanho do LCD1 lcd1.begin (16, 2); // define o tamanho do LCD2 lcd2.begin (16, 2); // anel de pixel pixels.begin (); // configuração inicial lcd1.clear (); num0lcd1 (); lcd2.clear (); num0lcd2 (); //pixels.setPixelColor(17, pixels. Color (0, 150, 0)); //pixels.setPixelColor(18, pixels. Color (0, 150, 0)); pixels.show (); } // a rotina de loop é executada indefinidamente: void loop () {hourButtonState = digitalRead (15); minButtonState = digitalRead (14); if (hourButtonState == HIGH) {hour ++; runClock (); } if (minButtonState == HIGH) {segundos ++; runClock (); } Unsigned long currentMillis = millis (); if (currentMillis - previousMillis> interval) {if (seconds == 59) {seconds = 0; if (hora == 11) {hora = 0; } else {hora ++; }} else {segundos ++; } previousMillis = currentMillis; runClock (); } atraso (10); } void runClock () {if (segundos == 0) {lcd1.clear (); num0lcd1 (); lcd2.clear (); num0lcd2 (); } if (segundos == 1 || segundos == 11 || segundos == 21 || segundos == 31 || segundos == 41 || segundos == 51) {lcd1.clear (); num1lcd1 (); } if (segundos == 2 || segundos == 12 || segundos == 22 || segundos == 32 || segundos == 42 || segundos == 52) {lcd1.clear (); num2lcd1 (); } if (segundos == 3 || segundos == 13 || segundos == 23 || segundos == 33 || segundos == 43 || segundos == 53) {lcd1.clear (); num3lcd1 (); } if (segundos == 4 || segundos == 14 || segundos == 24 || segundos == 34 || segundos == 44 || segundos == 54) {lcd1.clear (); num4lcd1 (); } if (segundos == 5 || segundos == 15 || segundos == 25 || segundos == 35 || segundos == 45 || segundos == 55) {lcd1.clear (); num5lcd1 (); } if (segundos == 6 || segundos == 16 || segundos == 26 || segundos == 36 || segundos == 46 || segundos == 56) {lcd1.clear (); num6lcd1 (); } if (segundos == 7 || segundos == 17 || segundos == 27 || segundos == 37 || segundos == 47 || segundos == 57) {lcd1.clear (); num7lcd1 (); } if (segundos == 8 || segundos == 18 || segundos == 28 || segundos == 38 || segundos == 48 || segundos == 58) {lcd1.clear (); num8lcd1 (); } if (segundos == 9 || segundos == 19 || segundos == 29 || segundos == 39 || segundos == 49 || segundos == 59) {lcd1.clear (); num9lcd1 (); } if (segundos == 10) {lcd1.clear (); num0lcd1 (); lcd2.clear (); num1lcd2 (); } if (segundos == 20) {lcd1.clear (); num0lcd1 (); lcd2.clear (); num2lcd2 (); } if (segundos == 30) {lcd1.clear (); num0lcd1 (); lcd2.clear (); num3lcd2 (); } if (segundos == 40) {lcd1.clear (); num0lcd1 (); lcd2.clear (); num4lcd2 (); } if (segundos == 50) {lcd1.clear (); num0lcd1 (); lcd2.clear (); num5lcd2 (); } if (hora == 0) {pixels.setPixelColor (15, pixels. Color (0, 0, 0)); pixels.setPixelColor (16, pixels. Color (0, 0, 0)); pixels.setPixelColor (17, pixels. Color (0, 150, 0)); pixels.setPixelColor (18, pixels. Color (0, 150, 0)); pixels.show (); } if (hora == 1) {pixels.setPixelColor (17, pixels. Color (0, 0, 0)); pixels.setPixelColor (18, pixels. Color (0, 0, 0)); pixels.setPixelColor (19, pixels. Color (0, 150, 0)); pixels.setPixelColor (20, pixels. Color (0, 150, 0)); pixels.show (); } if (hora == 2) {pixels.setPixelColor (19, pixels. Color (0, 0, 0)); pixels.setPixelColor (20, pixels. Color (0, 0, 0)); pixels.setPixelColor (21, pixels. Color (0, 150, 0)); pixels.setPixelColor (22, pixels. Color (0, 150, 0)); pixels.show (); } if (hora == 3) {pixels.setPixelColor (21, pixels. Color (0, 0, 0)); pixels.setPixelColor (22, pixels. Color (0, 0, 0)); pixels.setPixelColor (23, pixels. Color (0, 150, 0)); pixels.setPixelColor (0, pixels. Color (0, 150, 0)); pixels.show (); } if (hora == 4) {pixels.setPixelColor (23, pixels. Color (0, 0, 0)); pixels.setPixelColor (0, pixels. Color (0, 0, 0)); pixels.setPixelColor (1, pixels. Color (0, 150, 0)); pixels.setPixelColor (2, pixels. Color (0, 150, 0)); pixels.show (); } if (hora == 5) {pixels.setPixelColor (1, pixels. Color (0, 0, 0)); pixels.setPixelColor (2, pixels. Color (0, 0, 0)); pixels.setPixelColor (3, pixels. Color (0, 150, 0)); pixels.setPixelColor (4, pixels. Color (0, 150, 0)); pixels.show (); } if (hora == 6) {pixels.setPixelColor (3, pixels. Color (0, 0, 0)); pixels.setPixelColor (4, pixels. Color (0, 0, 0)); pixels.setPixelColor (5, pixels. Color (0, 150, 0)); pixels.setPixelColor (6, pixels. Color (0, 150, 0)); pixels.show (); } if (hora == 7) {pixels.setPixelColor (5, pixels. Color (0, 0, 0)); pixels.setPixelColor (6, pixels. Color (0, 0, 0)); pixels.setPixelColor (7, pixels. Color (0, 150, 0)); pixels.setPixelColor (8, pixels. Color (0, 150, 0)); pixels.show (); } if (hora == 8) {pixels.setPixelColor (7, pixels. Color (0, 0, 0)); pixels.setPixelColor (8, pixels. Color (0, 0, 0)); pixels.setPixelColor (9, pixels. Color (0, 150, 0)); pixels.setPixelColor (10, pixels. Color (0, 150, 0)); pixels.show (); } if (hora == 9) {pixels.setPixelColor (9, pixels. Color (0, 0, 0)); pixels.setPixelColor (10, pixels. Color (0, 0, 0)); pixels.setPixelColor (11, pixels. Color (0, 150, 0)); pixels.setPixelColor (12, pixels. Color (0, 150, 0)); pixels.show (); } if (hora == 10) {pixels.setPixelColor (11, pixels. Color (0, 0, 0)); pixels.setPixelColor (12, pixels. Color (0, 0, 0)); pixels.setPixelColor (13, pixels. Color (0, 150, 0)); pixels.setPixelColor (14, pixels. Color (0, 150, 0)); pixels.show (); } if (hora == 11) {pixels.setPixelColor (13, pixels. Color (0, 0, 0)); pixels.setPixelColor (14, pixels. Color (0, 0, 0)); pixels.setPixelColor (15, pixels. Color (0, 150, 0)); pixels.setPixelColor (16, pixels. Color (0, 150, 0)); pixels.show (); }} void num0lcd1 () {lcd1.setCursor (0, 0); lcd1.write (byte (2)); // full lcd1.setCursor (0, 1); lcd1.write (byte (2)); lcd1.setCursor (1, 1); lcd1.write (byte (0)); // meio à direita lcd1.setCursor (1, 0); lcd1.write (byte (1)); // metade esquerda lcd1.setCursor (2, 1); lcd1.write (byte (0)); lcd1.setCursor (2, 0); lcd1.write (byte (1)); lcd1.setCursor (3, 1); lcd1.write (byte (0)); lcd1.setCursor (3, 0); lcd1.write (byte (1)); lcd1.setCursor (4, 1); lcd1.write (byte (0)); lcd1.setCursor (4, 0); lcd1.write (byte (1)); lcd1.setCursor (5, 1); lcd1.write (byte (0)); lcd1.setCursor (5, 0); lcd1.write (byte (1)); lcd1.setCursor (6, 1); lcd1.write (byte (0)); lcd1.setCursor (6, 0); lcd1.write (byte (1)); lcd1.setCursor (7, 1); lcd1.write (byte (0)); lcd1.setCursor (7, 0); lcd1.write (byte (1)); lcd1.setCursor (8, 1); lcd1.write (byte (0)); lcd1.setCursor (8, 0); lcd1.write (byte (1)); lcd1.setCursor (9, 1); lcd1.write (byte (0)); lcd1.setCursor (9, 0); lcd1.write (byte (1)); lcd1.setCursor (10, 1); lcd1.write (byte (0)); lcd1.setCursor (10, 0); lcd1.write (byte (1)); lcd1.setCursor (11, 1); lcd1.write (byte (0)); lcd1.setCursor (11, 0); lcd1.write (byte (1)); lcd1.setCursor (12, 1); lcd1.write (byte (0)); lcd1.setCursor (12, 0); lcd1.write (byte (1)); lcd1.setCursor (13, 1); lcd1.write (byte (0)); lcd1.setCursor (13, 0); lcd1.write (byte (1)); lcd1.setCursor (14, 1); lcd1.write (byte (0)); lcd1.setCursor (14, 0); lcd1.write (byte (1)); lcd1.setCursor (15, 1); lcd1.write (byte (2)); lcd1.setCursor (15, 0); lcd1.write (byte (2)); } void num1lcd1 () {lcd1.setCursor (0, 1); lcd1.write (byte (0)); lcd1.setCursor (1, 1); lcd1.write (byte (0)); lcd1.setCursor (2, 1); lcd1.write (byte (0)); lcd1.setCursor (3, 1); lcd1.write (byte (0)); lcd1.setCursor (4, 1); lcd1.write (byte (0)); lcd1.setCursor (5, 1); lcd1.write (byte (0)); lcd1.setCursor (6, 1); lcd1.write (byte (0)); lcd1.setCursor (7, 1); lcd1.write (byte (0)); lcd1.setCursor (8, 1); lcd1.write (byte (0)); lcd1.setCursor (9, 1); lcd1.write (byte (0)); lcd1.setCursor (10, 1); lcd1.write (byte (0)); lcd1.setCursor (11, 1); lcd1.write (byte (0)); lcd1.setCursor (12, 1); lcd1.write (byte (0)); lcd1.setCursor (13, 1); lcd1.write (byte (0)); lcd1.setCursor (14, 1); lcd1.write (byte (0)); lcd1.setCursor (15, 1); lcd1.write (byte (0)); } void num2lcd1 () {lcd1.setCursor (0, 0); lcd1.write (byte (2)); // full lcd1.setCursor (0, 1); lcd1.write (byte (2)); lcd1.setCursor (1, 0); lcd1.write (byte (1)); // metade esquerda lcd1.setCursor (2, 0); lcd1.write (byte (1)); lcd1.setCursor (3, 0); lcd1.write (byte (1)); lcd1.setCursor (4, 0); lcd1.write (byte (1)); lcd1.setCursor (5, 0); lcd1.write (byte (1)); lcd1.setCursor (6, 0); lcd1.write (byte (1)); lcd1.setCursor (7, 1); lcd1.write (byte (2)); lcd1.setCursor (7, 0); lcd1.write (byte (2)); lcd1.setCursor (8, 1); lcd1.write (byte (0)); lcd1.setCursor (9, 1); lcd1.write (byte (0)); lcd1.setCursor (10, 1); lcd1.write (byte (0)); lcd1.setCursor (11, 1); lcd1.write (byte (0)); lcd1.setCursor (12, 1); lcd1.write (byte (0)); lcd1.setCursor (13, 1); lcd1.write (byte (0)); lcd1.setCursor (14, 1); lcd1.write (byte (0)); lcd1.setCursor (15, 1); lcd1.write (byte (2)); lcd1.setCursor (15, 0); lcd1.write (byte (2)); } void num3lcd1 () {lcd1.setCursor (0, 0); lcd1.write (byte (2)); // full lcd1.setCursor (0, 1); lcd1.write (byte (2)); lcd1.setCursor (1, 1); lcd1.write (byte (0)); // meio à direita lcd1.setCursor (2, 1); lcd1.write (byte (0)); lcd1.setCursor (3, 1); lcd1.write (byte (0)); lcd1.setCursor (4, 1); lcd1.write (byte (0)); lcd1.setCursor (5, 1); lcd1.write (byte (0)); lcd1.setCursor (6, 1); lcd1.write (byte (0)); lcd1.setCursor (7, 1); lcd1.write (byte (2)); lcd1.setCursor (7, 0); lcd1.write (byte (2)); lcd1.setCursor (8, 1); lcd1.write (byte (0)); lcd1.setCursor (9, 1); lcd1.write (byte (0)); lcd1.setCursor (10, 1); lcd1.write (byte (0)); lcd1.setCursor (11, 1); lcd1.write (byte (0)); lcd1.setCursor (12, 1); lcd1.write (byte (0)); lcd1.setCursor (13, 1); lcd1.write (byte (0)); lcd1.setCursor (14, 1); lcd1.write (byte (0)); lcd1.setCursor (15, 1); lcd1.write (byte (2)); lcd1.setCursor (15, 0); lcd1.write (byte (2)); } void num4lcd1 () {lcd1.setCursor (0, 1); lcd1.write (byte (0)); lcd1.setCursor (1, 1); lcd1.write (byte (0)); lcd1.setCursor (2, 1); lcd1.write (byte (0)); lcd1.setCursor (3, 1); lcd1.write (byte (0)); lcd1.setCursor (4, 1); lcd1.write (byte (0)); lcd1.setCursor (5, 1); lcd1.write (byte (0)); lcd1.setCursor (6, 1); lcd1.write (byte (0)); lcd1.setCursor (7, 1); lcd1.write (byte (2)); lcd1.setCursor (7, 0); lcd1.write (byte (2)); lcd1.setCursor (8, 0); lcd1.write (byte (1)); lcd1.setCursor (8, 1); lcd1.write (byte (0)); lcd1.setCursor (9, 0); lcd1.write (byte (1)); lcd1.setCursor (9, 1); lcd1.write (byte (0)); lcd1.setCursor (10, 0); lcd1.write (byte (1)); lcd1.setCursor (10, 1); lcd1.write (byte (0)); lcd1.setCursor (11, 0); lcd1.write (byte (1)); lcd1.setCursor (11, 1); lcd1.write (byte (0)); lcd1.setCursor (12, 0); lcd1.write (byte (1)); lcd1.setCursor (12, 1); lcd1.write (byte (0)); lcd1.setCursor (13, 0); lcd1.write (byte (1)); lcd1.setCursor (13, 1); lcd1.write (byte (0)); lcd1.setCursor (14, 0); lcd1.write (byte (1)); lcd1.setCursor (14, 1); lcd1.write (byte (0)); lcd1.setCursor (15, 0); lcd1.write (byte (1)); lcd1.setCursor (15, 1); lcd1.write (byte (0)); } void num5lcd1 () {lcd1.setCursor (0, 0); lcd1.write (byte (2)); // full lcd1.setCursor (0, 1); lcd1.write (byte (2)); lcd1.setCursor (1, 1); lcd1.write (byte (0)); // meio à direita lcd1.setCursor (2, 1); lcd1.write (byte (0)); lcd1.setCursor (3, 1); lcd1.write (byte (0)); lcd1.setCursor (4, 1); lcd1.write (byte (0)); lcd1.setCursor (5, 1); lcd1.write (byte (0)); lcd1.setCursor (6, 1); lcd1.write (byte (0)); lcd1.setCursor (7, 1); lcd1.write (byte (2)); lcd1.setCursor (7, 0); lcd1.write (byte (2)); lcd1.setCursor (8, 0); lcd1.write (byte (1)); lcd1.setCursor (9, 0); lcd1.write (byte (1)); lcd1.setCursor (10, 0); lcd1.write (byte (1)); lcd1.setCursor (11, 0); lcd1.write (byte (1)); lcd1.setCursor (12, 0); lcd1.write (byte (1)); lcd1.setCursor (13, 0); lcd1.write (byte (1)); lcd1.setCursor (14, 0); lcd1.write (byte (1)); lcd1.setCursor (15, 1); lcd1.write (byte (2)); lcd1.setCursor (15, 0); lcd1.write (byte (2)); } void num6lcd1 () {lcd1.setCursor (0, 0); lcd1.write (byte (2)); // full lcd1.setCursor (0, 1); lcd1.write (byte (2)); lcd1.setCursor (1, 1); lcd1.write (byte (0)); // meio à direita lcd1.setCursor (1, 0); lcd1.write (byte (1)); // metade esquerda lcd1.setCursor (2, 1); lcd1.write (byte (0)); lcd1.setCursor (2, 0); lcd1.write (byte (1)); lcd1.setCursor (3, 1); lcd1.write (byte (0)); lcd1.setCursor (3, 0); lcd1.write (byte (1)); lcd1.setCursor (4, 1); lcd1.write (byte (0)); lcd1.setCursor (4, 0); lcd1.write (byte (1)); lcd1.setCursor (5, 1); lcd1.write (byte (0)); lcd1.setCursor (5, 0); lcd1.write (byte (1)); lcd1.setCursor (6, 1); lcd1.write (byte (0)); lcd1.setCursor (6, 0); lcd1.write (byte (1)); lcd1.setCursor (7, 1); lcd1.write (byte (2)); lcd1.setCursor (7, 0); lcd1.write (byte (2)); lcd1.setCursor (8, 0); lcd1.write (byte (1)); lcd1.setCursor (9, 0); lcd1.write (byte (1)); lcd1.setCursor (10, 0); lcd1.write (byte (1)); lcd1.setCursor (11, 0); lcd1.write (byte (1)); lcd1.setCursor (12, 0); lcd1.write (byte (1)); lcd1.setCursor (13, 0); lcd1.write (byte (1)); lcd1.setCursor (14, 0); lcd1.write (byte (1)); lcd1.setCursor (15, 1); lcd1.write (byte (2)); lcd1.setCursor (15, 0); lcd1.write (byte (2)); } void num7lcd1 () {lcd1.setCursor (0, 1); lcd1.write (byte (0)); lcd1.setCursor (1, 1); lcd1.write (byte (0)); lcd1.setCursor (2, 1); lcd1.write (byte (0)); lcd1.setCursor (3, 1); lcd1.write (byte (0)); lcd1.setCursor (4, 1); lcd1.write (byte (0)); lcd1.setCursor (5, 1); lcd1.write (byte (0)); lcd1.setCursor (6, 1); lcd1.write (byte (0)); lcd1.setCursor (7, 1); lcd1.write (byte (0)); lcd1.setCursor (8, 1); lcd1.write (byte (0)); lcd1.setCursor (9, 1); lcd1.write (byte (0)); lcd1.setCursor (10,1); lcd1.write (byte (0)); lcd1.setCursor (11, 1); lcd1.write (byte (0)); lcd1.setCursor (12, 1); lcd1.write (byte (0)); lcd1.setCursor (13, 1); lcd1.write (byte (0)); lcd1.setCursor (14, 1); lcd1.write (byte (0)); lcd1.setCursor (15, 1); lcd1.write (byte (2)); lcd1.setCursor (15, 0); lcd1.write (byte (2)); } void num8lcd1 () {lcd1.setCursor (0, 0); lcd1.write (byte (2)); // full lcd1.setCursor (0, 1); lcd1.write (byte (2)); lcd1.setCursor (1, 1); lcd1.write (byte (0)); // meio à direita lcd1.setCursor (1, 0); lcd1.write (byte (1)); // metade esquerda lcd1.setCursor (2, 1); lcd1.write (byte (0)); lcd1.setCursor (2, 0); lcd1.write (byte (1)); lcd1.setCursor (3, 1); lcd1.write (byte (0)); lcd1.setCursor (3, 0); lcd1.write (byte (1)); lcd1.setCursor (4, 1); lcd1.write (byte (0)); lcd1.setCursor (4, 0); lcd1.write (byte (1)); lcd1.setCursor (5, 1); lcd1.write (byte (0)); lcd1.setCursor (5, 0); lcd1.write (byte (1)); lcd1.setCursor (6, 1); lcd1.write (byte (0)); lcd1.setCursor (6, 0); lcd1.write (byte (1)); lcd1.setCursor (7, 1); lcd1.write (byte (2)); lcd1.setCursor (7, 0); lcd1.write (byte (2)); lcd1.setCursor (8, 1); lcd1.write (byte (0)); lcd1.setCursor (8, 0); lcd1.write (byte (1)); lcd1.setCursor (9, 1); lcd1.write (byte (0)); lcd1.setCursor (9, 0); lcd1.write (byte (1)); lcd1.setCursor (10, 1); lcd1.write (byte (0)); lcd1.setCursor (10, 0); lcd1.write (byte (1)); lcd1.setCursor (11, 1); lcd1.write (byte (0)); lcd1.setCursor (11, 0); lcd1.write (byte (1)); lcd1.setCursor (12, 1); lcd1.write (byte (0)); lcd1.setCursor (12, 0); lcd1.write (byte (1)); lcd1.setCursor (13, 1); lcd1.write (byte (0)); lcd1.setCursor (13, 0); lcd1.write (byte (1)); lcd1.setCursor (14, 1); lcd1.write (byte (0)); lcd1.setCursor (14, 0); lcd1.write (byte (1)); lcd1.setCursor (15, 1); lcd1.write (byte (2)); lcd1.setCursor (15, 0); lcd1.write (byte (2)); } void num9lcd1 () {lcd1.setCursor (0, 0); lcd1.write (byte (2)); lcd1.setCursor (0, 1); lcd1.write (byte (2)); lcd1.setCursor (1, 1); lcd1.write (byte (0)); lcd1.setCursor (2, 1); lcd1.write (byte (0)); lcd1.setCursor (3, 1); lcd1.write (byte (0)); lcd1.setCursor (4, 1); lcd1.write (byte (0)); lcd1.setCursor (5, 1); lcd1.write (byte (0)); lcd1.setCursor (6, 1); lcd1.write (byte (0)); lcd1.setCursor (7, 1); lcd1.write (byte (2)); lcd1.setCursor (7, 0); lcd1.write (byte (2)); lcd1.setCursor (8, 0); lcd1.write (byte (1)); lcd1.setCursor (8, 1); lcd1.write (byte (0)); lcd1.setCursor (9, 0); lcd1.write (byte (1)); lcd1.setCursor (9, 1); lcd1.write (byte (0)); lcd1.setCursor (10, 0); lcd1.write (byte (1)); lcd1.setCursor (10, 1); lcd1.write (byte (0)); lcd1.setCursor (11, 0); lcd1.write (byte (1)); lcd1.setCursor (11, 1); lcd1.write (byte (0)); lcd1.setCursor (12, 0); lcd1.write (byte (1)); lcd1.setCursor (12, 1); lcd1.write (byte (0)); lcd1.setCursor (13, 0); lcd1.write (byte (1)); lcd1.setCursor (13, 1); lcd1.write (byte (0)); lcd1.setCursor (14, 0); lcd1.write (byte (1)); lcd1.setCursor (14, 1); lcd1.write (byte (0)); lcd1.setCursor (15, 0); lcd1.write (byte (2)); lcd1.setCursor (15, 1); lcd1.write (byte (2)); } void num0lcd2 () {lcd2.setCursor (0, 0); lcd2.write (byte (2)); // lcd2.setCursor completo (0, 1); lcd2.write (byte (2)); lcd2.setCursor (1, 1); lcd2.write (byte (0)); // meio direito lcd2.setCursor (1, 0); lcd2.write (byte (1)); // metade esquerda lcd2.setCursor (2, 1); lcd2.write (byte (0)); lcd2.setCursor (2, 0); lcd2.write (byte (1)); lcd2.setCursor (3, 1); lcd2.write (byte (0)); lcd2.setCursor (3, 0); lcd2.write (byte (1)); lcd2.setCursor (4, 1); lcd2.write (byte (0)); lcd2.setCursor (4, 0); lcd2.write (byte (1)); lcd2.setCursor (5, 1); lcd2.write (byte (0)); lcd2.setCursor (5, 0); lcd2.write (byte (1)); lcd2.setCursor (6, 1); lcd2.write (byte (0)); lcd2.setCursor (6, 0); lcd2.write (byte (1)); lcd2.setCursor (7, 1); lcd2.write (byte (0)); lcd2.setCursor (7, 0); lcd2.write (byte (1)); lcd2.setCursor (8, 1); lcd2.write (byte (0)); lcd2.setCursor (8, 0); lcd2.write (byte (1)); lcd2.setCursor (9, 1); lcd2.write (byte (0)); lcd2.setCursor (9, 0); lcd2.write (byte (1)); lcd2.setCursor (10, 1); lcd2.write (byte (0)); lcd2.setCursor (10, 0); lcd2.write (byte (1)); lcd2.setCursor (11, 1); lcd2.write (byte (0)); lcd2.setCursor (11, 0); lcd2.write (byte (1)); lcd2.setCursor (12, 1); lcd2.write (byte (0)); lcd2.setCursor (12, 0); lcd2.write (byte (1)); lcd2.setCursor (13, 1); lcd2.write (byte (0)); lcd2.setCursor (13, 0); lcd2.write (byte (1)); lcd2.setCursor (14, 1); lcd2.write (byte (0)); lcd2.setCursor (14, 0); lcd2.write (byte (1)); lcd2.setCursor (15, 1); lcd2.write (byte (2)); lcd2.setCursor (15, 0); lcd2.write (byte (2)); } void num1lcd2 () {lcd2.setCursor (0, 1); lcd2.write (byte (0)); lcd2.setCursor (1, 1); lcd2.write (byte (0)); lcd2.setCursor (2, 1); lcd2.write (byte (0)); lcd2.setCursor (3, 1); lcd2.write (byte (0)); lcd2.setCursor (4, 1); lcd2.write (byte (0)); lcd2.setCursor (5, 1); lcd2.write (byte (0)); lcd2.setCursor (6, 1); lcd2.write (byte (0)); lcd2.setCursor (7, 1); lcd2.write (byte (0)); lcd2.setCursor (8, 1); lcd2.write (byte (0)); lcd2.setCursor (9, 1); lcd2.write (byte (0)); lcd2.setCursor (10, 1); lcd2.write (byte (0)); lcd2.setCursor (11, 1); lcd2.write (byte (0)); lcd2.setCursor (12, 1); lcd2.write (byte (0)); lcd2.setCursor (13, 1); lcd2.write (byte (0)); lcd2.setCursor (14, 1); lcd2.write (byte (0)); lcd2.setCursor (15, 1); lcd2.write (byte (0)); } void num2lcd2 () {lcd2.setCursor (0, 0); lcd2.write (byte (2)); // lcd2.setCursor completo (0, 1); lcd2.write (byte (2)); lcd2.setCursor (1, 0); lcd2.write (byte (1)); // metade esquerda lcd2.setCursor (2, 0); lcd2.write (byte (1)); lcd2.setCursor (3, 0); lcd2.write (byte (1)); lcd2.setCursor (4, 0); lcd2.write (byte (1)); lcd2.setCursor (5, 0); lcd2.write (byte (1)); lcd2.setCursor (6, 0); lcd2.write (byte (1)); lcd2.setCursor (7, 1); lcd2.write (byte (2)); lcd2.setCursor (7, 0); lcd2.write (byte (2)); lcd2.setCursor (8, 1); lcd2.write (byte (0)); lcd2.setCursor (9, 1); lcd2.write (byte (0)); lcd2.setCursor (10, 1); lcd2.write (byte (0)); lcd2.setCursor (11, 1); lcd2.write (byte (0)); lcd2.setCursor (12, 1); lcd2.write (byte (0)); lcd2.setCursor (13, 1); lcd2.write (byte (0)); lcd2.setCursor (14, 1); lcd2.write (byte (0)); lcd2.setCursor (15, 1); lcd2.write (byte (2)); lcd2.setCursor (15, 0); lcd2.write (byte (2)); } void num3lcd2 () {lcd2.setCursor (0, 0); lcd2.write (byte (2)); // lcd2.setCursor completo (0, 1); lcd2.write (byte (2)); lcd2.setCursor (1, 1); lcd2.write (byte (0)); // meio à direita lcd2.setCursor (2, 1); lcd2.write (byte (0)); lcd2.setCursor (3, 1); lcd2.write (byte (0)); lcd2.setCursor (4, 1); lcd2.write (byte (0)); lcd2.setCursor (5, 1); lcd2.write (byte (0)); lcd2.setCursor (6, 1); lcd2.write (byte (0)); lcd2.setCursor (7, 1); lcd2.write (byte (2)); lcd2.setCursor (7, 0); lcd2.write (byte (2)); lcd2.setCursor (8, 1); lcd2.write (byte (0)); lcd2.setCursor (9, 1); lcd2.write (byte (0)); lcd2.setCursor (10, 1); lcd2.write (byte (0)); lcd2.setCursor (11, 1); lcd2.write (byte (0)); lcd2.setCursor (12, 1); lcd2.write (byte (0)); lcd2.setCursor (13, 1); lcd2.write (byte (0)); lcd2.setCursor (14, 1); lcd2.write (byte (0)); lcd2.setCursor (15, 1); lcd2.write (byte (2)); lcd2.setCursor (15, 0); lcd2.write (byte (2)); } void num4lcd2 () {lcd2.setCursor (0, 1); lcd2.write (byte (0)); lcd2.setCursor (1, 1); lcd2.write (byte (0)); lcd2.setCursor (2, 1); lcd2.write (byte (0)); lcd2.setCursor (3, 1); lcd2.write (byte (0)); lcd2.setCursor (4, 1); lcd2.write (byte (0)); lcd2.setCursor (5, 1); lcd2.write (byte (0)); lcd2.setCursor (6, 1); lcd2.write (byte (0)); lcd2.setCursor (7, 1); lcd2.write (byte (2)); lcd2.setCursor (7, 0); lcd2.write (byte (2)); lcd2.setCursor (8, 0); lcd2.write (byte (1)); lcd2.setCursor (8, 1); lcd2.write (byte (0)); lcd2.setCursor (9, 0); lcd2.write (byte (1)); lcd2.setCursor (9, 1); lcd2.write (byte (0)); lcd2.setCursor (10, 0); lcd2.write (byte (1)); lcd2.setCursor (10, 1); lcd2.write (byte (0)); lcd2.setCursor (11, 0); lcd2.write (byte (1)); lcd2.setCursor (11, 1); lcd2.write (byte (0)); lcd2.setCursor (12, 0); lcd2.write (byte (1)); lcd2.setCursor (12, 1); lcd2.write (byte (0)); lcd2.setCursor (13, 0); lcd2.write (byte (1)); lcd2.setCursor (13, 1); lcd2.write (byte (0)); lcd2.setCursor (14, 0); lcd2.write (byte (1)); lcd2.setCursor (14, 1); lcd2.write (byte (0)); lcd2.setCursor (15, 0); lcd2.write (byte (1)); lcd2.setCursor (15, 1); lcd2.write (byte (0)); } void num5lcd2 () {lcd2.setCursor (0, 0); lcd2.write (byte (2)); // lcd2.setCursor completo (0, 1); lcd2.write (byte (2)); lcd2.setCursor (1, 1); lcd2.write (byte (0)); // meio à direita lcd2.setCursor (2, 1); lcd2.write (byte (0)); lcd2.setCursor (3, 1); lcd2.write (byte (0)); lcd2.setCursor (4, 1); lcd2.write (byte (0)); lcd2.setCursor (5, 1); lcd2.write (byte (0)); lcd2.setCursor (6, 1); lcd2.write (byte (0)); lcd2.setCursor (7, 1); lcd2.write (byte (2)); lcd2.setCursor (7, 0); lcd2.write (byte (2)); lcd2.setCursor (8, 0); lcd2.write (byte (1)); lcd2.setCursor (9, 0); lcd2.write (byte (1)); lcd2.setCursor (10, 0); lcd2.write (byte (1)); lcd2.setCursor (11, 0); lcd2.write (byte (1)); lcd2.setCursor (12, 0); lcd2.write (byte (1)); lcd2.setCursor (13, 0); lcd2.write (byte (1)); lcd2.setCursor (14, 0); lcd2.write (byte (1)); lcd2.setCursor (15, 1); lcd2.write (byte (2)); lcd2.setCursor (15, 0); lcd2.write (byte (2)); }

Etapa 4: Toque de trabalho e acabamento

Toque de trabalho e acabamento
Toque de trabalho e acabamento

Conecte seu arduino ao computador e deixe-o funcionar. Espero que seu relógio funcione. Está funcionando, mas parece tão bagunçado. Tantos resistores e fios que não é bom. Então, coloque todos os componentes na caixa e corte um orifício para LCD pintar a caixa e dar a aparência de Relógio Digital.

Não o criei em real, mas projetei-o em CIRCUITOS AUTODESK. Vou projetar em real e postar o vídeo de trabalho. Eu não sou um falante nativo. Se tiver cometido algum erro, informe-me em mensagens privadas. E eu sinto muito por esse erro. Eu também tirei algumas idéias do "Dan's Arduino Clock". Encontro você com outro instrutível.

Recomendado: