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, Listopad
Anonim
Úžasné hodiny Arduino
Úžasné hodiny Arduino

Viděli jsme mnoho projektů s arduino. Ale teď vám ukážu, jak postavit hodinky s arduino a 2 LCD displeji. Je to jednoduché, ale naprosto zábavné. Každý si to může vyzkoušet. Tak se připrav !!!

Krok 1: Sběr materiálu

Sběr materiálu
Sběr materiálu

Pokud to chcete udělat, budete potřebovat nějaké položky. Tyto položky můžete snadno zakoupit ve svém nejbližším obchodě.

Co budete potřebovat:

  1. Arduino UNO R3Neo
  2. Pixel Ring 24
  3. Chlebová deska
  4. LCD 16x2
  5. 100 ohmový rezistor (2)
  6. Rezistor 120 Ohm (2)
  7. Rezistor 10 K Ohm (2)
  8. Stiskněte tlačítko

Schéma těchto věcí je uvedeno výše. Můžete použít jakoukoli desku na chléb. Potřebujete 6 rezistorů, jejichž hodnoty jsou zapsány výše v seznamu. K připojení budete také potřebovat vodiče. Tyto LCD budete zobrazovat. Způsob zapojení obvodu můžete vidět v dalším kroku.

Krok 2: Zapojení všech součástí

Zapojení všech součástí
Zapojení všech součástí
Zapojení všech součástí
Zapojení všech součástí
Zapojení všech součástí
Zapojení všech součástí

Věci, které budete potřebovat. Ukázal jsem v předchozím kroku, takže si vezměte svůj drátěný obvod s sebou.

Kroky zapojení:

  1. Umístěte odpor 100 Ohmů na horní stranu desky chleba na zápornou linii.
  2. Umístěte odpor 120 Ohmů na horní stranu desky chleba na kladnou linku.
  3. Umístit tlačítko (diagram je zobrazen výše)
  4. Umístěte odpor 10 K Ohm pod tlačítko
  5. Připojte rezistory 100 ohmů (oba) k LCD displeji pomocí 'LED Cathode'
  6. Připojte 120 Ohm rezistory (oba) k LCD displeji pomocí 'LED anody'
  7. Připojte záporný terminál desky chleba z horního řádku ke 'Čtení/zápis'.
  8. Připojte záporný vývod desky chleba z horního řádku na 'Kontrast'.
  9. Připojte kladný terminál desky chleba ze spodního řádku na 'Vcc'.
  10. Připojte další záporný vývod desky chleba z horního řádku desky chleba k 'GND'.
  11. To samé proveďte na 2. LCD připojte všechny jako předchozí.
  12. Připojte zbývající odpory k záporné linii desky chleba.
  13. Připojte tlačítka k kladné linii.
  14. Připojte kladný a záporný terminál desky chleba k „Neo Pixel Ring 24“.

Nyní jste připojili všechny komponenty. Ale arduino stále zůstává. Schéma tohoto obrázku je uvedeno výše.

Kroky zapojení arduina ke všem komponentám:

  1. Připojte tlačítka (terminál22) k A0 a A1 arduina.
  2. Připojte GND k zápornému pólu desky chleba.
  3. Připojte 5V ke kladnému pólu desky chleba.
  4. Připojte D13 arduina k „Power of“„Neo Pixel Ring 24“
  5. Připojte D7 arduina k „Select Select“na LCD1.
  6. Připojte D8 arduina k „Enable“na LCD 2.
  7. Připojte D9 arduina k "DB4" na LCD 2.
  8. Připojte D10 arduina k "DB5" na LCD 2.
  9. Připojte D11 arduina k "DB6" na LCD 2.
  10. Připojte D12 arduina k "DB7" na LCD 2.
  11. Připojte D1 arduina k „Register Select“na LCD 1.
  12. Připojte D2 arduina k „Povolení“LCD 1.
  13. Připojte D3 arduina k "DB4" na LCD 2.
  14. Připojte D4 arduina k "DB5" na LCD 2.
  15. Připojte D5 arduina k "DB6" na LCD 2.
  16. Připojte D6 arduina k "DB7" na LCD 2.

