Can this arduino project easily be ported to free rtos

Hello,

I working on this arduino project : https://wokwi.com/projects/438929777261353985

Now I wonder can this easily be done with freertos on a esp32
And how would you divide this project in tasks ?

Yes, but you will have to do the necessary hardware and software configuration/initialization for the specific components that are available on ESP32 with respect to Arduino which is independant of RTOS.

And how would you divide this project in tasks ?

It depends on what your project is doing; if you can elaborate your requirements, that will help to provide better answers.

  1. use a led to show a menu
  2. depending on the choice , show a effect on the led ring.
  3. you can use the buttons to show the next menu item, last menu item or choose a menu item.

I cannot rate this as easy or difficult. A lot of the challenges porting this to an ESP32 with FreeRTOS come down to familiarity. The more familiar with programming the ESP32 that you are the easier this port would be.

As for how to structure this project…

  • I’d use ISRs for the three buttons (vorige, selecteer, volgende in your example). These buttons are pressed infrequently and could be structured to execute quickly so an ISR is a good fit. This will also make your buttons responsive.
  • I’d use a high priority task FreeRTOS task to adjust the ring. This can be signaled (unblocked) by the button ISR. This task would largely be dormant as it sets the state of the ring and blocks. If you need flashing/blinking you could have this task periodically awaken by using a timer.
  • I’d use a medium or low priority FreeRTOS task for the LCD display. This can afford to be a little less responsive and may do the most processing of you tasks.

Manipulating the I/O of the ESP32 will require some board specific knowledge. Espressif may also provide a library to simplify using the I/O. I would recommend checking for that.