PlatformIO and Arduino/Node MCU C++

General question as I’m learning PlatformIO. Is it same to assume (mostly) that when you find code for various libraries in Arduino world that are C++/Arduino IDE based, that as long as the equivalent exists in PlatformIO, the code is basically the same?

I ask because I just did a quick project using a Node MCU/ OLED using the Adafruit libraries and the methods and code were pretty much identical.

Trying to get my bearings and just make sure that putting time into PlatformIO I am not going to spend all my time hunting for the same code here that I find on Arduino.

You do not learn to program “PlatformIO”.

PlatformIO is more of an IDE, not a language.
You can find a detailed description of what PlatformIO is here What is PlatformIO? — PlatformIO latest documentation

You learn to program in C++ / Arduino.

Therefore, the code you write in the ArduinoIDE is nearly(*) identical to the code you write in PlatformIO.

Almost all libraries can also be found in the PlatformIO Registry.
If this is not the case, libraries can also be integrated directly via their Git repositry. lib_deps — PlatformIO latest documentation

(*) There are 2 differences compared to the ArduinoIDE:
ArduinoIDE always automatically includes the Arduino.h. You have to do this yourself in PlatformIO with #include <Arduino.h>

The ArduinoIDE automatically “generates” predeclarations for functions. This does not happen under PlatformIO. For details please see Convert Arduino file to C++ manually — PlatformIO latest documentation

Depending on the platform, there are differences regarding the Arduino implementations. Since you are talking about a NodeMCU, I assume that you are using the Espressif8266 or the Espressif32 platform?

1 Like

Thank you for the explanation. This is kind of what I thought, but before I went down this road wanted to verify. The description is filled with buzz words (framework, platform blah blah) and I wanted to make sure I wasn’t going down the wrong path.
I did notice I have to make interface (.h) files like other OO languages, which is to be honest what I am used to anyway.

Yes I am using Espressif8266 .