#include <xc.h>
#include <stdint.h>
void main(void) {
uint8_t portValue = 0x05;
ANSELB = 0x0; // set to digital I/O (not analog)
TRISB = 0x0; // set all port bits to be output
LATB = portValue; // write to port latch - RB[0:3] = LED[4:7]
// Port D access
ANSELD = 0x0; // set to digital I/O (not analog)
TRISD = 0x0; // set all port bits to be output
LATD = portValue; // write to port latch - RD[0:3] = LED[0:3]
}
|