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 //******************************************************************************
9 //The software reads PORTB where you have 4 buttons on RB4-RB7 (BT1-BT4).
10 //If the button on RB4 is pressed all the LEDs on PORTD are turned ON.
11 //******************************************************************************
12 
13 #define BUTTON_PRESSED 0x00
14 
15 int main(void) {
16 
18 
20 
22 
23  while(1){
24 
26  IO_write_port(IO_PORTD, 0xFF);
27  } else {
28  IO_write_port(IO_PORTD, 0x00);
29  }
30  }
31 }