News for hackers. Stuff that matters.
Re:How to write a great Arduino library by news_to_me on Sunday March 01, 2020 @04:05PM (#22459318)
Does anyone have recommendations for writing Arduino code without the Processing-based Arduino IDE? I'm sure there must be a not-too-difficult makefile-based compile/upload configuration, but I'm not aware of any (nor do I trust myself to write one from scratch).

At this point, the Arduino IDE is my least favorite part of the whole ecosystem.

Re:How to write a great Arduino library by inamberclad on Sunday March 01, 2020 @05:44PM (#22459921)
I use PlatformIO's CLI, which is pretty good for build management. It also has its own library system.
Re:How to write a great Arduino library by carlosperate on Sunday March 01, 2020 @07:43PM (#22460547)
Arduino has recently modularised their IDE, and the arduino-cli can be used to crate a sketch, compile it and flash the board: https://github.com/arduino/arduino-cli
Re:How to write a great Arduino library by klingonopera on Monday March 02, 2020 @01:38AM (#22462194)
I've managed to setup Code::Blocks[0] to use WinAVR to program Arduinos. Here's a guide[1] I found for that. It works, but I probably forgot to add some optimization flags, because the code ran slower than when compiled with the Arduino IDE.

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++.

Re:How to write a great Arduino library by fake-name on Monday March 02, 2020 @12:00AM (#22461787)
Platformio[0] is probably the best option, here.

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.

[0]: https://platformio.org/

Re:How to write a great Arduino library by jpindar on Sunday March 01, 2020 @07:04PM (#22460352)
Atmel Studio. It was very easy to set up, and can call AVRdude for uploading. It has the ability to import typical Arduino projects, so you can either keep using the Arduino libraries or convert the project to pure C/C++.
Re:How to write a great Arduino library by craftinator on Monday March 02, 2020 @12:28AM (#22461877)
I really wanted to use Atmel Studio, but couldn't get it working correctly on Arch Linux + wine. Can't imagine why such a major company wouldn't support Linux native.
Re:How to write a great Arduino library by leonvv on Sunday March 01, 2020 @04:49PM (#22459618)
The Arduino IDE has a verbose mode which prints out all the commands it uses to upload your program.
Re:How to write a great Arduino library by jlubawy on Sunday March 01, 2020 @04:51PM (#22459631)
This plus VS Code and CMake is what I'd use to start any new project, saves time having to figure out all the options yourself.
Re:How to write a great Arduino library by faster on Sunday March 01, 2020 @04:12PM (#22459371)
I switched to VS Code with the PlatformIO extension. A little bit of conversion is required, 'ino' to 'cpp' and some shuffling between directories.
Re:How to write a great Arduino library by franky47 on Monday March 02, 2020 @03:36AM (#22462701)
As others mentioned, PlatformIO is a good start.

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...

Re:How to write a great Arduino library by craftinator on Monday March 02, 2020 @12:25AM (#22461870)
PlatformIO plugin for VSCode. There's a bit of a learning curve, especially for folder structuring requirements, but overall it makes you stay organized in a consistent and repeatable way. It's also great if you're working with more than just Arduino framework (Espressif, Kendryte, STM32), as you can keep your code modular and easily apply it to different microcontrollers.
Re:How to write a great Arduino library by miccah on Sunday March 01, 2020 @07:14PM (#22460406)
I wrote a very, very simple Makefile awhile back utilizing the arduino CLI options.

https://github.com/mcastorina/laptop-remote/blob/master/Make...

Haven't used it since then, so YMMV.

Re:How to write a great Arduino library by etaioinshrdlu on Sunday March 01, 2020 @04:28PM (#22459490)
I had good luck with Atmel Studio which is a variant of MS visual studio. This was on the ARM based arduino parts. It overwrote the arduino boot loader. The debugger was actually useful!
Re:How to write a great Arduino library by monocasa on Sunday March 01, 2020 @04:18PM (#22459414)
I've used this in the past to get started.

https://github.com/mkleemann/cmake-avr

Re:How to write a great Arduino library by inetknght on Sunday March 01, 2020 @11:24PM (#22461660)
My understanding is that GCC can cross-compile to Arduino if you target AVR. See also https://www.arduino.cc/en/Reference/UsingAVR

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.

Re:How to write a great Arduino library by anonsivalley652 on Sunday March 01, 2020 @06:10PM (#22460057)
Not Fritzing.

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.

Re:How to write a great Arduino library by tridentlead on Sunday March 01, 2020 @04:18PM (#22459418)
I don’t know if this is what you’re looking for but I frankenstiened this from some stuff on the net: https://github.com/dstutman/avr-template
Re:How to write a great Arduino library by mcshicks on Sunday March 01, 2020 @08:59PM (#22460954)
I have used emacs on linux before and it's fine. However I don't know how well it works with non standard arduinos like atttiny. I can't remember the exact write-up I used but I just googled emacs arduino.
Re:How to write a great Arduino library by lonelygirl15a on Monday March 02, 2020 @04:55PM (#22469468)
Re:How to write a great Arduino library by tuankiet65 on Sunday March 01, 2020 @04:59PM (#22459676)
I used to rely on this Makefile template https://github.com/sudar/Arduino-Makefile.
Re:How to write a great Arduino library by feistypharit on Sunday March 01, 2020 @07:06PM (#22460366)