Schéma všech komponent po zapojení je uvedeno výše.

Krok 3: Programování

Programování
Programování

Dokončili jste obvod. Nefunguje to však, dokud jej pro tento projekt nenaprogramujete. Pokud jste odborník a máte zkušenosti, snadno to naprogramujete. Doufám, že znáte software, který se k tomuto účelu používá. Naprogramujte to odpovídajícím způsobem, pokud chcete vytvořit změnu v programování, můžete, ale pamatujte si, že musí být správná. Jinak to nepůjde. Pokud jej nemůžete naprogramovat, můžete jej zkopírovat odtud nebo jej převzít z jiného zdroje.

#zahrnout

// Levý 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 #definovat PIN 13 #definovat NUMPIXELS 24Adafruit_NeoPixel pixelů = Adafruit_NeoPixel (NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800); int delayval = 50; long previousMillis = 0; dlouhý interval = 950; int sekund = 0; int hodina = 0; int hodinaButtonState = 0; int minButtonState = 0; byte full [8] = {B11111, B11111, B11111, B11111, B11111, B11111, B11111, B11111,}; byte halfL [8] = {B11111, B11111, B11111, B11111, B00000, B00000, B00, B00000,}; byte halfR [8] = {B00000, B00000, B00000, B00000, B11111, B11111, B11111, B11111,}; // // rutina nastavení se spustí jednou, když stisknete reset: void setup () {// set kolíky tlačítek pinMode (14, INPUT); // nastavit minutu pinMode (15, INPUT); // nastavení hodiny // vytvoření vlastních znaků lcd1.createChar (0, halfR); lcd1.createChar (1, polovina L); lcd1.createChar (2, plný); lcd2.createChar (0, halfR); lcd2.createChar (1, polovina L); lcd2.createChar (2, plný); // nastavení velikosti LCD1 lcd1.begin (16, 2); // nastavení velikosti LCD2 lcd2.begin (16, 2); // pixelový prsten pixely.begin (); // počáteční nastavení 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 smyčky běží stále znovu a znovu: void loop () {hourButtonState = digitalRead (15); minButtonState = digitalRead (14); if (hourButtonState == HIGH) {hodina ++; runClock (); } if (minButtonState == HIGH) {sekund ++; runClock (); } dlouhý nepodepsaný proudMillis = millis (); if (currentMillis - previousMillis> interval) {if (seconds == 59) {seconds = 0; if (hodina == 11) {hodina = 0; } else {hodina ++; }} else {sekund ++; } previousMillis = aktuálníMillis; runClock (); } zpoždění (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, pixely. Color (0, 0, 0)); pixely.setPixelColor (17, pixely. Color (0, 150, 0)); pixely.setPixelColor (18, pixely. Color (0, 150, 0)); pixely.show (); } if (hodina == 1) {pixely.setPixelColor (17, pixely. Color (0, 0, 0)); pixely.setPixelColor (18, pixely. Color (0, 0, 0)); pixely.setPixelColor (19, pixely. Color (0, 150, 0)); pixely.setPixelColor (20, pixely. Color (0, 150, 0)); pixely.show (); } if (hodina == 2) {pixely.setPixelColor (19, pixely. Color (0, 0, 0)); pixely.setPixelColor (20, pixely. Color (0, 0, 0)); pixely.setPixelColor (21, pixely. Color (0, 150, 0)); pixely.setPixelColor (22, pixely. 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, pixely. Color (0, 150, 0)); pixely.setPixelColor (0, pixely. 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)); pixely.setPixelColor (5, pixely. Color (0, 150, 0)); pixely.setPixelColor (6, pixely. 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)); pixely.setPixelColor (7, pixely. Color (0, 150, 0)); pixely.setPixelColor (8, pixely. Color (0, 150, 0)); pixely.show (); } if (hodina == 8) {pixely.setPixelColor (7, pixely. Color (0, 0, 0)); pixely.setPixelColor (8, pixely. Color (0, 0, 0)); pixely.setPixelColor (9, pixely. Color (0, 150, 0)); pixely.setPixelColor (10, pixely. Color (0, 150, 0)); pixely.show (); } if (hodina == 9) {pixely.setPixelColor (9, pixely. Color (0, 0, 0)); pixely.setPixelColor (10, pixely. Color (0, 0, 0)); pixely.setPixelColor (11, pixely. Color (0, 150, 0)); pixely.setPixelColor (12, pixely. Color (0, 150, 0)); pixely.show (); } if (hodina == 10) {pixely.setPixelColor (11, pixely. Color (0, 0, 0)); pixely.setPixelColor (12, pixely. Color (0, 0, 0)); pixely.setPixelColor (13, pixely. Color (0, 150, 0)); pixely.setPixelColor (14, pixely. Color (0, 150, 0)); pixely.show (); } if (hodina == 11) {pixely.setPixelColor (13, pixely. Color (0, 0, 0)); pixely.setPixelColor (14, pixely. Color (0, 0, 0)); pixely.setPixelColor (15, pixely. Color (0, 150, 0)); pixely.setPixelColor (16, pixely. Color (0, 150, 0)); pixely.show (); }} void num0lcd1 () {lcd1.setCursor (0, 0); lcd1.write (byte (2)); // plný lcd1.setCursor (0, 1); lcd1.write (byte (2)); lcd1.setCursor (1, 1); lcd1.write (byte (0)); // polovina vpravo lcd1.setCursor (1, 0); lcd1.write (byte (1)); // polovina vlevo 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)); // plný lcd1.setCursor (0, 1); lcd1.write (byte (2)); lcd1.setCursor (1, 0); lcd1.write (byte (1)); // polovina vlevo 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)); // plný lcd1.setCursor (0, 1); lcd1.write (byte (2)); lcd1.setCursor (1, 1); lcd1.write (byte (0)); // polovina 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 (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)); // plný lcd1.setCursor (0, 1); lcd1.write (byte (2)); lcd1.setCursor (1, 1); lcd1.write (byte (0)); // polovina 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 (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)); // plný lcd1.setCursor (0, 1); lcd1.write (byte (2)); lcd1.setCursor (1, 1); lcd1.write (byte (0)); // polovina vpravo lcd1.setCursor (1, 0); lcd1.write (byte (1)); // polovina vlevo 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)); // plný lcd1.setCursor (0, 1); lcd1.write (byte (2)); lcd1.setCursor (1, 1); lcd1.write (byte (0)); // polovina vpravo lcd1.setCursor (1, 0); lcd1.write (byte (1)); // polovina vlevo 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)); // plný lcd2.setCursor (0, 1); lcd2.write (byte (2)); lcd2.setCursor (1, 1); lcd2.write (byte (0)); // polovina vpravo lcd2.setCursor (1, 0); lcd2.write (byte (1)); // polovina vlevo 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)); // plný lcd2.setCursor (0, 1); lcd2.write (byte (2)); lcd2.setCursor (1, 0); lcd2.write (byte (1)); // polovina vlevo 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)); // plný lcd2.setCursor (0, 1); lcd2.write (byte (2)); lcd2.setCursor (1, 1); lcd2.write (byte (0)); // polovina 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 (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)); // plný lcd2.setCursor (0, 1); lcd2.write (byte (2)); lcd2.setCursor (1, 1); lcd2.write (byte (0)); // polovina 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 (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)); }

Krok 4: Práce a dokončovací dotek

Pracovní a dokončovací dotek
Pracovní a dokončovací dotek

Připojte arduino k počítači a nechte jej fungovat. Doufám, že vaše hodiny budou fungovat. Funguje to, ale vypadá to tak chaoticky. Tolik odporů a vodičů není dobré. Umístěte všechny součásti do krabice a vyřízněte jeden otvor pro LCD krabici a podívejte se na digitální hodiny.

Nevytvořil jsem to ve skutečnosti, ale navrhl jsem to v AUTODESK CIRCUITS. Navrhnu to ve skutečnosti a zveřejním video z práce. Nejsem rodilý mluvčí. Pokud jste udělali nějakou chybu, informujte mě v soukromých zprávách. A omlouvám se za tu chybu. Nějaký nápad jsem také převzal z „Dan's arduino Clock“. Seznamte se s dalším instruktážním.

Doporučuje: