79. Simultaneous Blinking LEDs

Build a task using the microcontroller based on the following requirements:

  • Connect two LEDs to the microcontroller.
  • The LEDs should blink at different intervals:
    • One should toggle every 100 ms
    • The other should toggle every 360 ms
  • The timing of the blinks must be as precise as possible.

Also, consider the following condition

Main Loop Constraint:

The controller is constantly busy executing critical tasks inside the while() loop in the main function, as shown below:

main () {
  while (true) {
    //In this loop Microcontroller is busy in monitoring and performing critical tasks constantly.
  }
}

 

 

 

 

Submit Your Solution

Note: Once submitted, your solution goes public, helping others learn from your approach!