BASIC LED FLASHING USING PIC16F84A

Litar asas yang selalunya dijadikan permulaan bagi BEGINNERS.Litar yang berfungsi sebagai LED BERKELIP dengan penggunaan komen “DELAY”¬†yang melengahkan waktu ON dan OFF.

pic1

pic2

COMPILER:MIKRO C PRO
SIMULATOR:PROTEUS

DOWNLOAD COMPILER DISINI:

http://www.mikroe.com/mikroc/pic/?gclid=CMT42a7ykrgCFYRU4godMmsAqQ

SOURCE CODE:

*****************************************************************************************************

void main() {
PORTB = 0; //Clear all the PortB
TRISB = 0; //set up PortB as Output Port.

Delay_ms(500); //delay 5mS
while(1) { //endless loop
PORTB = 0B00000001; //set up voltage pattern for PORTB..1=HIGH,0= LOW
Delay_ms(300); // delay 3mS
PORTB = 0B00000000; //set up voltage pattern for PORTB..1=HIGH,0= LOW
Delay_ms(300); // delay 3mS
PORTB = 0B00000001; //set up voltage pattern for PORTB..1=HIGH,0= LOW
Delay_ms(300); // delay 3mS
PORTB = 0B00000000; //set up voltage pattern for PORTB..1=HIGH,0= LOW
}
}

******************************************************************************************************