Daftar Isi:

Jam Arduino yang Luar Biasa: 4 Langkah
Jam Arduino yang Luar Biasa: 4 Langkah

Video: Jam Arduino yang Luar Biasa: 4 Langkah

Video: Jam Arduino yang Luar Biasa: 4 Langkah
Video: BELAJAR ARDUINO #107 - Buat Jam Digital Dengan TM1637 Seven Segment Display Dan Rtc DS3231 2024, November
Anonim
Jam Arduino yang Luar Biasa
Jam Arduino yang Luar Biasa

Kami telah melihat banyak proyek dengan arduino. Tapi Sekarang, saya akan menunjukkan cara membuat jam tangan dengan arduino dan 2 layar LCD. Ini sederhana tapi benar-benar menyenangkan. Setiap orang bisa mencobanya. Jadi, Bersiaplah!!!

Langkah 1: Mengumpulkan Bahan

Mengumpulkan Bahan
Mengumpulkan Bahan

Jika Anda ingin membuatnya, Anda memerlukan beberapa item. Barang-barang ini Anda dapat dengan mudah membeli dari toko ritel terdekat Anda.

Apa yang Anda perlukan:

  1. Arduino UNO R3Neo
  2. Cincin Piksel 24
  3. Papan Roti
  4. LCD 16x2
  5. Resistor 100 Ohm (2)
  6. Resistor 120 Ohm (2)
  7. Resistor 10 K Ohm (2)
  8. Tekan tombol

Diagram hal-hal ini ditunjukkan di atas. Anda dapat menggunakan papan Roti apa saja. Anda membutuhkan 6 Resistor nilainya tertulis di atas dalam daftar. Anda juga akan membutuhkan kabel untuk koneksi. LCD ini Anda akan untuk ditampilkan. Metode rangkaian pengkabelan dapat Anda lihat di langkah selanjutnya.

Langkah 2: Menghubungkan Semua Komponen

Pengkabelan Semua Komponen
Pengkabelan Semua Komponen
Pengkabelan Semua Komponen
Pengkabelan Semua Komponen
Pengkabelan Semua Komponen
Pengkabelan Semua Komponen

Hal-hal yang akan Anda butuhkan. Saya telah menunjukkan pada langkah sebelumnya jadi bawalah sirkuit kawat papan roti Anda bersama saya.

Langkah Pengkabelan:

  1. Tempatkan resistor 100 Ohm di sisi atas papan roti pada Garis Negatif.
  2. Tempatkan resistor 120 Ohm di sisi atas papan roti pada Garis Positif.
  3. Tempatkan Tombol Tekan (Diagram ditunjukkan di atas)
  4. Tempatkan resistor 10 K Ohm di bawah Tombol Tekan
  5. Hubungkan resistor 100 Ohm (keduanya) ke layar LCD dengan 'LED Katoda'
  6. Hubungkan resistor 120 Ohm (keduanya) ke layar LCD dengan 'LED Anode'
  7. Hubungkan terminal negatif papan roti dari baris atas ke 'Baca/Tulis'.
  8. Hubungkan terminal negatif papan roti dari garis atas ke 'Kontras'.
  9. Hubungkan terminal positif papan roti dari garis bawah ke 'Vcc'.
  10. Hubungkan terminal negatif papan roti lainnya dari garis atas papan roti ke 'GND".
  11. Lakukan hal yang sama pada LCD ke-2, sambungkan semua ini seperti sebelumnya.
  12. Hubungkan resistor yang tersisa ke garis negatif papan roti.
  13. Hubungkan tombol tekan ke saluran positif.
  14. Hubungkan terminal Positif & Negatif papan roti ke "Neo Pixel Ring 24".

Sekarang, Anda telah menghubungkan semua komponen. Tapi arduino masih tersisa. Diagram ini ditunjukkan di atas.

