LTlib LaurTec Library  4.0.0 Beta
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_EEPROM.h"
6 #include "module_EEPROM.c"
7 
8 #include "module_IO.h"
9 #include "module_IO.c"
10 
11 #include "delay.h"
12 #include "delay.c"
13 
14 
15 int main(void) {
16 
17  unsigned char address = 0x10;
18  unsigned char data = 0x53;
19  unsigned char read_back = 0x00;
20 
22 
24 
25  EEPROM_write_byte(address, data);
26 
27  //wait for the data to be written, before read it back
28  delay_ms (10);
29 
30  read_back = EEPROM_read_byte (address);
31 
32  IO_write_port(IO_PORTD, read_back);
33 
34  while(1);
35 }