#include "lpc111x.h" // prototypes void Delay(); int main() { GPIO0DIR = 0x0FFF; // set the GPIO0_0 through GPIO0_11 bits for output while (1) { GPIO0DATA = 0x0FFF; // set GPIO0_0..11 Delay(); // delay for visual effect GPIO0DATA = 0x0000; // clear GPIO0_0..11 Delay(); // delay for visual effect } return 0; } //***************************************************************************** // @brief: this is just an empty while loop to eat processor cycles and control // flow of the program. counter is volatile for optimization // portability //***************************************************************************** void Delay() { int volatile counter = 0; while (counter < 250000) { counter++; } } |