Langkah-langkah Wiring arduino ke semua komponen:

  1. Hubungkan tombol tekan (Terminal22) ke A0 & A1 dari arduino.
  2. Hubungkan GND ke terminal negatif papan roti.
  3. Hubungkan 5V ke terminal positif papan roti.
  4. Hubungkan D13 dari arduino ke "Kekuatan" "Neo Pixel Ring 24"
  5. Hubungkan D7 dari arduino ke "Register Select" dari LCD1.
  6. Hubungkan D8 arduino ke "Aktifkan" LCD 2.
  7. Hubungkan D9 arduino ke "DB4" LCD 2.
  8. Hubungkan D10 arduino ke "DB5" LCD 2.
  9. Hubungkan D11 dari arduino ke "DB6" dari LCD 2.
  10. Hubungkan D12 dari arduino ke "DB7" dari LCD 2.
  11. Hubungkan D1 dari arduino ke "Register Select" dari LCD 1.
  12. Hubungkan D2 arduino ke "Aktifkan" LCD 1.
  13. Hubungkan D3 arduino ke "DB4" LCD 2.
  14. Hubungkan D4 arduino ke "DB5" LCD 2.
  15. Hubungkan D5 arduino ke "DB6" LCD 2.
  16. Hubungkan D6 arduino ke "DB7" LCD 2.

Diagram semua komponen setelah pengkabelan ditunjukkan di atas.

Langkah 3: Pemrograman

Pemrograman
Pemrograman

Anda telah membuat sirkuit lengkap. Tetapi itu tidak berfungsi sampai Anda memprogramnya untuk proyek ini. Jika Anda ahli dan memiliki pengalaman, Anda akan memprogramnya dengan mudah. Saya harap Anda akan mengetahui perangkat lunak yang digunakan untuk tujuan ini. Programlah sesuai jika Anda ingin membuat perubahan dalam pemrograman Anda bisa tetapi ingat itu harus benar. Jika tidak, itu tidak akan berhasil. Jika Anda tidak dapat memprogramnya, Anda dapat menyalin dari sini atau mengambilnya dari sumber lain.

#termasuk

