Question: Write a C-language program that will cause the ATmega328P to continuously rotate two consecutive lighted LEDs through the row of four LEDs and back to

 Write a C-language program that will cause the ATmega328P to continuously

Write a C-language program that will cause the ATmega328P to continuously rotate two consecutive lighted LEDs through the row of four LEDs and back to the first LED with no pause in between (i.e. PC0-PC1 are on, then PC1-PC2, then PC2-PC3, etc.). This will be called the main rotating sequence. In this sequence, any given LED pattern must be on for 250 m sec before transitioning to the next pattern. LEDs are active high Use the interrupt functions of INT0 and INTI such that the switches attached to PD2 and PD3 cause the following action when the switches are cycled (capture the switch signal's rising edge or falling edge to trigger the interrupts): A press of switch 0 (on INT0) will cause the LED pattern to change to a count up by 1 in binary, starting at 0000, for one complete cycle of the four LEDs, with PC0 being the least significant bit. In this sequence, any given LED pattern must be on for 500 m sec before transitioning to the next pattern. After one cycle is complete, return to the main rotating sequence at the point where it was interrupted. Do not allow interrupts of this ISR, or immediate repeat of this routine if INT0 is retriggered during the ISR. However, if INT1 is triggered during this ISR, then it must execute immediately after this ISR is done. Main rotating sequence is running... (0 = off, 1 = on) 0011 1001 1100 INTO triggered... 0000 0001 0010 etc. until 1111 is reached and then the main rotating sequence resumes A press of switch 1 (on INT1) will cause the LEDs to display the number 1 in binary code for 3 seconds, after which the code is to return to the main rotating sequence at the point where it was interrupted. Do not allow interrupts of this ISR, or immediate repeat of this routine if INTI is retriggered during the ISR. However, if INT0 is triggered during this ISR, then it must execute immediately after this ISR is done. Write a C-language program that will cause the ATmega328P to continuously rotate two consecutive lighted LEDs through the row of four LEDs and back to the first LED with no pause in between (i.e. PC0-PC1 are on, then PC1-PC2, then PC2-PC3, etc.). This will be called the main rotating sequence. In this sequence, any given LED pattern must be on for 250 m sec before transitioning to the next pattern. LEDs are active high Use the interrupt functions of INT0 and INTI such that the switches attached to PD2 and PD3 cause the following action when the switches are cycled (capture the switch signal's rising edge or falling edge to trigger the interrupts): A press of switch 0 (on INT0) will cause the LED pattern to change to a count up by 1 in binary, starting at 0000, for one complete cycle of the four LEDs, with PC0 being the least significant bit. In this sequence, any given LED pattern must be on for 500 m sec before transitioning to the next pattern. After one cycle is complete, return to the main rotating sequence at the point where it was interrupted. Do not allow interrupts of this ISR, or immediate repeat of this routine if INT0 is retriggered during the ISR. However, if INT1 is triggered during this ISR, then it must execute immediately after this ISR is done. Main rotating sequence is running... (0 = off, 1 = on) 0011 1001 1100 INTO triggered... 0000 0001 0010 etc. until 1111 is reached and then the main rotating sequence resumes A press of switch 1 (on INT1) will cause the LEDs to display the number 1 in binary code for 3 seconds, after which the code is to return to the main rotating sequence at the point where it was interrupted. Do not allow interrupts of this ISR, or immediate repeat of this routine if INTI is retriggered during the ISR. However, if INT0 is triggered during this ISR, then it must execute immediately after this ISR is done

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!