Ds1307 Bascom Program
Sebelumnya sudah pernah saya posting tentang RTC DS1307 juga pada Tutorial Jam Digital dengan Bascom AVR, sedikit teori dan datasheet RTC DS1307 dapat dilihat pada postingan tersebut. Pada tutorial kali ini saya akan memberikan contoh program jam digital dengan RTC DS1307 menggunakan bahasa pemrograman CodeVision AVR. Pada kesempatan kali ini saya akan menjelaskan mengenai bagaimana cara membuat sebuah alat dengan menggunakan sensor suhu dan kelembaban DHT22 kemudian dilengkapi dengan RTC DS1307 untuk menampilkan waktunya. Program yang digunakan adalah Bascom AVR, mikrokontroller yang dipakai adalah ATMega16 dengan interface pada lcd 16x2. Jadi alat ini hanya mendeteksi suhu dan kelembaban serta menampilkan.
Home | Products | Teensy | Blog | Forum |
You are here:TeensyTeensyduinoLibrariesDS1307RTC |
Ds1307 Bascom Programm
| DS1307RTC allows you to access real time clock (RTC) chips compatible withthe DS1307. It is intended to be used with theTime library.
Hardware RequirementsDS1307RTC works with the DS1307, DS1337 and DS3231 real time clock chips.The DS1307 chip only works with 5 volt power. The DS1337 and DS3231can use 3.3 or 5 volts. Teensy 3.0 has a built-in RTC, so the DS1337 offers little benefit.However, the DS3231 includes a temperature compensated crystal, so itis recommended for applications requiring high accuracy. Imax b6 charger pc software. The ChronoDotboard provides the DS3231 chip in an easy-to-use package. For usewith Teensy 3.0, you must add pullup resistors for the SDA and SCL signals. Basic UsageRTC.get();Reads the current date & time as a 32 bit 'time_t' number. Zero is returnedif the DS1307 is not running or does not respond. RTC.set(t);Sets the date & time, using a 32 bit 'time_t' number. Returns true forsuccess, or false if any error occurs. RTC.read(tm);Read the current date & time as TimeElements variable. See the Time libraryfor TimeElements details. Returns true on success, or false if thetime could not be read. RTC.write(tm);Sets the date & time, using a TimeElements variable. Returns true for RTC.chipPresent();Returns true if a DS1307 compatible chip was present after using the4 functions. If an error occurs, this can be used to distinguish betweena DS1307 that is not running vs no chip connected at all. Example ProgramDS1307RTC includes 2 examples, to read or set the time.You can open this example from File > Examples > DS1307RTC > ReadTest. |