// Kiri LCD LiquidCrystal lcd1(7, 8, 9, 10, 11, 12);// Kanan LCD LiquidCrystal lcd2(1, 2, 3, 4, 5, 6);#include #ifdef _AVR_ #include #endif/ / NeoPixel Ring 24 #menentukan PIN 13#menentukan NUMPIXELS 24Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);int delayval = 50;long sebelumnyaMillis = 0; interval panjang = 950; int detik = 0; int jam = 0;int jamButtonState = 0; int minButtonState = 0;byte penuh[8] = { B11111, B11111, B11111, B11111, B11111, B11111, B11111, B11111, };byte halfL[8] = { B11111, B11111, B11111, B11111, B00000, B00000, B000000, B00000, };byte halfR[8] = { B00000, B00000, B00000, B00000, B11111, B11111, B11111, B11111, };// rutinitas pengaturan berjalan sekali ketika Anda menekan reset: void setup() { // set pin tombol pinMode (14, INPUT); // setel menit PinMode(15, INPUT); // set jam // buat karakter khusus lcd1.createChar(0, halfR); lcd1.createChar(1, halfL); lcd1.createChar(2, penuh); lcd2.createChar(0, halfR); lcd2.createChar(1, halfL); lcd2.createChar(2, penuh); // atur ukuran LCD1 lcd1.begin(16, 2); // set ukuran LCD2 lcd2.begin(16, 2); // piksel cincin piksel.begin(); // pengaturan awal lcd1.clear(); angka0lcd1(); lcd2.clear(); angka0lcd2(); //pixels.setPixelColor(17, pixels. Color(0, 150, 0)); //pixels.setPixelColor(18, pixels. Color(0, 150, 0)); piksel.tampilkan(); }// rutinitas loop berjalan berulang-ulang selamanya: void loop() { hourButtonState = digitalRead(15); minButtonState = digitalRead(14); if (jamButtonState == TINGGI) { jam++; runClock(); } if (minButtonState == HIGH) { detik++; runClock(); } unsigned long currentMillis = milis(); if (Millis saat ini - Mili sebelumnya > interval) { if (detik == 59) { detik = 0; if (jam == 11) { jam = 0; } else { jam ++; } } else { detik ++; } Mili sebelumnya = Mili saat ini; runClock(); } penundaan(10); }void runClock() { if (detik == 0) { lcd1.clear(); angka0lcd1(); lcd2.clear(); angka0lcd2(); } if (detik == 1 || detik == 11 || detik == 21 || detik == 31 || detik == 41 || detik == 51) { lcd1.clear(); angka1lcd1(); } if (detik == 2 || detik == 12 || detik == 22 || detik == 32 || detik == 42 || detik == 52) { lcd1.clear(); angka2lcd1(); } if (detik == 3 || detik == 13 || detik == 23 || detik == 33 || detik == 43 || detik == 53) { lcd1.clear(); angka3lcd1(); } if (detik == 4 || detik == 14 || detik == 24 || detik == 34 || detik == 44 || detik == 54) { lcd1.clear(); nomor4lcd1(); } if (detik == 5 || detik == 15 || detik == 25 || detik == 35 || detik == 45 || detik == 55) { lcd1.clear(); angka5lcd1(); } if (detik == 6 || detik == 16 || detik == 26 || detik == 36 || detik == 46 || detik == 56) { lcd1.clear(); nomor6lcd1(); } if (detik == 7 || detik == 17 || detik == 27 || detik == 37 || detik == 47 || detik == 57) { lcd1.clear(); nomor7lcd1(); } if (detik == 8 || detik == 18 || detik == 28 || detik == 38 || detik == 48 || detik == 58) { lcd1.clear(); angka8lcd1(); } if (detik == 9 || detik == 19 || detik == 29 || detik == 39 || detik == 49 || detik == 59) { lcd1.clear(); nomor9lcd1(); } if (detik == 10) { lcd1.clear(); angka0lcd1(); lcd2.clear(); angka1lcd2(); } if (detik == 20) { lcd1.clear(); angka0lcd1(); lcd2.clear(); angka2lcd2(); } if (detik == 30) { lcd1.clear(); angka0lcd1(); lcd2.clear(); angka3lcd2(); } if (detik == 40) { lcd1.clear(); angka0lcd1(); lcd2.clear(); nomor4lcd2(); } if (detik == 50) { lcd1.clear(); angka0lcd1(); lcd2.clear(); angka5lcd2(); } if (jam == 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)); piksel.setPixelColor(18, piksel. Warna (0, 150, 0)); piksel.tampilkan(); } if (jam == 1) { pixels.setPixelColor(17, pixels. Color(0, 0, 0)); piksel.setPixelColor(18, piksel. Warna (0, 0, 0)); piksel.setPixelColor(19, piksel. Warna (0, 150, 0)); piksel.setPixelColor(20, piksel. Warna (0, 150, 0)); piksel.tampilkan(); } if (jam == 2) { pixels.setPixelColor(19, pixels. Color(0, 0, 0)); piksel.setPixelColor(20, piksel. Warna (0, 0, 0)); pixels.setPixelColor(21, pixels. Color(0, 150, 0)); piksel.setPixelColor(22, piksel. Warna (0, 150, 0)); piksel.tampilkan(); } if (jam == 3) { pixels.setPixelColor(21, pixels. Color(0, 0, 0)); pixels.setPixelColor(22, pixels. Color(0, 0, 0)); piksel.setPixelColor(23, piksel. Warna (0, 150, 0)); pixels.setPixelColor(0, pixels. Color(0, 150, 0)); piksel.tampilkan(); } if (jam == 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)); piksel.setPixelColor(2, piksel. Warna (0, 150, 0)); piksel.tampilkan(); } if (jam == 5) { pixels.setPixelColor(1, pixels. Color(0, 0, 0)); piksel.setPixelColor(2, piksel. Warna (0, 0, 0)); piksel.setPixelColor(3, piksel. Warna (0, 150, 0)); pixels.setPixelColor(4, pixels. Color(0, 150, 0)); piksel.tampilkan(); } if (jam == 6) { pixels.setPixelColor(3, pixels. Color(0, 0, 0)); pixels.setPixelColor(4, pixels. Color(0, 0, 0)); piksel.setPixelColor(5, piksel. Warna (0, 150, 0)); piksel.setPixelColor(6, piksel. Warna (0, 150, 0)); piksel.tampilkan(); } if (jam == 7) { pixels.setPixelColor(5, pixels. Color(0, 0, 0)); pixels.setPixelColor(6, pixels. Color(0, 0, 0)); piksel.setPixelColor(7, piksel. Warna (0, 150, 0)); piksel.setPixelColor(8, piksel. Warna (0, 150, 0)); piksel.tampilkan(); } if (jam == 8) { pixels.setPixelColor(7, pixels. Color(0, 0, 0)); piksel.setPixelColor(8, piksel. Warna (0, 0, 0)); piksel.setPixelColor(9, piksel. Warna (0, 150, 0)); piksel.setPixelColor(10, piksel. Warna (0, 150, 0)); piksel.tampilkan(); } if (jam == 9) { pixels.setPixelColor(9, pixels. Color(0, 0, 0)); piksel.setPixelColor(10, piksel. Warna (0, 0, 0)); piksel.setPixelColor(11, piksel. Warna (0, 150, 0)); piksel.setPixelColor(12, piksel. Warna (0, 150, 0)); piksel.tampilkan(); } if (jam == 10) { pixels.setPixelColor(11, pixels. Color(0, 0, 0)); pixels.setPixelColor(12, pixels. Color(0, 0, 0)); piksel.setPixelColor(13, piksel. Warna (0, 150, 0)); piksel.setPixelColor(14, piksel. Warna (0, 150, 0)); piksel.tampilkan(); } if (jam == 11) { pixels.setPixelColor(13, pixels. Color(0, 0, 0)); pixels.setPixelColor(14, pixels. Color(0, 0, 0)); piksel.setPixelColor(15, piksel. Warna (0, 150, 0)); piksel.setPixelColor(16, piksel. Warna (0, 150, 0)); piksel.tampilkan(); } }void num0lcd1 () { lcd1.setCursor(0, 0); lcd1.write(byte(2)); // penuh lcd1.setCursor(0, 1); lcd1.write(byte(2)); lcd1.setCursor(1, 1); lcd1.write(byte(0)); // setengah kanan lcd1.setCursor(1, 0); lcd1.write(byte(1)); // setengah kiri 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)); // penuh lcd1.setCursor(0, 1); lcd1.write(byte(2)); lcd1.setCursor(1, 0); lcd1.write(byte(1)); // setengah kiri 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)); // penuh lcd1.setCursor(0, 1); lcd1.write(byte(2)); lcd1.setCursor(1, 1); lcd1.write(byte(0)); // setengah kanan 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)); // penuh lcd1.setCursor(0, 1); lcd1.write(byte(2)); lcd1.setCursor(1, 1); lcd1.write(byte(0)); // setengah kanan 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)); // penuh lcd1.setCursor(0, 1); lcd1.write(byte(2)); lcd1.setCursor(1, 1); lcd1.write(byte(0)); // setengah kanan lcd1.setCursor(1, 0); lcd1.write(byte(1)); // setengah kiri 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)); // penuh lcd1.setCursor(0, 1); lcd1.write(byte(2)); lcd1.setCursor(1, 1); lcd1.write(byte(0)); // setengah kanan lcd1.setCursor(1, 0); lcd1.write(byte(1)); // setengah kiri 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)); // penuh lcd2.setCursor(0, 1); lcd2.write(byte(2)); lcd2.setCursor(1, 1); lcd2.write(byte(0)); // setengah kanan lcd2.setCursor(1, 0); lcd2.write(byte(1)); // setengah kiri 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)); // penuh lcd2.setCursor(0, 1); lcd2.write(byte(2)); lcd2.setCursor(1, 0); lcd2.write(byte(1)); // setengah kiri 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)); // penuh lcd2.setCursor(0, 1); lcd2.write(byte(2)); lcd2.setCursor(1, 1); lcd2.write(byte(0)); // setengah kanan 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)); // penuh lcd2.setCursor(0, 1); lcd2.write(byte(2)); lcd2.setCursor(1, 1); lcd2.write(byte(0)); // setengah kanan 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)); }

Langkah 4: Bekerja dan Sentuhan Akhir

Sentuhan Pengerjaan dan Penyelesaian
Sentuhan Pengerjaan dan Penyelesaian

Hubungkan arduino Anda ke komputer dan biarkan bekerja. Saya harap jam Anda akan berfungsi. Ini berfungsi tetapi terlihat sangat berantakan. Begitu banyak resistor & kabel itu tidak baik. Jadi, Tempatkan semua komponen dalam kotak dan potong satu lubang untuk mengecat LCD kotak dan beri tampilan Jam Digital.

Saya belum membuatnya secara nyata tetapi saya telah mendesainnya di AUTODESK CIRCUITS. Saya akan mendesainnya secara nyata dan memposting video kerja. Saya bukan penutur asli. Jika telah melakukan kesalahan, beri tahu saya di pesan pribadi. Dan saya minta maaf atas kesalahan itu. Saya juga mengambil beberapa ide dari "Jam arduino Dan". Temui Anda dengan instruksi lain.

Direkomendasikan: