Tutorial: Getting started with PlatformIO IDE and the Simple FOC Library

I’ve put together a 20min tutorial on how to use Simple FOC with PlatformIO IDE:

If you’ve never used PlatformIO IDE then I strongly recommend you check it out. It’s SO much better than Arduino IDE.

The video covers:

  • installation of platformio (and visual studio code)
  • creation on new project (selecting an ESP32 board)
  • adding multiple libraries (including github sourced libraries)
  • testing a gimbal motor and as5600 magnetic sensor
  • adding an additional board (pro mini mega368p gimbal controller)
  • switching between two boards using platformio environments
  • using build flags to have one code base for two boards
7 Likes

Thank you for your tutorial,
I’ve also been using platformio on atom. Compared with Arduino IDE, platformio ide has better interface effect and function Association

Thanks a lot @Owen_Williams for letting me know about PlaformIO. Compared to Arduino IDE, this looks much closer to what I am used to .

For those landing here, notice that the current version of PlaformIO doesn’t support the Nucleo-L476RG. Fortunately there is a workaround, see here.

1 Like


((((((

We have an online version of the tutorial as well:

If using PlatformIO with SimpleFOC, its important to add the option

lib_archive = false

to your platformio.ini

The error you post looks like a setup error of some kind, it has nothing to do with SimpleFOC. it means the Arduino (atmelavr) platform is not installed.

When using PlatformIO, you have to go the “Platforms” pane, and install the correct platform for your MCU. Ardunio, STM32 and ESP32 all have separate platforms.