Hi friends today we make a traffic light control based on PIC 12F675.to make this project we need electronic components given blow.
ELECTRONIC COMPONENTS
1. PIC 12F675 microcontroller
2. power supply 5V
3.3 Resistance (100 - 1K ohm)
4.3 LEDs (Red,Yallow and Green)
microc code for project
" void main()
{
TRISIO = 0x00; // pins select as o/p
while(1) // infinit loop
{
GPIO.F0 = 1; // active RED LED
delay_ms(5000); //for 5sec.
GPIO.F1 = 1; // active YELLOW LED
delay_ms(2000); //for 2sec.
GPIO.F2 = 1; // active GREEN LED
delay_ms(5000); //for 5sec.
}
} "
by using this code the red led active for 5sec. and yellow led for 2sec and green led for 5sec.
ELECTRONIC COMPONENTS
1. PIC 12F675 microcontroller
2. power supply 5V
3.3 Resistance (100 - 1K ohm)
4.3 LEDs (Red,Yallow and Green)
PIC 12F675 based traffic light control circuit diagram |
microc code for project
" void main()
{
TRISIO = 0x00; // pins select as o/p
while(1) // infinit loop
{
GPIO.F0 = 1; // active RED LED
delay_ms(5000); //for 5sec.
GPIO.F1 = 1; // active YELLOW LED
delay_ms(2000); //for 2sec.
GPIO.F2 = 1; // active GREEN LED
delay_ms(5000); //for 5sec.
}
} "
by using this code the red led active for 5sec. and yellow led for 2sec and green led for 5sec.