LTlib LaurTec Library  4.0.1
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_UART.h"
9 #include "module_UART.c"
10 
11 int main(void) {
12 
13  unsigned char data;
14 
16 
17  UART1_open(UART_BAUDRATE_19200);
18 
19  while(1){
20 
21  if (UART1_data_ready ()) {
22 
23  data = UART1_read_byte();
24 
25  //Echo +1 just to be sure that the echo is coming from the MCU.
26  //If you press "a" the echo will be "b".
27  //Remove +1 to get a true echo.
28  UART1_write_byte(data + 1);
29  }
30 
31  }
32 }