Taula de continguts:

Increïble rellotge Arduino: 4 passos
Increïble rellotge Arduino: 4 passos

Vídeo: Increïble rellotge Arduino: 4 passos

Vídeo: Increïble rellotge Arduino: 4 passos
Vídeo: make a digital display alarm clock using 16×2 LCD and buzzer interfacing with arduino uno 2024, De novembre
Anonim
Impressionant rellotge Arduino
Impressionant rellotge Arduino

Hem vist molts projectes amb arduino. Però ara, us mostraré com construir un rellotge amb pantalla arduino i 2 LCD. És senzill però totalment divertit. Tothom ho pot provar. Llavors, prepara’t !!!

Pas 1: recollida de materials

Recollida de materials
Recollida de materials

Si el voleu fer, necessitareu alguns elements. Aquests articles els podeu comprar fàcilment a la vostra botiga minorista més propera.

Què necessiteu:

  1. Arduino UNO R3Neo
  2. Anell de píxels 24
  3. Taula de pa
  4. Pantalla LCD de 16x2
  5. Resistència de 100 ohms (2)
  6. Resistència de 120 ohms (2)
  7. Resistència de 10 K Ohm (2)
  8. Polsador

El diagrama d’aquestes coses es mostra més amunt. Podeu utilitzar qualsevol tauler de pa. Necessiteu 6 resistències, els valors dels quals s’escriuen a la llista. També necessitareu cables per a la connexió. Aquests LCDs els mostrarà. El mètode de cablejat del circuit es pot veure al següent pas.

Pas 2: Cablatge de tots els components

Cablatge de tots els components
Cablatge de tots els components
Cablatge de tots els components
Cablatge de tots els components
Cablatge de tots els components
Cablatge de tots els components

Les coses que necessitareu. He mostrat en el pas anterior, així que agafeu el circuit de filferro de la vostra taula de pa.

Passos de cablejat:

  1. Col·loqueu una resistència de 100 Ohm a la part superior del tauler de pa a la línia negativa.
  2. Col·loqueu una resistència de 120 Ohm a la part superior del tauler de pa a la línia positiva.
  3. Col·loca el polsador (el diagrama es mostra més amunt)
  4. Col·loqueu la resistència de 10 K Ohm sota el polsador
  5. Connecteu resistències de 100 Ohm (totes dues) a la pantalla LCD amb un càtode LED
  6. Connecteu resistències de 120 Ohm (totes dues) a la pantalla LCD amb un ànode LED
  7. Connecteu el terminal negatiu del tauler de pa de la línia superior a "Llegir / Escriure".
  8. Connecteu el terminal negatiu del tauler de pa de la línia superior a "Contrast".
  9. Connecteu el terminal positiu de la placa de pa des de la línia inferior a "Vcc".
  10. Connecteu un altre terminal negatiu de la placa de pa de la línia superior de la placa de pa a "GND".
  11. Feu el mateix a la 2a pantalla LCD que connecteu tots aquests com abans.
  12. Connecteu les resistències restants a la línia negativa de la placa de pa.
  13. Connecteu els polsadors a la línia positiva.
  14. Connecteu el terminal negatiu i positiu del tauler de pa a "Neo Pixel Ring 24".

Ara, heu connectat tots els components. Però encara queda arduino. Esquema que es mostra anteriorment.

