All information in this topic can be skiped if you are already proficient in PlatformIO.
PlatformIO is an extension of the popular coding IDE Visual Studio Code. The must known is ArduinoIDE but we want to be big boys and also be able to use our favorite IDE so we will go with PlatformIO. With this extension you can upload code to your favorite microcontroller and manage your projects.
To create a project, go to the PIO Home and select Create a Project. Then find the board you want to use and voilá. They have weird names most of the times so search online for what you should use ;). Buuuut, int the case of esp8266 you can select the on in the example:
So this is what a PIO workspace looks like.
Source is where you will find the main program you will write. You have setup() that is where you reun your code that you only want to run once. You also have loop() where you run the code that you want to execute to infinityyyyy, or until you run out of battery.
Arduino is the most know and go to microcontroller library. You can use it with 99% of microcontroller boards that you will come by.
Lib is where you put your libraries. Usually it is for sensors or some repetitive thing that you don't want in your main program. Good to keep the code cleaner and easy to debug. You basically create a library like you would in c our c++, but in your main, you can call your libraries with <>.
Here you have the board and framework configuration. You can easily change this if you want to change your board. If you are using external libraries, the program will call 📲 them in here.
Flashing the code to the board is the act of sending the compiled code to the microcontroller. Only need to click on the arrow!
Last topic is Libraries. With Arduino.h you already have a lot of tools, but there are open-source libraries that will remove you lots of headaches if you just use them! There are some ways to do this, but I will give an example through PIO:
Just click install and the magic happens!