Satura rādītājs:

Lielisks Arduino pulkstenis: 4 soļi
Lielisks Arduino pulkstenis: 4 soļi

Video: Lielisks Arduino pulkstenis: 4 soļi

Video: Lielisks Arduino pulkstenis: 4 soļi
Video: 14 интересных товаров и гаджетов с Aliexpress, которые вам пригодятся 2024, Novembris
Anonim
Lielisks Arduino pulkstenis
Lielisks Arduino pulkstenis

Mēs esam redzējuši daudzus projektus ar arduino. Bet tagad es jums parādīšu, kā izveidot pulksteni ar arduino un 2 LCD displejiem. Tas ir vienkārši, bet pilnīgi jautri. To var izmēģināt ikviens. Tātad, esiet gatavi !!!

1. darbība: materiālu vākšana

Materiālu vākšana
Materiālu vākšana

Ja vēlaties to pagatavot, jums būs nepieciešami daži priekšmeti. Šīs preces varat viegli iegādāties tuvākajā mazumtirdzniecības veikalā.

Kas jums būs nepieciešams:

  1. Arduino UNO R3Neo
  2. Pikseļu gredzens 24
  3. Maizes dēlis
  4. LCD 16x2
  5. 100 omu rezistors (2)
  6. 120 omu rezistors (2)
  7. 10 K omu rezistors (2)
  8. Uzspied pogu

Šo lietu diagramma ir parādīta iepriekš. Jūs varat izmantot jebkuru maizes dēli. Jums nepieciešami 6 rezistori, kuru vērtības ir rakstītas iepriekš sarakstā. Savienošanai būs nepieciešami arī vadi. Šie LCD displeji. Elektroinstalācijas shēmas metode, kuru varat redzēt nākamajā darbībā.

2. solis: visu komponentu savienošana

Visu komponentu elektroinstalācija
Visu komponentu elektroinstalācija
Visu komponentu elektroinstalācija
Visu komponentu elektroinstalācija
Visu komponentu elektroinstalācija
Visu komponentu elektroinstalācija

Lietas, kas jums būs nepieciešamas. Es parādīju iepriekšējā solī, tāpēc ņemiet līdzi savu maizes dēļa vadu ķēdi.

Elektroinstalācijas soļi:

  1. Novietojiet 100 omu rezistoru maizes dēļa augšējā pusē uz negatīvās līnijas.
  2. Novietojiet 120 omu rezistoru maizes dēļa augšējā pusē uz pozitīvās līnijas.
  3. Novietojiet spiedpogu (diagramma ir parādīta iepriekš)
  4. Novietojiet 10 K omu rezistoru zem spiedpogas
  5. Pievienojiet 100 omu rezistorus (abus) LCD displejam ar LED katodu
  6. Pievienojiet 120 omu rezistorus (abus) LCD displejam ar LED anodu
  7. Pievienojiet maizes dēļa negatīvo spaili no augšējās rindas uz “Lasīt/rakstīt”.
  8. Pievienojiet maizes dēļa negatīvo spaili no augšējās līnijas uz kontrastu.
  9. Pievienojiet maizes dēļa pozitīvo spaili no apakšējās līnijas uz “Vcc”.
  10. Pievienojiet vēl vienu maizes dēļa negatīvo spaili no maizes tāfeles augšējās līnijas līdz 'GND'.
  11. Dariet to pašu 2. LCD savienojiet visus šos tāpat kā iepriekšējo.
  12. Pievienojiet atlikušos rezistorus maizes dēļa negatīvajai līnijai.
  13. Pievienojiet spiedpogas pozitīvajai līnijai.
  14. Savienojiet maizes dēļa pozitīvo un negatīvo spaili ar "Neo Pixel Ring 24".

Tagad jūs esat savienojis visus komponentus. Bet arduino joprojām paliek. Diagramma par to parādīta iepriekš.

Arduino pieslēgšanas soļi visām sastāvdaļām:

  1. Savienojiet spiedpogas (terminālis22) arduino A0 un A1.
  2. Savienojiet GND ar maizes dēļa negatīvo spaili.
  3. Pievienojiet 5V maizes dēļa pozitīvajam spailim.
  4. Savienojiet arduino D13 ar "Power of" "Neo Pixel Ring 24"
  5. Savienojiet arduino D7 ar LCD1 "Register Select".
  6. Savienojiet arduino D8 ar LCD 2 "Iespējot".
  7. Savienojiet arduino D9 ar LCD 2 "DB4".
  8. Savienojiet arduino D10 ar LCD 2 "DB5".
  9. Savienojiet arduino D11 ar LCD 2 "DB6".
  10. Savienojiet arduino D12 ar LCD 2 "DB7".
  11. Savienojiet arduino D1 ar LCD 1 "Register Select".
  12. Savienojiet arduino D2 ar LCD 1 "Iespējot".
  13. Savienojiet arduino D3 ar LCD 2 "DB4".
  14. Savienojiet arduino D4 ar LCD 2 "DB5".
  15. Savienojiet arduino D5 ar LCD 2 "DB6".
  16. Savienojiet arduino D6 ar LCD 2 "DB7".