Passos de cablejat d'arduino a tots els components:

  1. Connecteu els polsadors (Terminal22) a A0 i A1 d'arduino.
  2. Connecteu GND al terminal negatiu de la placa de pa.
  3. Connecteu 5V al terminal positiu de la placa de pa.
  4. Connecteu D13 d'arduino a "Power of" "Neo Pixel Ring 24"
  5. Connecteu D7 d'arduino a "Register Select" de LCD1.
  6. Connecteu D8 d'arduino a "Habilita" de la pantalla LCD 2.
  7. Connecteu D9 d'arduino a "DB4" de LCD 2.
  8. Connecteu D10 d'arduino a "DB5" de la pantalla LCD 2.
  9. Connecteu D11 d'arduino a "DB6" de la pantalla LCD 2.
  10. Connecteu D12 d'arduino a "DB7" de la pantalla LCD 2.
  11. Connecteu D1 d'arduino a "Register Select" de l'LCD 1.
  12. Connecteu D2 d'arduino a "Habilita" de l'LCD 1.
  13. Connecteu D3 d'arduino a "DB4" de LCD 2.
  14. Connecteu D4 d'arduino a "DB5" de la pantalla LCD 2.
  15. Connecteu D5 d'arduino a "DB6" de la pantalla LCD 2.
  16. Connecteu D6 d'arduino a "DB7" de la pantalla LCD 2.

Es mostra el diagrama de tots els components després del cablejat.

Pas 3: Programació

Programació
Programació

Heu completat el circuit. Però no funciona fins que no el programareu per a aquest projecte. Si sou experts i teniu experiència, el programareu fàcilment. Espero que conegueu el programari que s’utilitza amb aquest propòsit. Programeu-lo en conseqüència si voleu crear canvis en la programació, però recordeu que ha de ser correcte. En cas contrari, no funcionarà. Si no el podeu programar, podeu copiar-lo des d’aquí o treure’l d’una altra font.

#incloure

