Indholdsfortegnelse:

Fantastisk Arduino -ur: 4 trin
Fantastisk Arduino -ur: 4 trin

Video: Fantastisk Arduino -ur: 4 trin

Video: Fantastisk Arduino -ur: 4 trin
Video: МАСТЕР-КЛАСС по Arduino | Полный семинар по программированию за 90 минут! 2024, November
Anonim
Fantastisk Arduino ur
Fantastisk Arduino ur

Vi har set mange projekter med arduino. Men nu vil jeg vise dig, hvordan du bygger et ur med arduino og 2 LCD -skærme. Det er enkelt, men helt sjovt. Alle kan prøve det. Så gør dig klar !!!

Trin 1: Indsamling af materialer

Indsamling af materialer
Indsamling af materialer

Hvis du vil lave det, skal du bruge nogle ting. Disse varer kan du let købe fra din nærmeste butik.

Det skal du bruge:

  1. Arduino UNO R3Neo
  2. Pixel Ring 24
  3. Brødbræt
  4. LCD 16x2
  5. 100 Ohm modstand (2)
  6. 120 Ohm modstand (2)
  7. 10 K Ohm modstand (2)
  8. Trykknap

Diagram over disse ting er vist ovenfor. Du kan bruge ethvert brødbræt. Du skal bruge 6 modstande, deres værdier er skrevet ovenfor på listen. Du skal også bruge ledninger til forbindelse. Disse LCD'er vil du vise. Metoden til ledningskredsløb kan du se i næste trin.

Trin 2: Tilslut alle komponenter

Tilslutning af alle komponenter
Tilslutning af alle komponenter
Tilslutning af alle komponenter
Tilslutning af alle komponenter
Tilslutning af alle komponenter
Tilslutning af alle komponenter

De ting, du får brug for. Jeg har vist i forrige trin, så tag dit brødbrætskredsløb sammen med mig.

Ledningstrin:

  1. Placer 100 Ohm modstand på oversiden af brødbrættet på Negative Line.
  2. Placer 120 Ohm modstand på oversiden af brødbrættet på Positive Line.
  3. Placer trykknap (diagrammet er vist ovenfor)
  4. Placer 10 K Ohm modstand under trykknap
  5. Tilslut 100 Ohm modstande (begge) til LCD -display med 'LED -katode'
  6. Tilslut 120 Ohm modstande (begge) til LCD -display med 'LED Anode'
  7. Tilslut brødterminalens negative terminal fra øverste linje til 'Læs/skriv'.
  8. Tilslut brødterminalens negative terminal fra øverste linje til 'Kontrast'.
  9. Tilslut brødterminalens positive terminal fra nedre linje til 'Vcc'.
  10. Tilslut en anden negativ terminal af brødbrættet fra den øverste linje af brødbrættet til 'GND'.
  11. Gør det samme på 2. LCD tilslut alle disse som tidligere.
  12. Tilslut de resterende modstande til den negative linje af brødbrættet.
  13. Tilslut trykknapper til positiv linje.
  14. Tilslut den positive og negative terminal på brødbrættet til "Neo Pixel Ring 24".

Nu har du tilsluttet alle komponenter. Men arduino er stadig tilbage. Diagram over dette vist ovenfor.

Ledningsføringstrin af arduino til alle komponenter:

  1. Tilslut trykknapper (Terminal22) til A0 og A1 på arduino.
  2. Tilslut GND til den negative terminal på brødbrættet.
  3. Tilslut 5V til positiv terminal på brødbræt.
  4. Tilslut arduino D13 til "Power of" "Neo Pixel Ring 24"
  5. Tilslut arduino D7 til "Registrer valg" på LCD1.
  6. Tilslut arduino D8 til "Aktiver" på LCD 2.
  7. Tilslut arduino D9 til "DB4" på LCD 2.
  8. Tilslut D10 af arduino til "DB5" på LCD 2.
  9. Tilslut arduino D11 til "DB6" på LCD 2.
  10. Tilslut arduino D12 til "DB7" på LCD 2.
  11. Slut arduino D1 til "Registrer valg" på LCD 1.
  12. Tilslut arduino D2 til "Aktiver" på LCD 1.
  13. Tilslut arduino D3 til "DB4" på LCD 2.
  14. Tilslut arduino D4 til "DB5" på LCD 2.
  15. Tilslut arduino D5 til "DB6" på LCD 2.
  16. Tilslut arduino D6 til "DB7" på LCD 2.

Diagram over alle komponenter efter tilslutning er vist ovenfor.

Trin 3: Programmering

Programmering
Programmering

Du har gjort kredsløbet komplet. Men det virker ikke, før du programmerer det til dette projekt. Hvis du er ekspert, og du har erfaring, programmerer du det let. Jeg håber, at du kender softwaren, der bruges til dette formål. Programmer det i overensstemmelse hermed, hvis du vil oprette ændringer i programmering, kan du, men husk, at det skal være korrekt. Ellers virker det ikke. Hvis du ikke kan programmere det, kan du kopiere herfra eller tage det fra en anden kilde.

#omfatte

// Venstre LCD LiquidCrystal lcd1 (7, 8, 9, 10, 11, 12); // Højre LCD LiquidCrystal lcd2 (1, 2, 3, 4, 5, 6); #inkluderer #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; langt interval = 950; int sekunder = 0; int time = 0; int hourButtonState = 0; int minButtonState = 0; byte fuld [8] = {B11111, B11111, B11111, B11111, B11111, B11111, B11111, B11111,}; byte halfL [8] = {B11111, B11111, B11111, B11111, B00000, B00000, B00000, B00000,}; byte halfR [8] = {B00000, B00000, B00000, B00000, B11111, B11111, B11111, B11111,}; // installationsrutinen kører en gang, når du trykker på reset: ugyldig opsætning () {// sæt knappestifter pinMode (14, INPUT); // sæt minut pinMode (15, INPUT); // sæt time // lav tilpassede tegn lcd1.createChar (0, halfR); lcd1.createChar (1, halfL); lcd1.createChar (2, fuld); lcd2.createChar (0, halfR); lcd2.createChar (1, halfL); lcd2.createChar (2, fuld); // sæt LCD1 størrelse lcd1.begin (16, 2); // sæt LCD2 -størrelse lcd2.begin (16, 2); // pixelring pixels.begin (); // første opsætning lcd1.clear (); num0lcd1 (); lcd2.clear (); num0lcd2 (); //pixels.setPixelColor(17, pixels. Color (0, 150, 0)); //pixels.setPixelColor(18, pixels. Color (0, 150, 0)); pixels.show (); } // loop -rutinen kører igen og igen for altid: void loop () {hourButtonState = digitalRead (15); minButtonState = digitalRead (14); hvis (hourButtonState == HIGH) {time ++; runClock (); } hvis (minButtonState == HIGH) {sekunder ++; runClock (); } usigneret lang strømMillis = millis (); hvis (currentMillis - previousMillis> interval) {if (sekunder == 59) {sekunder = 0; hvis (time == 11) {time = 0; } ellers {time ++; }} andet {sekunder ++; } foregåendeMillis = nuværendeMillis; runClock (); } forsinkelse (10); } ugyldig runClock () {if (sekunder == 0) {lcd1.clear (); num0lcd1 (); lcd2.clear (); num0lcd2 (); } hvis (sekunder == 1 || sekunder == 11 || sekunder == 21 || sekunder == 31 || sekunder == 41 || sekunder == 51) {lcd1.clear (); num1lcd1 (); } hvis (sekunder == 2 || sekunder == 12 || sekunder == 22 || sekunder == 32 || sekunder == 42 || sekunder == 52) {lcd1.clear (); num2lcd1 (); } hvis (sekunder == 3 || sekunder == 13 || sekunder == 23 || sekunder == 33 || sekunder == 43 || sekunder == 53) {lcd1.clear (); num3lcd1 (); } hvis (sekunder == 4 || sekunder == 14 || sekunder == 24 || sekunder == 34 || sekunder == 44 || sekunder == 54) {lcd1.clear (); num4lcd1 (); } hvis (sekunder == 5 || sekunder == 15 || sekunder == 25 || sekunder == 35 || sekunder == 45 || sekunder == 55) {lcd1.clear (); num5lcd1 (); } hvis (sekunder == 6 || sekunder == 16 || sekunder == 26 || sekunder == 36 || sekunder == 46 || sekunder == 56) {lcd1.clear (); num6lcd1 (); } hvis (sekunder == 7 || sekunder == 17 || sekunder == 27 || sekunder == 37 || sekunder == 47 || sekunder == 57) {lcd1.clear (); num7lcd1 (); } hvis (sekunder == 8 || sekunder == 18 || sekunder == 28 || sekunder == 38 || sekunder == 48 || sekunder == 58) {lcd1.clear (); num8lcd1 (); } hvis (sekunder == 9 || sekunder == 19 || sekunder == 29 || sekunder == 39 || sekunder == 49 || sekunder == 59) {lcd1.clear (); num9lcd1 (); } hvis (sekunder == 10) {lcd1.clear (); num0lcd1 (); lcd2.clear (); num1lcd2 (); } hvis (sekunder == 20) {lcd1.clear (); num0lcd1 (); lcd2.clear (); num2lcd2 (); } hvis (sekunder == 30) {lcd1.clear (); num0lcd1 (); lcd2.clear (); num3lcd2 (); } hvis (sekunder == 40) {lcd1.clear (); num0lcd1 (); lcd2.clear (); num4lcd2 (); } hvis (sekunder == 50) {lcd1.clear (); num0lcd1 (); lcd2.clear (); num5lcd2 (); } hvis (time == 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 (); } hvis (time == 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 (); } hvis (time == 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 (); } hvis (time == 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 (); } hvis (time == 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 (); } hvis (time == 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 (); } hvis (time == 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 (); } hvis (time == 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 (); } hvis (time == 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 (); } hvis (time == 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 (); } hvis (time == 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 (); } hvis (time == 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)); // fuld lcd1.setCursor (0, 1); lcd1.write (byte (2)); lcd1.setCursor (1, 1); lcd1.write (byte (0)); // halv højre lcd1.setCursor (1, 0); lcd1.write (byte (1)); // halv venstre 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)); // fuld lcd1.setCursor (0, 1); lcd1.write (byte (2)); lcd1.setCursor (1, 0); lcd1.write (byte (1)); // halv venstre 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)); // fuld lcd1.setCursor (0, 1); lcd1.write (byte (2)); lcd1.setCursor (1, 1); lcd1.write (byte (0)); // halv højre 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)); // fuld lcd1.setCursor (0, 1); lcd1.write (byte (2)); lcd1.setCursor (1, 1); lcd1.write (byte (0)); // halv højre 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)); // fuld lcd1.setCursor (0, 1); lcd1.write (byte (2)); lcd1.setCursor (1, 1); lcd1.write (byte (0)); // halv højre lcd1.setCursor (1, 0); lcd1.write (byte (1)); // halv venstre 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)); // fuld lcd1.setCursor (0, 1); lcd1.write (byte (2)); lcd1.setCursor (1, 1); lcd1.write (byte (0)); // halv højre lcd1.setCursor (1, 0); lcd1.write (byte (1)); // halv venstre 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)); // fuld lcd2.setCursor (0, 1); lcd2.write (byte (2)); lcd2.setCursor (1, 1); lcd2.write (byte (0)); // halv højre lcd2.setCursor (1, 0); lcd2.write (byte (1)); // halv venstre 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)); // fuld lcd2.setCursor (0, 1); lcd2.write (byte (2)); lcd2.setCursor (1, 0); lcd2.write (byte (1)); // halv venstre 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)); // fuld lcd2.setCursor (0, 1); lcd2.write (byte (2)); lcd2.setCursor (1, 1); lcd2.write (byte (0)); // halv højre 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)); // fuld lcd2.setCursor (0, 1); lcd2.write (byte (2)); lcd2.setCursor (1, 1); lcd2.write (byte (0)); // halv højre 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)); }

Trin 4: Arbejde og finish

Arbejde og finish
Arbejde og finish

Tilslut din arduino til computeren, og lad den fungere. Jeg håber, at dit ur fungerer. Det virker, men det ser så rodet ud. Så mange modstande og ledninger, at det ikke er godt. Så placer alle komponenter i kassen og skær et hul til LCD, maler kassen og giver et digitalt ur.

Jeg har ikke skabt det i virkeligheden, men jeg har designet det i AUTODESK CIRCUITS. Jeg skal designe det i virkeligheden og poste videoen om at arbejde. Jeg er ikke en indfødt taler. Hvis du har begået en fejl, skal du informere mig i private beskeder. Og jeg er ked af den fejl. Jeg har også taget en ide fra "Dan's arduino Clock". Mød dig med en anden instruerbar.

Anbefalede: