Write header, configure I/O pins and use delay function
Here is a simple program whose purpose just to turn on a few LEDs on PORTB. Use this example to study what a real program looks like. Figure below shows appropriate connection schematic, while the related program is on the next page. When the power supply goes on, every second LED on PORTB will emit light, thus indicating that the microcontroller is properly connected and operates normally. This example shows how a correctly written header looks like. Header is the same for all the programs described herein so it will be skipped in the following examples. Anyway, it is considered to be at the beginning of every program marked as Header. To make this example more interesting, we will enable LEDs connected to PORTB to blink. There are several ways to do it: