Blinking LED on Arduino With Interrupt and RTOS

Flashing LEDs with Arduino

Blinking LED on Arduino With Interrupt and RTOS

Making flashing LEDS is one of the simplest ways to demonstrate the timing capability of microprocessors.

Here are some techniques you can do:

  • Timer interruptions
  • Standard Arduino delay
  • Delay from FreeRTOS

Standard Arduino Delay

Delay on Arduino explained at https://www.arduino.cc/reference/en/language/functions/time/delay/

On standard Arduino software such as Arduino Nano and UNO, this delay is implemented with the Loop software.

Example of a software using this delay is an example of Blink software on Arduino (https://www.arduino.cc/en/tutorial/blink)

The flow Diagram of the Blink program is as follows

Flow Diagram of Blink ()

A Delay on FreeRTOS

FreeRTOS allows the Arduino software to have multiple loops at the same time.

Ported FreeRTOS for Arduino UNO and Nano can be viewed at https://github.com/feilipu/Arduino_FreeRTOS_Library

This FreeRTOS Library can be installed on the Arduino IDE from the Tools-> Manage Libraries menu. Then search by keyword FreeRTOS.

The FreeRTOS library installation process
The FreeRTOS library installation process

For example, here is a flowchart diagram of a program that makes the LEDS blink with 3 loops. Each LED has a different frequency.

Flashing with FreeRTOS
Flashing with FreeRTOS

The Source code can be viewed at https://github.com/waskita/embedded/tree/master/atmega-blink-freertos

The FreeRTOS function used is

Arduino with LED flashing
Arduino with LED flashing

Here’s the Arduino Nano hardware demo

Timer Interruptions

Under construction

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.