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 "MCP7940.h"
15 #include "MCP7940.c"
16 
17 #include "MCP2300x.h"
18 #include "MCP2300x.c"
19 
20 #include "LCD_44780_I2C.h"
21 #include "LCD_44780_I2C.c"
22 
23 int main(void) {
24 
26 
27  //Enable the Buzzer output
29  IO_write_port(IO_PORTC, 0x00);
30 
31  LCD_initialize(20);
32  RTCC_initialize(100);
33 
34  RTCC_set_years(0x15);
35  RTCC_set_months(0x11);
36  RTCC_set_days(0x22);
37 
38  RTCC_set_hours(0x16);
39  RTCC_set_minutes(0x20);
40  RTCC_set_seconds(0x57);
41 
44 
46 
47  while(1){
48  LCD_home();
49  LCD_write_message("Date : ");
51  LCD_goto_line(2);
52  LCD_write_message("Time : ");
54 
55  if (RTCC_is_alarm_ON()){
56  IO_write_port(IO_PORTC, 0x01);
57  }
58 
59  delay_ms (500);
60  }
61 }