// LCD esquerre LiquidCrystal lcd1 (7, 8, 9, 10, 11, 12); // LCD dret 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 previousMillis = 0; interval llarg = 950; int segons = 0; int hour = 0; int hourButtonState = 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,}; byte halfR [8] = {B00000, B00000, B00000, B00000, B11111, B11111, B11111, B11111,}; // la rutina de configuració s'executa una vegada quan premeu reset: void setup () {// set pins de botó pinMode (14, INPUT); // set minute pinMode (15, INPUT); // establir l’hora // fer personatges personalitzats lcd1.createChar (0, halfR); lcd1.createChar (1, meitatL); lcd1.createChar (2, complet); lcd2.createChar (0, halfR); lcd2.createChar (1, meitatL); lcd2.createChar (2, complet); // establir mida LCD1 lcd1.begin (16, 2); // establir mida LCD2 lcd2.begin (16, 2); // anell de píxels pixels.begin (); // configuració 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 (); } // la rutina del bucle es repeteix una vegada i una altra per sempre: void loop () {hourButtonState = digitalRead (15); minButtonState = digitalRead (14); if (hourButtonState == HIGH) {hour ++; runClock (); } if (minButtonState == HIGH) {segons ++; runClock (); } unsigned long currentMillis = millis (); if (actualMillis - anteriorMillis> interval) {if (segons == 59) {segons = 0; if (hora == 11) {hora = 0; } else {hour ++; }} else {segons ++; } Milis anteriors = Milis actuals; runClock (); } retard (10); } void runClock () {if (segons == 0) {lcd1.clear (); num0lcd1 (); lcd2.clear (); num0lcd2 (); } if (segons == 1 || segons == 11 || segons == 21 || segons == 31 || segons == 41 || segons == 51) {lcd1.clear (); num1lcd1 (); } if (segons == 2 || segons == 12 || segons == 22 || segons == 32 || segons == 42 || segons == 52) {lcd1.clear (); num2lcd1 (); } if (segons == 3 || segons == 13 || segons == 23 || segons == 33 || segons == 43 || segons == 53) {lcd1.clear (); num3lcd1 (); } if (segons == 4 || segons == 14 || segons == 24 || segons == 34 || segons == 44 || segons == 54) {lcd1.clear (); num4lcd1 (); } if (segons == 5 || segons == 15 || segons == 25 || segons == 35 || segons == 45 || segons == 55) {lcd1.clear (); num5lcd1 (); } if (segons == 6 || segons == 16 || segons == 26 || segons == 36 || segons == 46 || segons == 56) {lcd1.clear (); num6lcd1 (); } if (segons == 7 || segons == 17 || segons == 27 || segons == 37 || segons == 47 || segons == 57) {lcd1.clear (); num7lcd1 (); } if (segons == 8 || segons == 18 || segons == 28 || segons == 38 || segons == 48 || segons == 58) {lcd1.clear (); num8lcd1 (); } if (segons == 9 || segons == 19 || segons == 29 || segons == 39 || segons == 49 || segons == 59) {lcd1.clear (); num9lcd1 (); } if (segons == 10) {lcd1.clear (); num0lcd1 (); lcd2.clear (); num1lcd2 (); } if (segons == 20) {lcd1.clear (); num0lcd1 (); lcd2.clear (); num2lcd2 (); } if (segons == 30) {lcd1.clear (); num0lcd1 (); lcd2.clear (); num3lcd2 (); } if (segons == 40) {lcd1.clear (); num0lcd1 (); lcd2.clear (); num4lcd2 (); } if (segons == 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)); // lcd1.setCursor complet (0, 1); lcd1.write (byte (2)); lcd1.setCursor (1, 1); lcd1.write (byte (0)); // mitja dreta lcd1.setCursor (1, 0); lcd1.write (byte (1)); // mitja esquerra 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)); // lcd1.setCursor complet (0, 1); lcd1.write (byte (2)); lcd1.setCursor (1, 0); lcd1.write (byte (1)); // mitja esquerra 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)); // lcd1.setCursor complet (0, 1); lcd1.write (byte (2)); lcd1.setCursor (1, 1); lcd1.write (byte (0)); // mitja dreta 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)); // lcd1.setCursor complet (0, 1); lcd1.write (byte (2)); lcd1.setCursor (1, 1); lcd1.write (byte (0)); // mitja dreta 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)); // lcd1.setCursor complet (0, 1); lcd1.write (byte (2)); lcd1.setCursor (1, 1); lcd1.write (byte (0)); // mitja dreta lcd1.setCursor (1, 0); lcd1.write (byte (1)); // mitja esquerra 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)); // lcd1.setCursor complet (0, 1); lcd1.write (byte (2)); lcd1.setCursor (1, 1); lcd1.write (byte (0)); // mitja dreta lcd1.setCursor (1, 0); lcd1.write (byte (1)); // mitja esquerra 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 complet (0, 1); lcd2.write (byte (2)); lcd2.setCursor (1, 1); lcd2.write (byte (0)); // mitja dreta lcd2.setCursor (1, 0); lcd2.write (byte (1)); // mitja esquerra 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)); // full lcd2.setCursor (0, 1); lcd2.write (byte (2)); lcd2.setCursor (1, 0); lcd2.write (byte (1)); // mitja esquerra 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)); // full lcd2.setCursor (0, 1); lcd2.write (byte (2)); lcd2.setCursor (1, 1); lcd2.write (byte (0)); // mitja dreta 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 complet (0, 1); lcd2.write (byte (2)); lcd2.setCursor (1, 1); lcd2.write (byte (0)); // mitja dreta 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)); }

Pas 4: treballar i acabar el tacte

Toc de treball i acabat
Toc de treball i acabat

Connecteu el vostre arduino a l'ordinador i deixeu-lo funcionar. Espero que el vostre rellotge funcioni. Funciona però sembla molt desordenat. Tantes resistències i cables no és bo. Per tant, col·loqueu tots els components a la caixa i talleu un forat perquè la pantalla LCD pinti la caixa i doneu un aspecte de rellotge digital.

No l’he creat de debò però l’he dissenyat en CIRCUITS AUTODESK. El dissenyaré en real i publicaré el vídeo del treball. No sóc nadiu. Si heu comès algun error, informeu-me en missatges privats. I em sap greu aquest error. També he pres alguna idea de "Dan's arduino Clock". Ens trobem amb un altre instructiu.

Recomanat: