Example codes for platformio

i think that platformio should have a feature that ( when you install a new library and even the ones you already have installed) that shows you the example codes like in arduino ide

1 Like

That feature is already implemented:

2 Likes

Thanks is there a way of creating a new project based on this or do you need to Create Project, Create and Copy files set up ini etc?
With the Arduino IDE I select an example then hit upload button.

Currently, this feature is available only for PlatformIO project (see examples in “Platforms”). We plan to add “Import Arduino library example” soon.

1 Like

Copy the code from example,
Create new project,
Paste the code into main.cpp (replace the default generated code)
Upload (will automatically compile),
Done

Sounds great will look out for it:)

Very well answered. As an ‘absolute ace’ with Arduino IDE, I am strugling with this as many persons who are probably afraid to ask. The PlatformIO environment is an absolute Gem! But … completely opposite of what ‘botofancalin’ is saying, things are not THAT easy for a absolute NOOB as it comes to PlatformIO. To me the Example-Code in Arduino IDE is the key for its success. And most of us started to get into Embedded coding since one could use the examples of each board and library as a starting point, modifying that and extending it to ones needs. In PlatformIO the examples as you rightly state Ivan are not really yet implemented. I find it crucial to underline that a comment like
‘Copy the code from example,
Create new project,
Paste the code into main.cpp (replace the default generated code)
Upload (will automatically compile),
Done’ by Botofancalin cuts the corners, does not respect the person asking the question, and snows under the needs all the other initial PlatformIO NOOBS and are not recognized as such and will NOT jump on the PlatformIO Eco System since they get the feeling it is not their ‘car’. (Steer on the right, handbrake on the backseat, yes … eh … ok …)
There is nothing wrong with copying great ideas from the neighbours. PlatformIO is the next thing as it comes to Embedded but it currently leaves a group behind. The Examples as in Arduino IDE can have more than one file to be imported. So it is not simply copy paste from the one the windows, also copy-paste is for monkeys (I do not have one) and not for people once one sees this can be automated. This is very well done in the Import Project, and probably most of the coding for that is already done. It is just the pointing to the Example-sections of the Libraries that is missing.
Bottom line. Do not forget the NOOBs, because they are your future Aces who will also contribute to the community, when they are ready taking the first hurdles.
Keep up the good work Ivan. I am very impressed with the work on PlatformIO. Somebody should take care of the Noob stuff maybe, somebody who takes a little remark like of ’ Taran_Agnew’ as a tip of the iceberg of a deeper lying problem.
PS: Yes this is an old topic. It was the only one I could find in the forum on this subject, so therefor concerned as well. Apparently the closing of this subject made it irrelevant to the roadmap, since after a year this feature has not yet been implemented. Please put it on the roadmap again!

3 Likes

Any updates on this?

So far only board project examples available for import, both from Home and from Platforms screens…