Obsah:

Úžasné hodiny Arduino: 4 kroky
Úžasné hodiny Arduino: 4 kroky

Video: Úžasné hodiny Arduino: 4 kroky

Video: Úžasné hodiny Arduino: 4 kroky
Video: FLProg8:установка часов реального времени с помощью ЖК-меню| Визуальное программирование для Arduino 2024, November
Anonim
Úžasné hodiny Arduino
Úžasné hodiny Arduino

Videli sme mnoho projektov s arduino. Ale teraz vám ukážem, ako vytvoriť hodinky s arduino a 2 LCD displejmi. Je to jednoduché, ale úplne zábavné. Skúsiť to môže každý. Takže, pripravte sa !!!

Krok 1: Zber materiálu

Zber materiálov
Zber materiálov

Ak to chcete urobiť, budete potrebovať nejaké položky. Tieto položky si môžete ľahko kúpiť v najbližšom maloobchode.

Čo budete potrebovať:

  1. Arduino UNO R3Neo
  2. Pixel Ring 24
  3. Chlebová doska
  4. LCD 16x2
  5. 100 ohmový odpor (2)
  6. 120 ohmový rezistor (2)
  7. Rezistor 10 K Ohm (2)
  8. Tlačidlo

Schéma týchto vecí je zobrazená vyššie. Môžete použiť akúkoľvek dosku na chlieb. Potrebujete 6 rezistorov, ktorých hodnoty sú uvedené vyššie v zozname. Na pripojenie budete potrebovať aj vodiče. Tieto displeje LCD budete zobrazovať. Spôsob zapojenia obvodu môžete vidieť v nasledujúcom kroku.

Krok 2: Zapojenie všetkých komponentov

Zapojenie všetkých komponentov
Zapojenie všetkých komponentov
Zapojenie všetkých komponentov
Zapojenie všetkých komponentov
Zapojenie všetkých komponentov
Zapojenie všetkých komponentov

Veci, ktoré budete potrebovať. Ukázal som v predchádzajúcom kroku, takže vezmite so sebou svoj drôtený obvod chleba.

Kroky zapojenia:

  1. Na hornú stranu dosky na chlieb na zápornú čiaru umiestnite odpor 100 ohmov.
  2. Umiestnite odpor 120 Ohm na hornú stranu dosky na chlieb na pozitívnu linku.
  3. Tlačidlo umiestnenia (diagram je zobrazený vyššie)
  4. Umiestnite odpor 10 K Ohm pod tlačidlo
  5. Pripojte 100 ohmové odpory (oba) k LCD displeju pomocou „LED katódy“
  6. Pripojte 120 ohmové odpory (oba) k LCD displeju pomocou „LED anódy“
  7. Pripojte záporný pól dosky chleba z horného riadka k „Čítanie/zápis“.
  8. Pripojte záporný pól dosky na chlieb z horného riadku na „Kontrast“.
  9. Pripojte kladný terminál dosky chleba zo spodného riadku na „Vcc“.
  10. Pripojte ďalší záporný pól dosky na chlieb z horného radu dosky na chlieb k 'GND'.
  11. To isté urobte na druhom LCD displeji, pripojte všetky tieto položky ako predtým.
  12. Pripojte zvyšné odpory k zápornej linke dosky na chlieb.
  13. Pripojte tlačidlá k kladnej čiare.
  14. Pripojte kladný a záporný terminál dosky s chlebom k „Neo Pixel Ring 24“.

Teraz ste pripojili všetky komponenty. Arduino však stále zostáva. Diagram je zobrazený vyššie.

Kroky zapojenia arduina do všetkých komponentov:

  1. Pripojte tlačidlá (Terminál22) k A0 a A1 arduina.
  2. Pripojte GND k zápornému pólu dosky chleba.
  3. Pripojte 5 V na kladný pól dosky na chlieb.
  4. Pripojte D13 arduina k „Napájaniu“„Neo Pixel Ring 24“
  5. Pripojte D7 arduina k „Register Select“na LCD1.
  6. Pripojte D8 arduina k „Povoliť“LCD 2.
  7. Pripojte D9 arduina k "DB4" na LCD 2.
  8. Pripojte D10 arduina k "DB5" na LCD 2.
  9. Pripojte D11 arduina k "DB6" na LCD 2.
  10. Pripojte D12 arduina k "DB7" na LCD 2.
  11. Pripojte D1 arduina k „Register Select“na LCD 1.
  12. Pripojte D2 arduina k „Povoliť“LCD 1.
  13. Pripojte D3 arduina k "DB4" na LCD 2.
  14. Pripojte D4 arduina k "DB5" na LCD 2.
  15. Pripojte D5 arduina k "DB6" na LCD 2.
  16. Pripojte D6 arduina k „DB7“LCD 2.

