#include<18F2580.h>
#include <stdlib.h>
#include <string.h>
#fuses XT,PUT,NOBROWNOUT,NOWDT,NOPROTECT,NOLVP
#use delay(clock=4000000)
#use rs232(baud=19200, parity=N, xmit=PIN_C6, rcv=PIN_C7, STREAM=HWAREUART, ERRORS)
#use rs232(baud=19200, parity=N, xmit=PIN_A4, Stream=PCSOFTWAREUART)
#define REL_1 PIN_A1
#define REL_2 PIN_A2
#define REL_3 PIN_B0
#define REL_4 PIN_B1
#define REL_5 PIN_A5
//
void main() {
output_low(REL_1);
output_low(REL_2);
output_low(REL_3);
output_low(REL_4);
output_low(REL_5);
while(1) {
int num, i;
for(i=0; i<5; i++) {
num = i;
if(num == 1) {
output_toggle(REL_1);
delay_ms(10000);
output_toggle(REL_1);
} else if(num == 2) {
output_toggle(REL_2);
} else if(num == 3) {
output_toggle(REL_3);
delay_ms(5000);
output_toggle(REL_3);
} else if(num == 4) {
output_toggle(REL_4);
} else if(num == 5) {
output_toggle(REL_5);
delay_ms(2500);
output_toggle(REL_5);
}
}
}