LTlib LaurTec Library
4.0.3
Open Source C Library for Microchip Microcontrollers based on XC8 Compiler
Main Page
Data Structures
Files
File List
Globals
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
15
IO_set_all_ports_as_inputs
();
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
}
LTlib_v_4.0.3
ex
PIC18
_module_UART
02 - module_UART_Echo.X
main.c
Generated on Wed Aug 3 2016 19:57:31 for LTlib LaurTec Library by
1.8.3.1