create traffic light by microcontroller by proteus
watch the video and desing the map then type the code below
code:
void main() {
trisc=0x00;
trisb=0xff;
portc=0x00;
while(1)
{
if (portb.f0=1)
{
portc.f0=1;
}
else
{
delay_ms(3000);
portc=0b00000010;
delay_ms(3000);
portc=0b00000100;
delay_ms(10000);
portc=0b00000010;
delay_ms(1000);
portc=0b00000001;
}
}
}
that is all thank you for watching