nsasourcing.blogg.se

Arduino lcd library and rtc
Arduino lcd library and rtc













arduino lcd library and rtc

With this function we can see the blinking of the selected parameter with a frequency of 2Hz.

arduino lcd library and rtc

When called and without pressing any button the total time is 10 x 25ms = 250ms. Void blink_parameter() : this small function works as a delay except that it is interrupted by the buttons B1 (connected to pin 8) and B2 (connected to pin 9). Void DS1307_display() : displays time and calendar, before displaying time and calendar data are converted from BCD to decimal format. Minute = (minute > 4) * 10 + (minute & 0x0F) The DS1307 works with BCD format only and to convert the BCD to decimal and vise versa I used the 2 lines below (example for minute): The Arduino code below doesn’t use any library for the DS1307 RTC, the Wire library is for the communication between the Arduino and the DS1307 using I2C protocol. Button B1 selects the parameter and B2 increments the selected parameter.Īrduino real time clock with DS1307 code: In the circuit there are 2 push buttons (B1 & B2) connected to pins 8 and 9 respectively, the two push buttons are used to set time date parameters (minutes, hours, date, month and year). 10K ohm variable resistor (or potentiometer)Īrduino real time clock with DS1307 circuit:.















Arduino lcd library and rtc