LTlib LaurTec Library  4.0.3
Open Source C Library for Microchip Microcontrollers based on XC8 Compiler
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros
main.c
Go to the documentation of this file.
1 #include <xc.h>
2 
3 #include "LTlib.h"
4 
5 #include "module_IO.h"
6 #include "module_IO.c"
7 
8 #include "module_I2C.h"
9 #include "module_I2C.c"
10 
11 #include "LTlib_delay.h"
12 #include "LTlib_delay.c"
13 
14 #include "DS1337.h"
15 #include "DS1337.c"
16 
17 #include "LCD_44780.h"
18 #include "LCD_44780.c"
19 
20 int main(void) {
21 
23 
24  //Enable the Buzzer output
26 
27  LCD_initialize(20);
28  RTCC_initialize(100);
29 
30  RTCC_set_years(0x15);
31  RTCC_set_months(0x11);
32  RTCC_set_days(0x22);
33 
34  RTCC_set_hours(0x16);
35  RTCC_set_minutes(0x20);
36  RTCC_set_seconds(0x55);
37 
41 
43 
44  while(1){
45  LCD_home();
46  LCD_write_message("Date : ");
48  LCD_goto_line(2);
49  LCD_write_message("Time : ");
51 
52  if (RTCC_is_alarm_ON()){
53  IO_write_port(IO_PORTC, 0x01);
54  }
55 
56  delay_ms (100);
57  }
58 }