Led On Off
Led On Off
// Function prototypes
int main(void) {
while (1) {
return 0;
}
}
#include <lpc214x.h> // Include LPC2148 header file
// Function prototypes
int main(void) {
while (1) {
unsigned int switch_state = (IO1PIN & SWITCH_MASK) >> 16; // Read switches
IO0SET = (~switch_state) & 0xFF; // Turn ON LEDs for active switches (assumes active-low switches)
return 0;
}
// Function to create a delay in milliseconds
unsigned int i, j;