Some new stuff
  1. Arduino Park Control
  2. Arduino USB2serial programming the bare bone
  3. Arduino Projects Videos added
  4. Arduino Xbee projects
  5. Arduino dB Meter 
  6. Trying to get the IOIO going. 
  7. IOIO is going....bluetooth
  8. Attiny 2313 bluetooth bee RC car
  9. Compass and temperature added
  10. AVR programmer
  11. USB2Serial and Ethernet POE
  12. Arduino LPG Sensor
  13. Program the Arduino Mini 05
  14. Lipo Rider Pro in action
  15. EZ Robot Builder kit arrived 10 Nov 2012
  16. Arduino VA Meter!
  17. 05 Nov 2012 Project Sentry Gun.
  18. Attiny85 PIR Sensor 10 Dec 2012 
  19. 0-30VDC3A and 2-28VDC10A bench PSU's
  20. 19 Dec 2012 Arduino Voltmeter LCD
  21. 29 Dec 2012 Arduino Tachometer&Speedometer LCD
  22. 03 Jan 2013 Arduino AC Phase Control. 
  23. 18 Jan 2013 Arduino Distance Meter
  24. 22 Jan 2013 Arduino Digital Clock and Date
  25. 31 Jan 2013 Arduino Digital Clock and Date 8x2 LCD
  26. Feb 2013 LCD and Backpack
  27. Feb 2013 7 Segment Serial Clock Sparkfun. Distance Sensor with "newping" library
  28. Feb 2013 Lelo Remote
  29. 01/03/2013 Arduino Adafruit 7 Seg Digital Clock with RTC and backpack 
  30. Arduino Frequency Meter 26/03/2013
  31. Another RC  Car controlled by Arduino 06/04/2013
  32. My quadcopter project update 25 April 2013
  33. My Aqua Quad Copter Flying 26 April 2013enlightened
  34. Another monster RC truck;strong one! 11July2013cool
  35. X-Frame Quad Copter 31 July 2013cool
  36. Arduino GSM Sheild added.28/8/2013
  37. 1.8inch TFT screen 13/09/2013cool
  38. 04/11/2014 added PID Soldering Iron Control
  39. Added bluetooth servo control 04/11/2014
  40. ESP8266 first try.16/03/2015
  41. Arduino Uno Quadcopter 19 May 2015
  42. IOT WemosD1 Amp Meter

 

 



31 January 2013

Arduino Clock 8x2 LCD.

Two aspects here:

I changed the code to accommodate 8x2 LCD.
    I manufactured my own shield for the 8x2 LCD.

     
    The code and idea is exactly the same as the Arduino clock earlier on this website with the RTC module, but I wanted to display the date and time on 8x2 LCD instead of 16x2 and changed the code accordingly.
    I bought a "Screw Shield" to make my own LCD 8x2 shield. Normally I use the DFRobot Keypad Shield for Arduino a lot when it comes to 16x2 but the need is there for the 8x2 too. 
    I simply wired the pins underneath the screw shield with thin connection wire . It looks messy, but it works and the top of course looks excellent like you can see in the picture.
    I would like to box this little fellow for a handy table watch/clock date time indication.
     
    Code:

    #include <LiquidCrystal.h>
    #include <Wire.h>
    #include "RTClib.h"
    LiquidCrystal lcd(8, 9, 4, 5, 6, 7);
    // RTC connection:
    // Pin Sda to pin A4
    // Pin Scl to pin A5
    // VCC = 5v and connect GND.
    RTC_DS1307 RTC;
    int backLight = 3;    // pin 3 will control the backlight only if needed.
    void setup()
    {
      Serial.begin(9600);
      Wire.begin();
      RTC.begin();
       if (! RTC.isrunning()) {
        Serial.println("RTC is NOT running!");
        // following line sets the RTC to the date & time this sketch was compiled
        RTC.adjust(DateTime(__DATE__, __TIME__));
      }
      pinMode(backLight, OUTPUT);
      digitalWrite(backLight, HIGH); // turn backlight on. Replace 'HIGH' with 'LOW' to turn it off.
      lcd.begin(8,2);              // columns, rows.  use 16,2 for a 16x2 LCD, etc.
      lcd.clear();                  // start with a blank screen
    }
    void loop()
    {
      DateTime now = RTC.now();
      lcd.clear();
      lcd.setCursor(0,0);
      if(now.day() < 10)
      {   
      lcd.print("0");
      }
      lcd.print(now.day(), DEC);
      //lcd.print('/');
      if(now.month() < 10)
      {   
      lcd.print("0");
      }
      lcd.print(now.month(), DEC);
      //lcd.print('/');
      lcd.print(now.year(), DEC);
      lcd.setCursor(0,1);
      if(now.hour() < 10)
      {   
      lcd.print("0");
      }
      lcd.print(now.hour(), DEC);
      lcd.print(':');
      if(now.minute() < 10)
      {   
      lcd.print("0");
      }
      lcd.print(now.minute(), DEC);
      lcd.print(':');
      if(now.second() < 10)
      {   
      lcd.print("0");
      }
      lcd.print(now.second(), DEC);
      delay(1000);
    }
    Back Back to top