63. LED Blink Rate Control

Build a task to blink the LED using a microcontroller with the following requirements

  • An LED should blink continuously.
  • The blinking delay should be adjustable between 100 ms and 5000 ms using a potentiometer.
  • The delay should update instantly as the potentiometer is rotated.

Also, consider the following condition

Main Loop Constraint:

The controller is constantly busy executing critical tasks inside the while() loop in the main(), as shown in the code below, so use Interrupts to implement the task.

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

 

Example Video


 

Submit Your Solution

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