Visu komponentu shēma pēc elektroinstalācijas ir parādīta iepriekš.

3. solis: programmēšana

Programmēšana
Programmēšana

Jūs esat pabeidzis ķēdi. Bet tas nedarbojas, kamēr neesat to ieprogrammējis šim projektam. Ja esat eksperts un jums ir pieredze, jūs to viegli ieprogrammēsit. Es ceru, ka jūs zināt programmatūru, kas tiek izmantota šim nolūkam. Programmējiet to atbilstoši, ja vēlaties izveidot izmaiņas programmēšanā, taču atcerieties, ka tām jābūt pareizām. Pretējā gadījumā tas nedarbosies. Ja nevarat to ieprogrammēt, varat kopēt no šejienes vai ņemt to no cita avota.

#iekļaut

// Kreisais LCD LiquidCrystal lcd1 (7, 8, 9, 10, 11, 12); // Labais LCD 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; sen iepriekšMillis = 0; garš intervāls = 950; int sekundes = 0; int stunda = 0; int stundaButtonState = 0; int minButtonState = 0; baits pilns [8] = {B11111, B11111, B11111, B11111, B11111, B11111, B11111, B11111,}; baits halfL [8] = {B11111, B11111, B11111, B11111, B00000, B00000, B00000,}; baits halfR [8] = {B00000, B00000, B00000, B00000, B11111, B11111, B11111, B11111,}; // iestatīšanas rutīna darbojas vienreiz, nospiežot reset: void setup () {// set pogu tapas pinMode (14, INPUT); // iestatīt minūtes pinMode (15, INPUT); // iestatīt stundu // izveidot pielāgotas rakstzīmes lcd1.createChar (0, halfR); lcd1.createChar (1, puseL); lcd1.createChar (2, pilns); lcd2.createChar (0, halfR); lcd2.createChar (1, puseL); lcd2.createChar (2, pilns); // iestatiet LCD1 izmēru lcd1.begin (16, 2); // iestatiet LCD2 izmēru lcd2.begin (16, 2); // pikseļu gredzens pixels.begin (); // sākotnējā iestatīšana lcd1.clear (); num0lcd1 (); lcd2.clear (); num0lcd2 (); //pixels.setPixelColor(17, pixels. Color (0, 150, 0)); //pixels.setPixelColor(18, pixels. Color (0, 150, 0)); pikseļi.parādīt (); } // cilpas rutīna atkal un atkal darbojas mūžīgi: void loop () {hourButtonState = digitalRead (15); minButtonState = digitalRead (14); if (hourButtonState == HIGH) {stunda ++; runClock (); } ja (minButtonState == HIGH) {sekundes ++; runClock (); } neparakstīta garā strāvaMillis = millis (); if (currentMillis - previousMillis> intervāls) {if (sekundes == 59) {sekundes = 0; ja (stunda == 11) {stunda = 0; } cits {stunda ++; }} cits {sekundes ++; } iepriekšējaisMillis = pašreizējaisMillis; runClock (); } kavēšanās (10); } void runClock () {if (sekundes == 0) {lcd1.clear (); num0lcd1 (); lcd2.clear (); num0lcd2 (); } ja (sekundes == 1 || sekundes == 11 || sekundes == 21 || sekundes == 31 || sekundes == 41 || sekundes == 51) {lcd1.clear (); num1lcd1 (); } ja (sekundes == 2 || sekundes == 12 || sekundes == 22 || sekundes == 32 || sekundes == 42 || sekundes == 52) {lcd1.clear (); num2lcd1 (); } ja (sekundes == 3 || sekundes == 13 || sekundes == 23 || sekundes == 33 || sekundes == 43 || sekundes == 53) {lcd1.clear (); num3lcd1 (); } ja (sekundes == 4 || sekundes == 14 || sekundes == 24 || sekundes == 34 || sekundes == 44 || sekundes == 54) {lcd1.clear (); num4lcd1 (); } ja (sekundes == 5 || sekundes == 15 || sekundes == 25 || sekundes == 35 || sekundes == 45 || sekundes == 55) {lcd1.clear (); num5lcd1 (); } ja (sekundes == 6 || sekundes == 16 || sekundes == 26 || sekundes == 36 || sekundes == 46 || sekundes == 56) {lcd1.clear (); num6lcd1 (); } ja (sekundes == 7 || sekundes == 17 || sekundes == 27 || sekundes == 37 || sekundes == 47 || sekundes == 57) {lcd1.clear (); num7lcd1 (); } ja (sekundes == 8 || sekundes == 18 || sekundes == 28 || sekundes == 38 || sekundes == 48 || sekundes == 58) {lcd1.clear (); num8lcd1 (); } ja (sekundes == 9 || sekundes == 19 || sekundes == 29 || sekundes == 39 || sekundes == 49 || sekundes == 59) {lcd1.clear (); num9lcd1 (); } ja (sekundes == 10) {lcd1.clear (); num0lcd1 (); lcd2.clear (); num1lcd2 (); } ja (sekundes == 20) {lcd1.clear (); num0lcd1 (); lcd2.clear (); num2lcd2 (); } ja (sekundes == 30) {lcd1.clear (); num0lcd1 (); lcd2.clear (); num3lcd2 (); } ja (sekundes == 40) {lcd1.clear (); num0lcd1 (); lcd2.clear (); num4lcd2 (); } ja (sekundes == 50) {lcd1.clear (); num0lcd1 (); lcd2.clear (); num5lcd2 (); } ja (stunda == 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)); pikseļi.parādīt (); } ja (stunda == 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)); pikseļi.parādīt (); } ja (stunda == 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)); pikseļi.parādīt (); } ja (stunda == 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)); pikseļi.parādīt (); } ja (stunda == 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)); pikseļi.parādīt (); } ja (stunda == 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)); pikseļi.parādīt (); } ja (stunda == 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)); pikseļi.parādīt (); } ja (stunda == 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)); pikseļi.parādīt (); } ja (stunda == 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)); pikseļi.parādīt (); } ja (stunda == 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)); pikseļi.parādīt (); } ja (stunda == 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)); pikseļi.parādīt (); } ja (stunda == 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)); pikseļi.parādīt (); }} void num0lcd1 () {lcd1.setCursor (0, 0); lcd1.write (baits (2)); // pilns lcd1.setCursor (0, 1); lcd1.write (baits (2)); lcd1.setCursor (1, 1); lcd1.write (baits (0)); // puse pa labi lcd1.setCursor (1, 0); lcd1.write (baits (1)); // puse pa kreisi lcd1.setCursor (2, 1); lcd1.write (baits (0)); lcd1.setCursor (2, 0); lcd1.write (baits (1)); lcd1.setCursor (3, 1); lcd1.write (baits (0)); lcd1.setCursor (3, 0); lcd1.write (baits (1)); lcd1.setCursor (4, 1); lcd1.write (baits (0)); lcd1.setCursor (4, 0); lcd1.write (baits (1)); lcd1.setCursor (5, 1); lcd1.write (baits (0)); lcd1.setCursor (5, 0); lcd1.write (baits (1)); lcd1.setCursor (6, 1); lcd1.write (baits (0)); lcd1.setCursor (6, 0); lcd1.write (baits (1)); lcd1.setCursor (7, 1); lcd1.write (baits (0)); lcd1.setCursor (7, 0); lcd1.write (baits (1)); lcd1.setCursor (8, 1); lcd1.write (baits (0)); lcd1.setCursor (8, 0); lcd1.write (baits (1)); lcd1.setCursor (9, 1); lcd1.write (baits (0)); lcd1.setCursor (9, 0); lcd1.write (baits (1)); lcd1.setCursor (10, 1); lcd1.write (baits (0)); lcd1.setCursor (10, 0); lcd1.write (baits (1)); lcd1.setCursor (11, 1); lcd1.write (baits (0)); lcd1.setCursor (11, 0); lcd1.write (baits (1)); lcd1.setCursor (12, 1); lcd1.write (baits (0)); lcd1.setCursor (12, 0); lcd1.write (baits (1)); lcd1.setCursor (13, 1); lcd1.write (baits (0)); lcd1.setCursor (13, 0); lcd1.write (baits (1)); lcd1.setCursor (14, 1); lcd1.write (baits (0)); lcd1.setCursor (14, 0); lcd1.write (baits (1)); lcd1.setCursor (15, 1); lcd1.write (baits (2)); lcd1.setCursor (15, 0); lcd1.write (baits (2)); } void num1lcd1 () {lcd1.setCursor (0, 1); lcd1.write (baits (0)); lcd1.setCursor (1, 1); lcd1.write (baits (0)); lcd1.setCursor (2, 1); lcd1.write (baits (0)); lcd1.setCursor (3, 1); lcd1.write (baits (0)); lcd1.setCursor (4, 1); lcd1.write (baits (0)); lcd1.setCursor (5, 1); lcd1.write (baits (0)); lcd1.setCursor (6, 1); lcd1.write (baits (0)); lcd1.setCursor (7, 1); lcd1.write (baits (0)); lcd1.setCursor (8, 1); lcd1.write (baits (0)); lcd1.setCursor (9, 1); lcd1.write (baits (0)); lcd1.setCursor (10, 1); lcd1.write (baits (0)); lcd1.setCursor (11, 1); lcd1.write (baits (0)); lcd1.setCursor (12, 1); lcd1.write (baits (0)); lcd1.setCursor (13, 1); lcd1.write (baits (0)); lcd1.setCursor (14, 1); lcd1.write (baits (0)); lcd1.setCursor (15, 1); lcd1.write (baits (0)); } void num2lcd1 () {lcd1.setCursor (0, 0); lcd1.write (baits (2)); // pilns lcd1.setCursor (0, 1); lcd1.write (baits (2)); lcd1.setCursor (1, 0); lcd1.write (baits (1)); // puse pa kreisi lcd1.setCursor (2, 0); lcd1.write (baits (1)); lcd1.setCursor (3, 0); lcd1.write (baits (1)); lcd1.setCursor (4, 0); lcd1.write (baits (1)); lcd1.setCursor (5, 0); lcd1.write (baits (1)); lcd1.setCursor (6, 0); lcd1.write (baits (1)); lcd1.setCursor (7, 1); lcd1.write (baits (2)); lcd1.setCursor (7, 0); lcd1.write (baits (2)); lcd1.setCursor (8, 1); lcd1.write (baits (0)); lcd1.setCursor (9, 1); lcd1.write (baits (0)); lcd1.setCursor (10, 1); lcd1.write (baits (0)); lcd1.setCursor (11, 1); lcd1.write (baits (0)); lcd1.setCursor (12, 1); lcd1.write (baits (0)); lcd1.setCursor (13, 1); lcd1.write (baits (0)); lcd1.setCursor (14, 1); lcd1.write (baits (0)); lcd1.setCursor (15, 1); lcd1.write (baits (2)); lcd1.setCursor (15, 0); lcd1.write (baits (2)); } void num3lcd1 () {lcd1.setCursor (0, 0); lcd1.write (baits (2)); // pilns lcd1.setCursor (0, 1); lcd1.write (baits (2)); lcd1.setCursor (1, 1); lcd1.write (baits (0)); // puse pa labi lcd1.setCursor (2, 1); lcd1.write (baits (0)); lcd1.setCursor (3, 1); lcd1.write (baits (0)); lcd1.setCursor (4, 1); lcd1.write (baits (0)); lcd1.setCursor (5, 1); lcd1.write (baits (0)); lcd1.setCursor (6, 1); lcd1.write (baits (0)); lcd1.setCursor (7, 1); lcd1.write (baits (2)); lcd1.setCursor (7, 0); lcd1.write (baits (2)); lcd1.setCursor (8, 1); lcd1.write (baits (0)); lcd1.setCursor (9, 1); lcd1.write (baits (0)); lcd1.setCursor (10, 1); lcd1.write (baits (0)); lcd1.setCursor (11, 1); lcd1.write (baits (0)); lcd1.setCursor (12, 1); lcd1.write (baits (0)); lcd1.setCursor (13, 1); lcd1.write (baits (0)); lcd1.setCursor (14, 1); lcd1.write (baits (0)); lcd1.setCursor (15, 1); lcd1.write (baits (2)); lcd1.setCursor (15, 0); lcd1.write (baits (2)); } void num4lcd1 () {lcd1.setCursor (0, 1); lcd1.write (baits (0)); lcd1.setCursor (1, 1); lcd1.write (baits (0)); lcd1.setCursor (2, 1); lcd1.write (baits (0)); lcd1.setCursor (3, 1); lcd1.write (baits (0)); lcd1.setCursor (4, 1); lcd1.write (baits (0)); lcd1.setCursor (5, 1); lcd1.write (baits (0)); lcd1.setCursor (6, 1); lcd1.write (baits (0)); lcd1.setCursor (7, 1); lcd1.write (baits (2)); lcd1.setCursor (7, 0); lcd1.write (baits (2)); lcd1.setCursor (8, 0); lcd1.write (baits (1)); lcd1.setCursor (8, 1); lcd1.write (baits (0)); lcd1.setCursor (9, 0); lcd1.write (baits (1)); lcd1.setCursor (9, 1); lcd1.write (baits (0)); lcd1.setCursor (10, 0); lcd1.write (baits (1)); lcd1.setCursor (10, 1); lcd1.write (baits (0)); lcd1.setCursor (11, 0); lcd1.write (baits (1)); lcd1.setCursor (11, 1); lcd1.write (baits (0)); lcd1.setCursor (12, 0); lcd1.write (baits (1)); lcd1.setCursor (12, 1); lcd1.write (baits (0)); lcd1.setCursor (13, 0); lcd1.write (baits (1)); lcd1.setCursor (13, 1); lcd1.write (baits (0)); lcd1.setCursor (14, 0); lcd1.write (baits (1)); lcd1.setCursor (14, 1); lcd1.write (baits (0)); lcd1.setCursor (15, 0); lcd1.write (baits (1)); lcd1.setCursor (15, 1); lcd1.write (baits (0)); } void num5lcd1 () {lcd1.setCursor (0, 0); lcd1.write (baits (2)); // pilns lcd1.setCursor (0, 1); lcd1.write (baits (2)); lcd1.setCursor (1, 1); lcd1.write (baits (0)); // puse pa labi lcd1.setCursor (2, 1); lcd1.write (baits (0)); lcd1.setCursor (3, 1); lcd1.write (baits (0)); lcd1.setCursor (4, 1); lcd1.write (baits (0)); lcd1.setCursor (5, 1); lcd1.write (baits (0)); lcd1.setCursor (6, 1); lcd1.write (baits (0)); lcd1.setCursor (7, 1); lcd1.write (baits (2)); lcd1.setCursor (7, 0); lcd1.write (baits (2)); lcd1.setCursor (8, 0); lcd1.write (baits (1)); lcd1.setCursor (9, 0); lcd1.write (baits (1)); lcd1.setCursor (10, 0); lcd1.write (baits (1)); lcd1.setCursor (11, 0); lcd1.write (baits (1)); lcd1.setCursor (12, 0); lcd1.write (baits (1)); lcd1.setCursor (13, 0); lcd1.write (baits (1)); lcd1.setCursor (14, 0); lcd1.write (baits (1)); lcd1.setCursor (15, 1); lcd1.write (baits (2)); lcd1.setCursor (15, 0); lcd1.write (baits (2)); } void num6lcd1 () {lcd1.setCursor (0, 0); lcd1.write (baits (2)); // pilns lcd1.setCursor (0, 1); lcd1.write (baits (2)); lcd1.setCursor (1, 1); lcd1.write (baits (0)); // puse pa labi lcd1.setCursor (1, 0); lcd1.write (baits (1)); // puse pa kreisi lcd1.setCursor (2, 1); lcd1.write (baits (0)); lcd1.setCursor (2, 0); lcd1.write (baits (1)); lcd1.setCursor (3, 1); lcd1.write (baits (0)); lcd1.setCursor (3, 0); lcd1.write (baits (1)); lcd1.setCursor (4, 1); lcd1.write (baits (0)); lcd1.setCursor (4, 0); lcd1.write (baits (1)); lcd1.setCursor (5, 1); lcd1.write (baits (0)); lcd1.setCursor (5, 0); lcd1.write (baits (1)); lcd1.setCursor (6, 1); lcd1.write (baits (0)); lcd1.setCursor (6, 0); lcd1.write (baits (1)); lcd1.setCursor (7, 1); lcd1.write (baits (2)); lcd1.setCursor (7, 0); lcd1.write (baits (2)); lcd1.setCursor (8, 0); lcd1.write (baits (1)); lcd1.setCursor (9, 0); lcd1.write (baits (1)); lcd1.setCursor (10, 0); lcd1.write (baits (1)); lcd1.setCursor (11, 0); lcd1.write (baits (1)); lcd1.setCursor (12, 0); lcd1.write (baits (1)); lcd1.setCursor (13, 0); lcd1.write (baits (1)); lcd1.setCursor (14, 0); lcd1.write (baits (1)); lcd1.setCursor (15, 1); lcd1.write (baits (2)); lcd1.setCursor (15, 0); lcd1.write (baits (2)); } void num7lcd1 () {lcd1.setCursor (0, 1); lcd1.write (baits (0)); lcd1.setCursor (1, 1); lcd1.write (baits (0)); lcd1.setCursor (2, 1); lcd1.write (baits (0)); lcd1.setCursor (3, 1); lcd1.write (baits (0)); lcd1.setCursor (4, 1); lcd1.write (baits (0)); lcd1.setCursor (5, 1); lcd1.write (baits (0)); lcd1.setCursor (6, 1); lcd1.write (baits (0)); lcd1.setCursor (7, 1); lcd1.write (baits (0)); lcd1.setCursor (8, 1); lcd1.write (baits (0)); lcd1.setCursor (9, 1); lcd1.write (baits (0)); lcd1.setCursor (10,1); lcd1.write (baits (0)); lcd1.setCursor (11, 1); lcd1.write (baits (0)); lcd1.setCursor (12, 1); lcd1.write (baits (0)); lcd1.setCursor (13, 1); lcd1.write (baits (0)); lcd1.setCursor (14, 1); lcd1.write (baits (0)); lcd1.setCursor (15, 1); lcd1.write (baits (2)); lcd1.setCursor (15, 0); lcd1.write (baits (2)); } void num8lcd1 () {lcd1.setCursor (0, 0); lcd1.write (baits (2)); // pilns lcd1.setCursor (0, 1); lcd1.write (baits (2)); lcd1.setCursor (1, 1); lcd1.write (baits (0)); // puse pa labi lcd1.setCursor (1, 0); lcd1.write (baits (1)); // puse pa kreisi lcd1.setCursor (2, 1); lcd1.write (baits (0)); lcd1.setCursor (2, 0); lcd1.write (baits (1)); lcd1.setCursor (3, 1); lcd1.write (baits (0)); lcd1.setCursor (3, 0); lcd1.write (baits (1)); lcd1.setCursor (4, 1); lcd1.write (baits (0)); lcd1.setCursor (4, 0); lcd1.write (baits (1)); lcd1.setCursor (5, 1); lcd1.write (baits (0)); lcd1.setCursor (5, 0); lcd1.write (baits (1)); lcd1.setCursor (6, 1); lcd1.write (baits (0)); lcd1.setCursor (6, 0); lcd1.write (baits (1)); lcd1.setCursor (7, 1); lcd1.write (baits (2)); lcd1.setCursor (7, 0); lcd1.write (baits (2)); lcd1.setCursor (8, 1); lcd1.write (baits (0)); lcd1.setCursor (8, 0); lcd1.write (baits (1)); lcd1.setCursor (9, 1); lcd1.write (baits (0)); lcd1.setCursor (9, 0); lcd1.write (baits (1)); lcd1.setCursor (10, 1); lcd1.write (baits (0)); lcd1.setCursor (10, 0); lcd1.write (baits (1)); lcd1.setCursor (11, 1); lcd1.write (baits (0)); lcd1.setCursor (11, 0); lcd1.write (baits (1)); lcd1.setCursor (12, 1); lcd1.write (baits (0)); lcd1.setCursor (12, 0); lcd1.write (baits (1)); lcd1.setCursor (13, 1); lcd1.write (baits (0)); lcd1.setCursor (13, 0); lcd1.write (baits (1)); lcd1.setCursor (14, 1); lcd1.write (baits (0)); lcd1.setCursor (14, 0); lcd1.write (baits (1)); lcd1.setCursor (15, 1); lcd1.write (baits (2)); lcd1.setCursor (15, 0); lcd1.write (baits (2)); } void num9lcd1 () {lcd1.setCursor (0, 0); lcd1.write (baits (2)); lcd1.setCursor (0, 1); lcd1.write (baits (2)); lcd1.setCursor (1, 1); lcd1.write (baits (0)); lcd1.setCursor (2, 1); lcd1.write (baits (0)); lcd1.setCursor (3, 1); lcd1.write (baits (0)); lcd1.setCursor (4, 1); lcd1.write (baits (0)); lcd1.setCursor (5, 1); lcd1.write (baits (0)); lcd1.setCursor (6, 1); lcd1.write (baits (0)); lcd1.setCursor (7, 1); lcd1.write (baits (2)); lcd1.setCursor (7, 0); lcd1.write (baits (2)); lcd1.setCursor (8, 0); lcd1.write (baits (1)); lcd1.setCursor (8, 1); lcd1.write (baits (0)); lcd1.setCursor (9, 0); lcd1.write (baits (1)); lcd1.setCursor (9, 1); lcd1.write (baits (0)); lcd1.setCursor (10, 0); lcd1.write (baits (1)); lcd1.setCursor (10, 1); lcd1.write (baits (0)); lcd1.setCursor (11, 0); lcd1.write (baits (1)); lcd1.setCursor (11, 1); lcd1.write (baits (0)); lcd1.setCursor (12, 0); lcd1.write (baits (1)); lcd1.setCursor (12, 1); lcd1.write (baits (0)); lcd1.setCursor (13, 0); lcd1.write (baits (1)); lcd1.setCursor (13, 1); lcd1.write (baits (0)); lcd1.setCursor (14, 0); lcd1.write (baits (1)); lcd1.setCursor (14, 1); lcd1.write (baits (0)); lcd1.setCursor (15, 0); lcd1.write (baits (2)); lcd1.setCursor (15, 1); lcd1.write (baits (2)); } void num0lcd2 () {lcd2.setCursor (0, 0); lcd2.write (baits (2)); // pilns lcd2.setCursor (0, 1); lcd2.write (baits (2)); lcd2.setCursor (1, 1); lcd2.write (baits (0)); // puse pa labi lcd2.setCursor (1, 0); lcd2.write (baits (1)); // puse pa kreisi lcd2.setCursor (2, 1); lcd2.write (baits (0)); lcd2.setCursor (2, 0); lcd2.write (baits (1)); lcd2.setCursor (3, 1); lcd2.write (baits (0)); lcd2.setCursor (3, 0); lcd2.write (baits (1)); lcd2.setCursor (4, 1); lcd2.write (baits (0)); lcd2.setCursor (4, 0); lcd2.write (baits (1)); lcd2.setCursor (5, 1); lcd2.write (baits (0)); lcd2.setCursor (5, 0); lcd2.write (baits (1)); lcd2.setCursor (6, 1); lcd2.write (baits (0)); lcd2.setCursor (6, 0); lcd2.write (baits (1)); lcd2.setCursor (7, 1); lcd2.write (baits (0)); lcd2.setCursor (7, 0); lcd2.write (baits (1)); lcd2.setCursor (8, 1); lcd2.write (baits (0)); lcd2.setCursor (8, 0); lcd2.write (baits (1)); lcd2.setCursor (9, 1); lcd2.write (baits (0)); lcd2.setCursor (9, 0); lcd2.write (baits (1)); lcd2.setCursor (10, 1); lcd2.write (baits (0)); lcd2.setCursor (10, 0); lcd2.write (baits (1)); lcd2.setCursor (11, 1); lcd2.write (baits (0)); lcd2.setCursor (11, 0); lcd2.write (baits (1)); lcd2.setCursor (12, 1); lcd2.write (baits (0)); lcd2.setCursor (12, 0); lcd2.write (baits (1)); lcd2.setCursor (13, 1); lcd2.write (baits (0)); lcd2.setCursor (13, 0); lcd2.write (baits (1)); lcd2.setCursor (14, 1); lcd2.write (baits (0)); lcd2.setCursor (14, 0); lcd2.write (baits (1)); lcd2.setCursor (15, 1); lcd2.write (baits (2)); lcd2.setCursor (15, 0); lcd2.write (baits (2)); } void num1lcd2 () {lcd2.setCursor (0, 1); lcd2.write (baits (0)); lcd2.setCursor (1, 1); lcd2.write (baits (0)); lcd2.setCursor (2, 1); lcd2.write (baits (0)); lcd2.setCursor (3, 1); lcd2.write (baits (0)); lcd2.setCursor (4, 1); lcd2.write (baits (0)); lcd2.setCursor (5, 1); lcd2.write (baits (0)); lcd2.setCursor (6, 1); lcd2.write (baits (0)); lcd2.setCursor (7, 1); lcd2.write (baits (0)); lcd2.setCursor (8, 1); lcd2.write (baits (0)); lcd2.setCursor (9, 1); lcd2.write (baits (0)); lcd2.setCursor (10, 1); lcd2.write (baits (0)); lcd2.setCursor (11, 1); lcd2.write (baits (0)); lcd2.setCursor (12, 1); lcd2.write (baits (0)); lcd2.setCursor (13, 1); lcd2.write (baits (0)); lcd2.setCursor (14, 1); lcd2.write (baits (0)); lcd2.setCursor (15, 1); lcd2.write (baits (0)); } void num2lcd2 () {lcd2.setCursor (0, 0); lcd2.write (baits (2)); // pilns lcd2.setCursor (0, 1); lcd2.write (baits (2)); lcd2.setCursor (1, 0); lcd2.write (baits (1)); // puse pa kreisi lcd2.setCursor (2, 0); lcd2.write (baits (1)); lcd2.setCursor (3, 0); lcd2.write (baits (1)); lcd2.setCursor (4, 0); lcd2.write (baits (1)); lcd2.setCursor (5, 0); lcd2.write (baits (1)); lcd2.setCursor (6, 0); lcd2.write (baits (1)); lcd2.setCursor (7, 1); lcd2.write (baits (2)); lcd2.setCursor (7, 0); lcd2.write (baits (2)); lcd2.setCursor (8, 1); lcd2.write (baits (0)); lcd2.setCursor (9, 1); lcd2.write (baits (0)); lcd2.setCursor (10, 1); lcd2.write (baits (0)); lcd2.setCursor (11, 1); lcd2.write (baits (0)); lcd2.setCursor (12, 1); lcd2.write (baits (0)); lcd2.setCursor (13, 1); lcd2.write (baits (0)); lcd2.setCursor (14, 1); lcd2.write (baits (0)); lcd2.setCursor (15, 1); lcd2.write (baits (2)); lcd2.setCursor (15, 0); lcd2.write (baits (2)); } void num3lcd2 () {lcd2.setCursor (0, 0); lcd2.write (baits (2)); // pilns lcd2.setCursor (0, 1); lcd2.write (baits (2)); lcd2.setCursor (1, 1); lcd2.write (baits (0)); // puse pa labi lcd2.setCursor (2, 1); lcd2.write (baits (0)); lcd2.setCursor (3, 1); lcd2.write (baits (0)); lcd2.setCursor (4, 1); lcd2.write (baits (0)); lcd2.setCursor (5, 1); lcd2.write (baits (0)); lcd2.setCursor (6, 1); lcd2.write (baits (0)); lcd2.setCursor (7, 1); lcd2.write (baits (2)); lcd2.setCursor (7, 0); lcd2.write (baits (2)); lcd2.setCursor (8, 1); lcd2.write (baits (0)); lcd2.setCursor (9, 1); lcd2.write (baits (0)); lcd2.setCursor (10, 1); lcd2.write (baits (0)); lcd2.setCursor (11, 1); lcd2.write (baits (0)); lcd2.setCursor (12, 1); lcd2.write (baits (0)); lcd2.setCursor (13, 1); lcd2.write (baits (0)); lcd2.setCursor (14, 1); lcd2.write (baits (0)); lcd2.setCursor (15, 1); lcd2.write (baits (2)); lcd2.setCursor (15, 0); lcd2.write (baits (2)); } void num4lcd2 () {lcd2.setCursor (0, 1); lcd2.write (baits (0)); lcd2.setCursor (1, 1); lcd2.write (baits (0)); lcd2.setCursor (2, 1); lcd2.write (baits (0)); lcd2.setCursor (3, 1); lcd2.write (baits (0)); lcd2.setCursor (4, 1); lcd2.write (baits (0)); lcd2.setCursor (5, 1); lcd2.write (baits (0)); lcd2.setCursor (6, 1); lcd2.write (baits (0)); lcd2.setCursor (7, 1); lcd2.write (baits (2)); lcd2.setCursor (7, 0); lcd2.write (baits (2)); lcd2.setCursor (8, 0); lcd2.write (baits (1)); lcd2.setCursor (8, 1); lcd2.write (baits (0)); lcd2.setCursor (9, 0); lcd2.write (baits (1)); lcd2.setCursor (9, 1); lcd2.write (baits (0)); lcd2.setCursor (10, 0); lcd2.write (baits (1)); lcd2.setCursor (10, 1); lcd2.write (baits (0)); lcd2.setCursor (11, 0); lcd2.write (baits (1)); lcd2.setCursor (11, 1); lcd2.write (baits (0)); lcd2.setCursor (12, 0); lcd2.write (baits (1)); lcd2.setCursor (12, 1); lcd2.write (baits (0)); lcd2.setCursor (13, 0); lcd2.write (baits (1)); lcd2.setCursor (13, 1); lcd2.write (baits (0)); lcd2.setCursor (14, 0); lcd2.write (baits (1)); lcd2.setCursor (14, 1); lcd2.write (baits (0)); lcd2.setCursor (15, 0); lcd2.write (baits (1)); lcd2.setCursor (15, 1); lcd2.write (baits (0)); } void num5lcd2 () {lcd2.setCursor (0, 0); lcd2.write (baits (2)); // pilns lcd2.setCursor (0, 1); lcd2.write (baits (2)); lcd2.setCursor (1, 1); lcd2.write (baits (0)); // puse pa labi lcd2.setCursor (2, 1); lcd2.write (baits (0)); lcd2.setCursor (3, 1); lcd2.write (baits (0)); lcd2.setCursor (4, 1); lcd2.write (baits (0)); lcd2.setCursor (5, 1); lcd2.write (baits (0)); lcd2.setCursor (6, 1); lcd2.write (baits (0)); lcd2.setCursor (7, 1); lcd2.write (baits (2)); lcd2.setCursor (7, 0); lcd2.write (baits (2)); lcd2.setCursor (8, 0); lcd2.write (baits (1)); lcd2.setCursor (9, 0); lcd2.write (baits (1)); lcd2.setCursor (10, 0); lcd2.write (baits (1)); lcd2.setCursor (11, 0); lcd2.write (baits (1)); lcd2.setCursor (12, 0); lcd2.write (baits (1)); lcd2.setCursor (13, 0); lcd2.write (baits (1)); lcd2.setCursor (14, 0); lcd2.write (baits (1)); lcd2.setCursor (15, 1); lcd2.write (baits (2)); lcd2.setCursor (15, 0); lcd2.write (baits (2)); }

4. darbība. Darba un apdares pieskāriens

Darba un apdares pieskāriens
Darba un apdares pieskāriens

Pievienojiet savu arduino datoram un ļaujiet tam darboties. Es ceru, ka jūsu pulkstenis darbosies. Tas darbojas, bet izskatās tik netīrs. Tik daudz rezistoru un vadu, tas nav labi. Tātad, ievietojiet visas sastāvdaļas kastē un izgrieziet vienu caurumu LCD krāsošanai un piešķiriet digitālajam pulkstenim izskatu.

Es neesmu to radījis reāli, bet esmu to izstrādājis AUTODESK CIRCUITS. Es to noformēšu reāli un ievietošu darba video. Es neesmu dzimtā valoda. Ja esat pieļāvis kādu kļūdu, informējiet mani privāti. Un es atvainojos par šo kļūdu. Esmu arī pārņēmis kādu ideju no "Dan's arduino Clock". Tiekamies ar citu pamācāmu.

Ieteicams: