Hi im FAIRLY NEW to this but I have to write a c program for a traffic light in MPLAB and I cant seem to get my program to compile. any help will be greatly appreciated. thanks in advance. the guidlines are:

1) First, The NS RGB will show the Green color while the EW RGB will be on RED for
the amount of ‘x1’ seconds (use your group’s table number and the table below to
determine the value of the variables x1, x2, x3, and x3). The NS COUNTER will
show the number of seconds being counting down, i.e., this counter will start with the
value specified by ‘x1’ and count down to 1 and get turn off 1 second later. The EW
counter will remain off.
2) After ‘x1’ seconds have elapsed, the program will check the EW input. If 0 (no car
present), the program will wait an additional ‘x2’ seconds and then go to step 3). Both
NS and EW Counters will remain off. If the EW switch is 1, then skip directly to step
3).
3) The program will change the NS RGB from GREEN to YELLOW and wait for 2
seconds.
4) Next, the NS RGB will change from YELLOW to RED while the EW RGB will turn
to GREEN. These lights will be on for ‘x3’ seconds. The EW Counter will display the
down counting of ‘x3’ while the NS Counter will stay off.
5) After ‘x3’ second have passed, the NS input switch will be tested. If 0, the program
will wait an additional ‘x4’ seconds and then jump to step 6). Both counter displays
will stay off. If NS input is 1, go directly to step 6)
6) The EW RGB will be changed from GREEN to YELLOW and will stay on for 2
seconds.​

Connect with Us

Sign Up

Quote of the day

“Electrical science has disclosed to us the more intimate relation existing between widely different forces and phenomena and has thus led us to a more complete comprehension of Nature and its many manifestations to our senses.”