Toll-Free Customer Support 24/7

PIC Development Board –Relay

PIC Development Board –Relay

* Copyright

(c) Researchdesignlab.com

* Test configuration:

MCU: PIC16F877A

Dev.Board: PIC

Oscillator: 20.0 MHz

Software: mikroC PRO for PIC v 4.6

Developer: DD

*/

sbit RELAY at RB1_bit; //defining PortB Pin B1 as RELAY

void main()

{

TRISB=0x00; //defining PORTB as output port

RELAY= 1;

Delay_ms(1000);

RELAY= 0;

Delay_ms(1000);

while(1)

{

RELAY=1; //binary equivalent value:00000000

Delay_ms(1000);

RELAY=0; //binary equivalent value:11111111

Delay_ms(1000);

}

}

Back to top