I have a suggestion for improving the Arduino IDE and I would like to

I have a suggestion for improving the Arduino IDE and I would like to hear your thoughts on it:

As the IDE is used for more and more boards / devices, it becomes increasingly confusing for new users to select the correct device in the Tools / Boards menu… and increasingly annoying for me to have to reset it all the time as I bounce from one project to another. Personally, this is really bad when working on ESP-8266 projects as there are soooo many settings under tools.

It would be really nice to have some way to include that information IN the source code… in the main .ino file. Just open the .ino, and the IDE automatically selects the correct device, port, programmer, CPU speed, etc…

One way of doing it would be with simple comments in a specific format at the start of the file which would trigger an “offer” from the ide to copy those settings. This would allow the settings to double as documentation, and preserve the standard C/C++ functionality. e.g. it wouldn’t make the file unique to this IDE.

for example:

// Tools / Board: Generic ESP8266 Module
// Tools / CPU Frequency: 160 MHz
// Tools / Port: COM32

etc…

Which should result in a dialog that offers to set those settings. You can always cancel it… If you approve, it should set the board FIRST, then set the next line, then the next, and so on. If the board isn’t available, the IDE can direct you to the board library manager.

Time to make the switch to platform.io … Boards and board specific build options are separated into their own environments, separate from the source code.

@Gordon_McLellan ? What does an advertising system have to do with this?

What?

@Gordon_McLellan http://platform.io is a spam manager.

@Gordon_McLellan Platform.io is an advertising platform.

You meant: http://platformio.org

Tough room this afternoon

/unsubscribe

Source code should be portable so storing this kind of information in it doesn’t sound like a smart idea to me.
BTW, http://platformio.org/ - not http://platform.io

@Petr_Stehlik actually read what I wrote. Portability is maintained ed.

Ah… thank you for clarification Mace… I was starting to think he was a spammer… in any case, I’m NOT suggesting the need for a project management add on. That would just confuse new users. But suggesting settings from comments in the main code seems like it could be helpful and simple.

I solved this by having multiple copies of the IDE: one for ESP8266, one for STM32, one for Attiny/Digispark and so on. Sure, it eats up quite a bit of HDD-space, but this way I don’t have to always mess around in the board-settings as I just fire up the IDE based on which board I want to play with, and it also has the bonus of keeping the sketches for the different boards separate from one another.

I have been wondering about this too. Currently the “executable” you build in the IDE depends on two things: your source code and whatever model/submodel you happened to have selected last in the GUI of the IDE. Instead, I’d like that to be specified explicitly somewhere. This could be in a comment with a specific format in the main .ino file, possibly this could also be a separate file dedicated for this purpose. Perhaps we can put other useful build-related stuff there too, like a list of libraries that the sketch depends on.

In case someone here wants to know how to have multiple IDEs with each one having their own settings, libraries, boards and all: just simply create a directory called “portable” inside the IDE-directory. From there on, all the libraries and boards you install, all the sketches you write, all your settings will be stored there, also making it extremely easy to back them up when needed.

The Arduino plugin for Eclipse http://eclipse.baeyens.it/ handles this problem smoothly with Build Configurations.

The Arduino IDE is fantastic, but it does lack some advanced features. I made the jump to the Eclipse plugin when the number of custom libraries I was maintaining hit a dozen. Configuration was a bit hairy and startup time for Eclipse is annoying, but development is faster and more organized.

I really appreciate all the suggestions for how to get project management functionality by switching to another IDE. But… look, please… that really misses the point. The Arduino IDE is NOT designed to be a “real” IDE for professionals like us. It’s target audience is people who have NOT yet learned how to use an IDE. Project options are just another layer of confusion for those people. What I’m suggesting here is NOT (NOT NOT) project management… how am I failing to communicate this?

What I’m suggesting is sort of an AI or wizard or helper that suggests the user might want to switch the board settings based on comments at the start of the code. No need to know what a “project” is. No need to setup the project when opening a brand new .ino file you copied from the net. No need to understand that you even have to select the right board from the Tools menu to get the thing to program. You just open the .ino file, the IDE says “Hey, it looks like this project is for a xxx board, want me to select that?”

I’m not trying to make things easier for pros like us. Well… ok… I am, but… mostly, I’m trying to make things easier for the common schmo who doesn’t even know there is a Tools menu.

I see your github issue and the closed issue that it duplicates. I’d say your heart is in the right place, it’s a decent and noble suggestion. It’s a feature that would likely be useful for the beginner arduino user / esp8266 arduino core project developer.

Unfortunately I doubt this issue will get traction for implementation by the project maintainers and unless you’re a java developer, you’re willing to take this change on yourself and submit a pull request for this feature I fear it will go nowhere and be ‘closed won’t fix’ in the same way as the original issue.

I’ve +1’d Tyler’s comment above because personally I found the arduino IDE with it’s strange quirks more obstructive than productive pretty quickly and I made the move to eclipse myself after a month or two of fighting with the arduino IDE. IMO the arduino IDE is ok for small projects with a very small number of source files but nothing more complex than that.

So to sum up, yes a decent suggestion but I expect anyone trying to do anything ‘semi-serious’ would learn what they need to learn to battle on with the arduino IDE or just abandon the arduino IDE completely when they come to the conclusion that it’s more trouble than it’s worth.

When working on a non-trivial project i give up on the IDE and build a simple Makefile and use gvim

I personally use CodeBlocks from windows with a Makefile executed remotely on an linux contained esp-open-sdk. It’s a pain in the ass to setup, but it gives code completion, and error reporting.

I am quite happy with the Arduino IDE, I wouldn’t know how to use even 10% of Eclipse’s capabilities, for example, but the Arduino IDE could, indeed, use some improvements. I don’t quite agree that including board settings and such in a sketch is a good idea, I’d rather just have the IDE simply remember the settings the user have chosen per board – simple, effective, and solves the issue of having to change settings every time you swap between different boards.

Part of this problem is related to the fact that the arduino ide and arduino ‘projects’ have no concept of a project file that might contain metadata like this. Without this concept existing, including this metadata in one or more .ino files is probably all that can be done for projects being compiled in the arduino ide world. An arduino ide project is basically a folder that contains a bunch of . ino / .c / .cpp / .h files and nothing more.

Now I don’t know if this is the way it is for some good reason and there’s absolutely no way it can be changed, but that’s the way it is today and it is what it is. Eclipse projects and the arduino eclipse plugin can handle this through it’s .project file configuration