Arduino IDE, PlatformIO, Tabs and other programming options

Tbh, the real problem I think lies in the programming language itself. The includes will work like in the Arduino IDE, but the editor is a lot more practical. It’s just not very effective, but hey, it’s simple :slight_smile:

@Lichtsignaal @wanek Hey guys… interesting topic… I have even installed PlatformIO to try it out… but am already getting overwhelmed :stuck_out_tongue: Whatever you say about the Arduino IDE, it is bog simple :smiley:

Anyhow, I moved this discussion into it’s own topic for two reasons… I didn’t want to clutter the other uses issue topic, and I think this IDE topic might be worthy enough to keep open for discussion purposes.

2 Likes

Check! Good move.

Let me know what works and doesn’t work in PIO and I’ll try my best to help everybody out.

So you guys use platformio in stead of Arduino IDE ?

I do, but I updated to the latest version which has a HUGE bug. For now it doesn’t work at all, but I’m figuring out how to fix it as we speak.

-edit-

I had to reinstall it, so for new users the current version should be OK :slight_smile:

If you are on Windows, add an enviroment variable called PLATFORMIO_LIB_EXTRA_DIRS and point it to the path of your Arduino libraries. It will usually search there in the last phase of compiling and linking, but you could put your most used and stable libraries there so they will always be available to you.

In the local project dir you can add specific libraries for projects. This way every project will have it’s libraries and the speed will be optimal at compile time. This way you can also test new versions pretty easy.

Because they are IDE and programming related, I am moving a few postings from another unrelated topic to here… as it is a good place to discuss various IDE and programming methods.

First I will reference this topic as it seems related, but ended up being more a “Blame Blynk” thing then a “this is how the IDE works” thing :wink: [SOLVED] Multiple #include across IDE tabs causing multiple definition errors

Then I am pulling related posts from this topic so as not to further bloat the Project made with Blynk Topic.

1 Like

Its very simple… just have to remember that the main.ino file needs to include the files in the correct order… according to what file needs what function loaded first.

You can look at one of my projects on github to get an idea how I do it.

I just use the Arduino IDE tabs; The main *.ino contains all the defines, inits, setup and void loop(). Then any other tab can be named whatever I want and contain as little as one line or a whole group of voids and/or Blynk functions… I found that no particular order was needed, a call for a void or function just works, regardless of which tab (or the name of the tab) it is really in. So I simply arrange everything into groups that work for my cognitive understanding :slight_smile:

In the folder, they all appear as *.ino files bearing the names of the tabs, except of course, the primary file with the sketch name.

Based on what @Jamin’s project shows, there is apparently other ways of splitting a sketch… hmmm.

I created these files by using tabs in the Arduino IDE too… when you create a tab, you create a file next to your .ino file.

Having it open in another tab does nothing if it isnt included.

EDIT: ohh i see you make new ino files… when i was learning arduino, i read that the ino file must be the “master” project file, and any files you add must either be a header (.h) or cpp file.

Yah, I just click on the “New Tab” button and give it a name… the IDE creates the .ino file designation… idunno :confused: but it works.

try making a file called “blah.h” … then use include “blah.h” in your main sketch. You must include them in a certain order though otherwise you do get compile errors.

I created a tab called blah, and created a void (granted, one that does nothing… but it could have if I took the time) in the resultant tab and it compiles fine… I guess I’m just breakin all da rulz :stuck_out_tongue:

and you type in “blah.ino” when it asks for the file name after clicking “new tab” ? or just type “blah”

Hmm, interesting… I originally just named it “blah”… but I did rename it, with everything still compiling, but then that void isn’t actually called by anything… so I renamed another tab, one that actually does something, with the *.h but that broke the compiling because something wasn’t declared.

So it looks like if left to it’s own file designation choice (*.ino) the IDE is smrtnuf to just work all the files together without fancy declarations, yet still have all the organisational benefits of tabs.

My days of breaking stuff just for fun is swiftly coming to a middle :wink: thus I think I will just keep it that way for now.

Sorry @William, didn’t meant to start a rabbit trail in your Project Topic.

This “How to break a sketch into smaller sections” had been previously debated (and Blynk falsely blamed for it not working as “expected”) and my interjection turned this one into another learning discussion, one that might be informative for others… but I wonder if we shouldn’t branch this into it’s own topic for any further “How to Tab or not to Tab” discussion. @jamin do you think it is worth further discussion?

1 Like

Maybe its an advanced topic that should be discussed.

Hi, who uses Platform IO ?
Im trying to use it and i am having some trouble so i want to know what you guys think.
Is it worth getting in to ?

Many people here using it. It works just fine. However, platformio specific questions better to ask on Platformio forum. Platformio is cool, but mostly for more advanced users and if you really work with hardware a lot.

1 Like

I figured it out works really well !
Much more simpler than arduino ide i find.

I use it too, it’s so much better than that stupid Arduino IDE. Although with the latest version I have some issues when I switch from Mac to Windows. I have to re-initialize my project sometimes, but other than that it’s very neat.

1 Like