Error converting arduino to platform io (C++) : identifier "D21" is undefined

You need #include <Arduino.h> at the top of CPP file.

1 Like