it is driving me crazy and unfortunately I look for it in internet but I was not able to find the solution.
I want to start building a program with CAN communication in an Arduino NANO ESP32. For that I am using the TWAI library. I have used the TWAIRecieve.ino example in Arduino IDE and works as expected. But now I wanted to move to PlatformIO
I copied the code from TWAIRecieve.ino → main.cpp
And I configure platformio.ini file as following
platform = espressif32
board = arduino_nano_esp32
framework = arduino
monitor_speed = 115200
Unfortunately when compiling I get following error
src/main.cpp:27:10: fatal error: driver/twai.h: No such file or directory
It looks like the drivers are not correctly imported from Arduino
Anyone any ideas?