Schéma všetkých komponentov po zapojení je uvedená vyššie.

Krok 3: Programovanie

Programovanie
Programovanie

Dokončili ste obvod. Nefunguje to však, kým ho nenaprogramujete pre tento projekt. Ak ste odborník a máte skúsenosti, ľahko ho naprogramujete. Dúfam, že poznáte softvér, ktorý sa na tento účel používa. Naprogramujte to zodpovedajúcim spôsobom, ak chcete vytvoriť zmenu v programovaní, môžete, ale pamätajte si, že musí byť správna. V opačnom prípade to nebude fungovať. Ak ho nemôžete naprogramovať, môžete ho skopírovať odtiaľto alebo ho prevziať z iného zdroja.

#zahrnúť

// Ľavý LCD LiquidCrystal lcd1 (7, 8, 9, 10, 11, 12); // Pravý LCD LiquidCrystal lcd2 (1, 2, 3, 4, 5, 6); #include #ifdef _AVR_ #include #endif/ / NeoPixel Ring 24 #definujte PIN 13 #definujte NUMPIXELS 24Adafruit_NeoPixel pixelov = Adafruit_NeoPixel (NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800); int delayval = 50; long previousMillis = 0; dlhý interval = 950; int sekundy = 0; int hodina = 0; int hodinaButtonState = 0; int minButtonState = 0; plný byt [8] = {B11111, B11111, B11111, B11111, B11111, B11111, B11111, B11111,}; polovica bytu L [8] = {B11111, B11111, B11111, B11111, B00000, B00000, B00, B00000,}; bajt halfR [8] = {B00000, B00000, B00000, B00000, B11111, B11111, B11111, B11111,}; // // rutina nastavenia sa spustí raz, keď stlačíte reset: void setup () {// set kolíky tlačidiel pinMode (14, VSTUP); // nastavenie minúty pinMode (15, VSTUP); // nastavenie hodiny // vytvorenie vlastných znakov lcd1.createChar (0, halfR); lcd1.createChar (1, polovica L); lcd1.createChar (2, plný); lcd2.createChar (0, halfR); lcd2.createChar (1, polovica L); lcd2.createChar (2, plný); // nastavenie veľkosti LCD1 lcd1.begin (16, 2); // nastavenie veľkosti LCD2 lcd2.begin (16, 2); // pixel ring pixely.begin (); // úvodné nastavenie lcd1.clear (); num0lcd1 (); lcd2.clear (); num0lcd2 (); //pixels.setPixelColor(17, pixely. Color (0, 150, 0)); //pixels.setPixelColor(18, pixely. Color (0, 150, 0)); pixely.show (); } // rutina slučky beží stále znova a znova: void loop () {hourButtonState = digitalRead (15); minButtonState = digitalRead (14); if (hourButtonState == HIGH) {hodina ++; runClock (); } if (minButtonState == VYSOKE) {sekundy ++; runClock (); } dlhý nepodpísaný prúdMillis = millis (); if (currentMillis - previousMillis> interval) {if (seconds == 59) {seconds = 0; if (hodina == 11) {hodina = 0; } else {hodina ++; }} else {sekúnd ++; } previousMillis = currentMillis; runClock (); } oneskorenie (10); } void runClock () {if (seconds == 0) {lcd1.clear (); num0lcd1 (); lcd2.clear (); num0lcd2 (); } if (seconds == 1 || seconds == 11 || seconds == 21 || seconds == 31 || seconds == 41 || seconds == 51) {lcd1.clear (); num1lcd1 (); } if (seconds == 2 || seconds == 12 || seconds == 22 || seconds == 32 || seconds == 42 || seconds == 52) {lcd1.clear (); num2lcd1 (); } if (seconds == 3 || seconds == 13 || seconds == 23 || seconds == 33 || seconds == 43 || seconds == 53) {lcd1.clear (); num3lcd1 (); } if (seconds == 4 || seconds == 14 || seconds == 24 || seconds == 34 || seconds == 44 || seconds == 54) {lcd1.clear (); num4lcd1 (); } if (seconds == 5 || seconds == 15 || seconds == 25 || seconds == 35 || seconds == 45 || seconds == 55) {lcd1.clear (); num5lcd1 (); } if (seconds == 6 || seconds == 16 || seconds == 26 || seconds == 36 || seconds == 46 || seconds == 56) {lcd1.clear (); num6lcd1 (); } if (seconds == 7 || seconds == 17 || seconds == 27 || seconds == 37 || seconds == 47 || seconds == 57) {lcd1.clear (); num7lcd1 (); } if (seconds == 8 || seconds == 18 || seconds == 28 || seconds == 38 || seconds == 48 || seconds == 58) {lcd1.clear (); num8lcd1 (); } if (seconds == 9 || seconds == 19 || seconds == 29 || seconds == 39 || seconds == 49 || seconds == 59) {lcd1.clear (); num9lcd1 (); } if (seconds == 10) {lcd1.clear (); num0lcd1 (); lcd2.clear (); num1lcd2 (); } if (seconds == 20) {lcd1.clear (); num0lcd1 (); lcd2.clear (); num2lcd2 (); } if (seconds == 30) {lcd1.clear (); num0lcd1 (); lcd2.clear (); num3lcd2 (); } if (seconds == 40) {lcd1.clear (); num0lcd1 (); lcd2.clear (); num4lcd2 (); } if (seconds == 50) {lcd1.clear (); num0lcd1 (); lcd2.clear (); num5lcd2 (); } if (hodina == 0) {pixely.setPixelColor (15, pixely. Color (0, 0, 0)); pixely.setPixelColor (16, pixelov. Color (0, 0, 0)); pixely.setPixelColor (17, pixelov. Color (0, 150, 0)); pixely.setPixelColor (18, pixelov. Color (0, 150, 0)); pixely.show (); } if (hodina == 1) {pixely.setPixelColor (17, pixely. Color (0, 0, 0)); pixely.setPixelColor (18, pixelov. Color (0, 0, 0)); pixely.setPixelColor (19, pixelov. Color (0, 150, 0)); pixelov.setPixelColor (20, pixelov. Color (0, 150, 0)); pixely.show (); } if (hodina == 2) {pixely.setPixelColor (19, pixely. Color (0, 0, 0)); pixelov.setPixelColor (20, pixelov. Color (0, 0, 0)); pixely.setPixelColor (21, pixelov. Color (0, 150, 0)); pixelov.setPixelColor (22, pixelov. Color (0, 150, 0)); pixely.show (); } if (hodina == 3) {pixely.setPixelColor (21, pixely. Color (0, 0, 0)); pixely.setPixelColor (22, pixely. Color (0, 0, 0)); pixely.setPixelColor (23, pixelov. Color (0, 150, 0)); pixely.setPixelColor (0, pixelov. Color (0, 150, 0)); pixely.show (); } if (hodina == 4) {pixely.setPixelColor (23, pixely. Color (0, 0, 0)); pixely.setPixelColor (0, pixely. Color (0, 0, 0)); pixely.setPixelColor (1, pixely. Color (0, 150, 0)); pixely.setPixelColor (2, pixely. Color (0, 150, 0)); pixely.show (); } if (hodina == 5) {pixely.setPixelColor (1, pixely. Color (0, 0, 0)); pixely.setPixelColor (2, pixely. Color (0, 0, 0)); pixely.setPixelColor (3, pixely. Color (0, 150, 0)); pixely.setPixelColor (4, pixely. Color (0, 150, 0)); pixely.show (); } if (hodina == 6) {pixely.setPixelColor (3, pixely. Color (0, 0, 0)); pixely.setPixelColor (4, pixely. Color (0, 0, 0)); pixelov.setPixelColor (5, pixelov. Color (0, 150, 0)); pixelov.setPixelColor (6, pixelov. Color (0, 150, 0)); pixely.show (); } if (hodina == 7) {pixely.setPixelColor (5, pixely. Color (0, 0, 0)); pixely.setPixelColor (6, pixely. Color (0, 0, 0)); pixelov.setPixelColor (7, pixelov. Color (0, 150, 0)); pixely.setPixelColor (8, pixelov. Color (0, 150, 0)); pixely.show (); } if (hodina == 8) {pixely.setPixelColor (7, pixely. Color (0, 0, 0)); pixelov.setPixelColor (8, pixelov. Color (0, 0, 0)); pixelov.setPixelColor (9, pixelov. Color (0, 150, 0)); pixely.setPixelColor (10, pixelov. Color (0, 150, 0)); pixely.show (); } if (hodina == 9) {pixely.setPixelColor (9, pixely. Color (0, 0, 0)); pixely.setPixelColor (10, pixelov. Color (0, 0, 0)); pixely.setPixelColor (11, pixelov. Color (0, 150, 0)); pixelov.setPixelColor (12, pixelov. Color (0, 150, 0)); pixely.show (); } if (hodina == 10) {pixely.setPixelColor (11, pixely. Color (0, 0, 0)); pixelov.setPixelColor (12, pixelov. Color (0, 0, 0)); pixely.setPixelColor (13, pixelov. Color (0, 150, 0)); pixely.setPixelColor (14, pixelov. Color (0, 150, 0)); pixely.show (); } if (hodina == 11) {pixely.setPixelColor (13, pixely. Color (0, 0, 0)); pixely.setPixelColor (14, pixelov. Color (0, 0, 0)); pixely.setPixelColor (15, pixelov. Color (0, 150, 0)); pixely.setPixelColor (16, pixelov. Color (0, 150, 0)); pixely.show (); }} void num0lcd1 () {lcd1.setCursor (0, 0); lcd1.write (bajt (2)); // plný lcd1.setCursor (0, 1); lcd1.write (bajt (2)); lcd1.setCursor (1, 1); lcd1.write (byte (0)); // polovica vpravo lcd1.setCursor (1, 0); lcd1.write (bajt (1)); // polovica vľavo lcd1.setCursor (2, 1); lcd1.write (byte (0)); lcd1.setCursor (2, 0); lcd1.write (bajt (1)); lcd1.setCursor (3, 1); lcd1.write (byte (0)); lcd1.setCursor (3, 0); lcd1.write (bajt (1)); lcd1.setCursor (4, 1); lcd1.write (byte (0)); lcd1.setCursor (4, 0); lcd1.write (bajt (1)); lcd1.setCursor (5, 1); lcd1.write (byte (0)); lcd1.setCursor (5, 0); lcd1.write (bajt (1)); lcd1.setCursor (6, 1); lcd1.write (byte (0)); lcd1.setCursor (6, 0); lcd1.write (bajt (1)); lcd1.setCursor (7, 1); lcd1.write (byte (0)); lcd1.setCursor (7, 0); lcd1.write (bajt (1)); lcd1.setCursor (8, 1); lcd1.write (byte (0)); lcd1.setCursor (8, 0); lcd1.write (bajt (1)); lcd1.setCursor (9, 1); lcd1.write (byte (0)); lcd1.setCursor (9, 0); lcd1.write (bajt (1)); lcd1.setCursor (10, 1); lcd1.write (bajt (0)); lcd1.setCursor (10, 0); lcd1.write (bajt (1)); lcd1.setCursor (11, 1); lcd1.write (bajt (0)); lcd1.setCursor (11, 0); lcd1.write (bajt (1)); lcd1.setCursor (12, 1); lcd1.write (byte (0)); lcd1.setCursor (12, 0); lcd1.write (bajt (1)); lcd1.setCursor (13, 1); lcd1.write (bajt (0)); lcd1.setCursor (13, 0); lcd1.write (bajt (1)); lcd1.setCursor (14, 1); lcd1.write (byte (0)); lcd1.setCursor (14, 0); lcd1.write (bajt (1)); lcd1.setCursor (15, 1); lcd1.write (bajt (2)); lcd1.setCursor (15, 0); lcd1.write (bajt (2)); } neplatné 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 (bajt (0)); lcd1.setCursor (4, 1); lcd1.write (byte (0)); lcd1.setCursor (5, 1); lcd1.write (byte (0)); lcd1.setCursor (6, 1); lcd1.write (bajt (0)); lcd1.setCursor (7, 1); lcd1.write (byte (0)); lcd1.setCursor (8, 1); lcd1.write (bajt (0)); lcd1.setCursor (9, 1); lcd1.write (byte (0)); lcd1.setCursor (10, 1); lcd1.write (bajt (0)); lcd1.setCursor (11, 1); lcd1.write (bajt (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)); } neplatné num2lcd1 () {lcd1.setCursor (0, 0); lcd1.write (bajt (2)); // plný lcd1.setCursor (0, 1); lcd1.write (bajt (2)); lcd1.setCursor (1, 0); lcd1.write (bajt (1)); // polovica vľavo lcd1.setCursor (2, 0); lcd1.write (bajt (1)); lcd1.setCursor (3, 0); lcd1.write (bajt (1)); lcd1.setCursor (4, 0); lcd1.write (bajt (1)); lcd1.setCursor (5, 0); lcd1.write (bajt (1)); lcd1.setCursor (6, 0); lcd1.write (bajt (1)); lcd1.setCursor (7, 1); lcd1.write (bajt (2)); lcd1.setCursor (7, 0); lcd1.write (bajt (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 (bajt (2)); lcd1.setCursor (15, 0); lcd1.write (bajt (2)); } neplatné num3lcd1 () {lcd1.setCursor (0, 0); lcd1.write (bajt (2)); // plný lcd1.setCursor (0, 1); lcd1.write (bajt (2)); lcd1.setCursor (1, 1); lcd1.write (bajt (0)); // polovica vpravo lcd1.setCursor (2, 1); lcd1.write (byte (0)); lcd1.setCursor (3, 1); lcd1.write (bajt (0)); lcd1.setCursor (4, 1); lcd1.write (byte (0)); lcd1.setCursor (5, 1); lcd1.write (bajt (0)); lcd1.setCursor (6, 1); lcd1.write (bajt (0)); lcd1.setCursor (7, 1); lcd1.write (bajt (2)); lcd1.setCursor (7, 0); lcd1.write (bajt (2)); lcd1.setCursor (8, 1); lcd1.write (byte (0)); lcd1.setCursor (9, 1); lcd1.write (bajt (0)); lcd1.setCursor (10, 1); lcd1.write (bajt (0)); lcd1.setCursor (11, 1); lcd1.write (byte (0)); lcd1.setCursor (12, 1); lcd1.write (bajt (0)); lcd1.setCursor (13, 1); lcd1.write (byte (0)); lcd1.setCursor (14, 1); lcd1.write (bajt (0)); lcd1.setCursor (15, 1); lcd1.write (bajt (2)); lcd1.setCursor (15, 0); lcd1.write (bajt (2)); } neplatné num4lcd1 () {lcd1.setCursor (0, 1); lcd1.write (byte (0)); lcd1.setCursor (1, 1); lcd1.write (bajt (0)); lcd1.setCursor (2, 1); lcd1.write (byte (0)); lcd1.setCursor (3, 1); lcd1.write (byte (0)); lcd1.setCursor (4, 1); lcd1.write (bajt (0)); lcd1.setCursor (5, 1); lcd1.write (byte (0)); lcd1.setCursor (6, 1); lcd1.write (bajt (0)); lcd1.setCursor (7, 1); lcd1.write (bajt (2)); lcd1.setCursor (7, 0); lcd1.write (bajt (2)); lcd1.setCursor (8, 0); lcd1.write (bajt (1)); lcd1.setCursor (8, 1); lcd1.write (byte (0)); lcd1.setCursor (9, 0); lcd1.write (bajt (1)); lcd1.setCursor (9, 1); lcd1.write (byte (0)); lcd1.setCursor (10, 0); lcd1.write (bajt (1)); lcd1.setCursor (10, 1); lcd1.write (bajt (0)); lcd1.setCursor (11, 0); lcd1.write (bajt (1)); lcd1.setCursor (11, 1); lcd1.write (byte (0)); lcd1.setCursor (12, 0); lcd1.write (bajt (1)); lcd1.setCursor (12, 1); lcd1.write (byte (0)); lcd1.setCursor (13, 0); lcd1.write (bajt (1)); lcd1.setCursor (13, 1); lcd1.write (byte (0)); lcd1.setCursor (14, 0); lcd1.write (bajt (1)); lcd1.setCursor (14, 1); lcd1.write (bajt (0)); lcd1.setCursor (15, 0); lcd1.write (bajt (1)); lcd1.setCursor (15, 1); lcd1.write (byte (0)); } neplatné num5lcd1 () {lcd1.setCursor (0, 0); lcd1.write (bajt (2)); // plný lcd1.setCursor (0, 1); lcd1.write (bajt (2)); lcd1.setCursor (1, 1); lcd1.write (byte (0)); // polovica vpravo 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 (bajt (0)); lcd1.setCursor (7, 1); lcd1.write (bajt (2)); lcd1.setCursor (7, 0); lcd1.write (bajt (2)); lcd1.setCursor (8, 0); lcd1.write (bajt (1)); lcd1.setCursor (9, 0); lcd1.write (bajt (1)); lcd1.setCursor (10, 0); lcd1.write (bajt (1)); lcd1.setCursor (11, 0); lcd1.write (bajt (1)); lcd1.setCursor (12, 0); lcd1.write (bajt (1)); lcd1.setCursor (13, 0); lcd1.write (bajt (1)); lcd1.setCursor (14, 0); lcd1.write (bajt (1)); lcd1.setCursor (15, 1); lcd1.write (bajt (2)); lcd1.setCursor (15, 0); lcd1.write (bajt (2)); } neplatné num6lcd1 () {lcd1.setCursor (0, 0); lcd1.write (bajt (2)); // plný lcd1.setCursor (0, 1); lcd1.write (bajt (2)); lcd1.setCursor (1, 1); lcd1.write (byte (0)); // polovica vpravo lcd1.setCursor (1, 0); lcd1.write (bajt (1)); // polovica vľavo lcd1.setCursor (2, 1); lcd1.write (byte (0)); lcd1.setCursor (2, 0); lcd1.write (bajt (1)); lcd1.setCursor (3, 1); lcd1.write (bajt (0)); lcd1.setCursor (3, 0); lcd1.write (bajt (1)); lcd1.setCursor (4, 1); lcd1.write (byte (0)); lcd1.setCursor (4, 0); lcd1.write (bajt (1)); lcd1.setCursor (5, 1); lcd1.write (bajt (0)); lcd1.setCursor (5, 0); lcd1.write (bajt (1)); lcd1.setCursor (6, 1); lcd1.write (byte (0)); lcd1.setCursor (6, 0); lcd1.write (bajt (1)); lcd1.setCursor (7, 1); lcd1.write (bajt (2)); lcd1.setCursor (7, 0); lcd1.write (bajt (2)); lcd1.setCursor (8, 0); lcd1.write (bajt (1)); lcd1.setCursor (9, 0); lcd1.write (bajt (1)); lcd1.setCursor (10, 0); lcd1.write (bajt (1)); lcd1.setCursor (11, 0); lcd1.write (bajt (1)); lcd1.setCursor (12, 0); lcd1.write (bajt (1)); lcd1.setCursor (13, 0); lcd1.write (bajt (1)); lcd1.setCursor (14, 0); lcd1.write (bajt (1)); lcd1.setCursor (15, 1); lcd1.write (bajt (2)); lcd1.setCursor (15, 0); lcd1.write (bajt (2)); } neplatné num7lcd1 () {lcd1.setCursor (0, 1); lcd1.write (byte (0)); lcd1.setCursor (1, 1); lcd1.write (byte (0)); lcd1.setCursor (2, 1); lcd1.write (bajt (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 (bajt (0)); lcd1.setCursor (10,1); lcd1.write (bajt (0)); lcd1.setCursor (11, 1); lcd1.write (bajt (0)); lcd1.setCursor (12, 1); lcd1.write (bajt (0)); lcd1.setCursor (13, 1); lcd1.write (bajt (0)); lcd1.setCursor (14, 1); lcd1.write (bajt (0)); lcd1.setCursor (15, 1); lcd1.write (bajt (2)); lcd1.setCursor (15, 0); lcd1.write (bajt (2)); } neplatné num8lcd1 () {lcd1.setCursor (0, 0); lcd1.write (bajt (2)); // plný lcd1.setCursor (0, 1); lcd1.write (bajt (2)); lcd1.setCursor (1, 1); lcd1.write (bajt (0)); // polovica vpravo lcd1.setCursor (1, 0); lcd1.write (bajt (1)); // polovica vľavo lcd1.setCursor (2, 1); lcd1.write (bajt (0)); lcd1.setCursor (2, 0); lcd1.write (bajt (1)); lcd1.setCursor (3, 1); lcd1.write (bajt (0)); lcd1.setCursor (3, 0); lcd1.write (bajt (1)); lcd1.setCursor (4, 1); lcd1.write (bajt (0)); lcd1.setCursor (4, 0); lcd1.write (bajt (1)); lcd1.setCursor (5, 1); lcd1.write (bajt (0)); lcd1.setCursor (5, 0); lcd1.write (bajt (1)); lcd1.setCursor (6, 1); lcd1.write (bajt (0)); lcd1.setCursor (6, 0); lcd1.write (bajt (1)); lcd1.setCursor (7, 1); lcd1.write (bajt (2)); lcd1.setCursor (7, 0); lcd1.write (bajt (2)); lcd1.setCursor (8, 1); lcd1.write (bajt (0)); lcd1.setCursor (8, 0); lcd1.write (bajt (1)); lcd1.setCursor (9, 1); lcd1.write (bajt (0)); lcd1.setCursor (9, 0); lcd1.write (bajt (1)); lcd1.setCursor (10, 1); lcd1.write (bajt (0)); lcd1.setCursor (10, 0); lcd1.write (bajt (1)); lcd1.setCursor (11, 1); lcd1.write (bajt (0)); lcd1.setCursor (11, 0); lcd1.write (bajt (1)); lcd1.setCursor (12, 1); lcd1.write (bajt (0)); lcd1.setCursor (12, 0); lcd1.write (bajt (1)); lcd1.setCursor (13, 1); lcd1.write (bajt (0)); lcd1.setCursor (13, 0); lcd1.write (bajt (1)); lcd1.setCursor (14, 1); lcd1.write (bajt (0)); lcd1.setCursor (14, 0); lcd1.write (bajt (1)); lcd1.setCursor (15, 1); lcd1.write (bajt (2)); lcd1.setCursor (15, 0); lcd1.write (bajt (2)); } neplatné num9lcd1 () {lcd1.setCursor (0, 0); lcd1.write (bajt (2)); lcd1.setCursor (0, 1); lcd1.write (bajt (2)); lcd1.setCursor (1, 1); lcd1.write (bajt (0)); lcd1.setCursor (2, 1); lcd1.write (bajt (0)); lcd1.setCursor (3, 1); lcd1.write (bajt (0)); lcd1.setCursor (4, 1); lcd1.write (bajt (0)); lcd1.setCursor (5, 1); lcd1.write (bajt (0)); lcd1.setCursor (6, 1); lcd1.write (bajt (0)); lcd1.setCursor (7, 1); lcd1.write (bajt (2)); lcd1.setCursor (7, 0); lcd1.write (bajt (2)); lcd1.setCursor (8, 0); lcd1.write (bajt (1)); lcd1.setCursor (8, 1); lcd1.write (bajt (0)); lcd1.setCursor (9, 0); lcd1.write (bajt (1)); lcd1.setCursor (9, 1); lcd1.write (bajt (0)); lcd1.setCursor (10, 0); lcd1.write (bajt (1)); lcd1.setCursor (10, 1); lcd1.write (bajt (0)); lcd1.setCursor (11, 0); lcd1.write (bajt (1)); lcd1.setCursor (11, 1); lcd1.write (bajt (0)); lcd1.setCursor (12, 0); lcd1.write (bajt (1)); lcd1.setCursor (12, 1); lcd1.write (bajt (0)); lcd1.setCursor (13, 0); lcd1.write (bajt (1)); lcd1.setCursor (13, 1); lcd1.write (bajt (0)); lcd1.setCursor (14, 0); lcd1.write (bajt (1)); lcd1.setCursor (14, 1); lcd1.write (bajt (0)); lcd1.setCursor (15, 0); lcd1.write (bajt (2)); lcd1.setCursor (15, 1); lcd1.write (bajt (2)); } neplatné num0lcd2 () {lcd2.setCursor (0, 0); lcd2.write (bajt (2)); // plný lcd2.setCursor (0, 1); lcd2.write (bajt (2)); lcd2.setCursor (1, 1); lcd2.write (byte (0)); // polovica vpravo lcd2.setCursor (1, 0); lcd2.write (bajt (1)); // polovica vľavo lcd2.setCursor (2, 1); lcd2.write (byte (0)); lcd2.setCursor (2, 0); lcd2.write (bajt (1)); lcd2.setCursor (3, 1); lcd2.write (byte (0)); lcd2.setCursor (3, 0); lcd2.write (bajt (1)); lcd2.setCursor (4, 1); lcd2.write (byte (0)); lcd2.setCursor (4, 0); lcd2.write (bajt (1)); lcd2.setCursor (5, 1); lcd2.write (byte (0)); lcd2.setCursor (5, 0); lcd2.write (bajt (1)); lcd2.setCursor (6, 1); lcd2.write (byte (0)); lcd2.setCursor (6, 0); lcd2.write (bajt (1)); lcd2.setCursor (7, 1); lcd2.write (byte (0)); lcd2.setCursor (7, 0); lcd2.write (bajt (1)); lcd2.setCursor (8, 1); lcd2.write (byte (0)); lcd2.setCursor (8, 0); lcd2.write (bajt (1)); lcd2.setCursor (9, 1); lcd2.write (byte (0)); lcd2.setCursor (9, 0); lcd2.write (bajt (1)); lcd2.setCursor (10, 1); lcd2.write (byte (0)); lcd2.setCursor (10, 0); lcd2.write (bajt (1)); lcd2.setCursor (11, 1); lcd2.write (byte (0)); lcd2.setCursor (11, 0); lcd2.write (bajt (1)); lcd2.setCursor (12, 1); lcd2.write (byte (0)); lcd2.setCursor (12, 0); lcd2.write (bajt (1)); lcd2.setCursor (13, 1); lcd2.write (byte (0)); lcd2.setCursor (13, 0); lcd2.write (bajt (1)); lcd2.setCursor (14, 1); lcd2.write (byte (0)); lcd2.setCursor (14, 0); lcd2.write (bajt (1)); lcd2.setCursor (15, 1); lcd2.write (bajt (2)); lcd2.setCursor (15, 0); lcd2.write (bajt (2)); } neplatné 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)); } neplatné num2lcd2 () {lcd2.setCursor (0, 0); lcd2.write (bajt (2)); // plný lcd2.setCursor (0, 1); lcd2.write (bajt (2)); lcd2.setCursor (1, 0); lcd2.write (bajt (1)); // polovica vľavo lcd2.setCursor (2, 0); lcd2.write (bajt (1)); lcd2.setCursor (3, 0); lcd2.write (bajt (1)); lcd2.setCursor (4, 0); lcd2.write (bajt (1)); lcd2.setCursor (5, 0); lcd2.write (bajt (1)); lcd2.setCursor (6, 0); lcd2.write (bajt (1)); lcd2.setCursor (7, 1); lcd2.write (bajt (2)); lcd2.setCursor (7, 0); lcd2.write (bajt (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 (bajt (2)); lcd2.setCursor (15, 0); lcd2.write (bajt (2)); } neplatné num3lcd2 () {lcd2.setCursor (0, 0); lcd2.write (bajt (2)); // plný lcd2.setCursor (0, 1); lcd2.write (bajt (2)); lcd2.setCursor (1, 1); lcd2.write (byte (0)); // polovica vpravo 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 (bajt (2)); lcd2.setCursor (7, 0); lcd2.write (bajt (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 (bajt (2)); lcd2.setCursor (15, 0); lcd2.write (bajt (2)); } neplatné 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 (bajt (2)); lcd2.setCursor (7, 0); lcd2.write (bajt (2)); lcd2.setCursor (8, 0); lcd2.write (bajt (1)); lcd2.setCursor (8, 1); lcd2.write (byte (0)); lcd2.setCursor (9, 0); lcd2.write (bajt (1)); lcd2.setCursor (9, 1); lcd2.write (byte (0)); lcd2.setCursor (10, 0); lcd2.write (bajt (1)); lcd2.setCursor (10, 1); lcd2.write (byte (0)); lcd2.setCursor (11, 0); lcd2.write (bajt (1)); lcd2.setCursor (11, 1); lcd2.write (byte (0)); lcd2.setCursor (12, 0); lcd2.write (bajt (1)); lcd2.setCursor (12, 1); lcd2.write (byte (0)); lcd2.setCursor (13, 0); lcd2.write (bajt (1)); lcd2.setCursor (13, 1); lcd2.write (byte (0)); lcd2.setCursor (14, 0); lcd2.write (bajt (1)); lcd2.setCursor (14, 1); lcd2.write (byte (0)); lcd2.setCursor (15, 0); lcd2.write (bajt (1)); lcd2.setCursor (15, 1); lcd2.write (byte (0)); } neplatné num5lcd2 () {lcd2.setCursor (0, 0); lcd2.write (bajt (2)); // plný lcd2.setCursor (0, 1); lcd2.write (bajt (2)); lcd2.setCursor (1, 1); lcd2.write (byte (0)); // polovica vpravo 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 (bajt (2)); lcd2.setCursor (7, 0); lcd2.write (bajt (2)); lcd2.setCursor (8, 0); lcd2.write (bajt (1)); lcd2.setCursor (9, 0); lcd2.write (bajt (1)); lcd2.setCursor (10, 0); lcd2.write (bajt (1)); lcd2.setCursor (11, 0); lcd2.write (bajt (1)); lcd2.setCursor (12, 0); lcd2.write (bajt (1)); lcd2.setCursor (13, 0); lcd2.write (bajt (1)); lcd2.setCursor (14, 0); lcd2.write (bajt (1)); lcd2.setCursor (15, 1); lcd2.write (bajt (2)); lcd2.setCursor (15, 0); lcd2.write (bajt (2)); }

Krok 4: Spracovanie a konečná úprava

Pracovný a dokončovací dotyk
Pracovný a dokončovací dotyk

Pripojte arduino k počítaču a nechajte ho fungovať. Dúfam, že vaše hodiny budú fungovať. Funguje to, ale vyzerá to tak chaoticky. Toľko rezistorov a drôtov nie je dobré. Umiestnite teda všetky súčiastky do škatule a vyrežte jeden otvor pre displej LCD, ktorý vymaľuje škatuľu, a dajte vzhľad digitálnym hodinám.

Nevytvoril som ho v skutočnosti, ale navrhol som ho v OBVODOCH AUTODESK. Navrhnem to v skutočnosti a zverejním video z práce. Nie som rodený hovorca. Ak ste urobili chybu, dajte mi vedieť v súkromných správach. A mrzí ma táto chyba. Tiež som si vzal nejaký nápad z „Danových arduino hodín“. Zoznámte sa s ďalším pokynom.

Odporúča: