How to write a great Arduino library
sparkfun.com
sparkfun.com
At this point, the Arduino IDE is my least favorite part of the whole ecosystem.
And then I realized, you can just take any .c or .cpp written for the AVR, rename it to .ino, put it in a folder with the same name, and use the Arduino IDE to compile and flash.
So I never really use C::B for the Arduino anymore, I just write the code in Notepad++[2] and use the Arduino IDE to upload.
[0]: http://www.codeblocks.org/
[1]: https://uetianblogger.blogspot.com/2015/05/winavr-and-codebl...
[2]: https://notepad-plus-plus.org/
EDIT: > you can just take any .c or .cpp file
Eh... actually only .cpp, as the Arduino IDE is C++. Or a .c file that will also compile in C++.
It supports the arduino-style code munging, though realistically if you're at least remotely familiar with C++ it's super easy to not use it.
It also supports basically every embedded platform out there to some extent.
For those who are interested in building a library, here's my TravisCI workflow for unit testing & running examples on various platforms: https://github.com/FortySevenEffects/arduino_midi_library/bl...
https://github.com/mcastorina/laptop-remote/blob/master/Make...
Haven't used it since then, so YMMV.
I haven't done it personally... but I also haven't yet poked much into Arduino either. I'm still having fun with Raspberry Pis. Arduinos... are a little more in-depth.
Generally: Arduino CLI
Mac + Xcode: EmbedXCode.
Windows: Arduino add-on for VS.
I would keep the Arduino IDE because no work-alike is going to have every feature.
Things can be as complex as reasonable in the implementation, but providing helpers, macros & shortcuts (as well as good documentation and examples as stated in the blog post) makes the learning curve less steep.
[1] https://github.com/FortySevenEffects/arduino_midi_library
How I wish that this would drive C++ design decisions of lately.
Also you can make c++ look not far from python in terms of cognitive overhead for beginners. C ? Not so much
of course it is - https://gcc.godbolt.org/z/welWvd
C gives you O(N) memcpy, C++ gives you O(1) do-stuff-in-place for the exact same code
> overloading operators
has exactly zero things to do with RVO
> I don't feel like any of this is consistent or simpler than C.
it produces vastly simpler user code. In years and years of programming in C++ never has "code acts differently depending on whether it's return value optimized or not" been an issue for anyone I know.
I don't like my IoT devices to be easily p0wned, just because an array went out of bounds.