4 ms·
Years after they became popular, I found an Arduino "starter kit" at a garage sale. Didn't use it because I didn't want even more software complexity in my lif
by MarkusWandel 5y ago
Years after they became popular, I found an Arduino "starter kit" at a garage sale. Didn't use it because I didn't want even more software complexity in my life. Later I needed to solve a particular problem, so I googled how to program an Arduino. Hmmm. "yum install arduino" and 10 minutes later I had a blinky light and 15 minutes later I had my first actual program running.
I keep seeing diatribes about how "modern" microcontrollers like the RP2040 are so much better and how the Arduino environment is too limiting. Well the Raspi Micro or whatever it is called is dirt cheap, so I ordered a few. And cracked the manuals, and ran the enormously complicated build environment complete with the complex modern Makefiles I won't understand in my lifetime. And got a blinky light. But I'll be darned if I'll learn all that stuff. But that's OK... eventually everything gravitates to the Arduino model again. The software underneath may be a nightmare, but the user interface is simple and ... inviting. This matters.
I'm no idiot technically. I work on some of the most advanced ASICs on the planet at my work (won't get into details on this). I just don't need even more gratuitous complexity in my life. My Arduino projects are not trivial, some of them in the thousands of lines of code category. I still like the simple, clean environment of it all.
I had to add a feature to a homemade photo repository that required Javascript. Cracked the manual, wrote some first principles Javascript. Oh, how do I do X? By using this gigantically complex framework. Bzzzt. Wrong. I'll do without X then.
- allo37 5y agoI remember when the Arduino became popular, my first reaction was "why do I need all these extra layers, just let me program my ATMEGA328 in good ol' C and call it a day". I guess it all boils down to finding the right level of abstraction that you're comfortable with.
- guitarbill 5y agoI largely agree, but I think Arduino is (largely) good because it removed complexity, and not necessarily on the coding side. E.g. pretty sure you can still just write C for a specific chip with Arduino. I've dropped back to reading an input register directly, either because `digitalRead`/`digitalWrite` is slow, or I want to read multiple inputs in parallel. So maybe here, the layers can be a hindrance, sometimes (but it's certainly more complex). I also remember the development experience before Arduino. Proprietary compilers/toolchains, awkward programmers and ISPs, and expensive eval boards or the xtal being weird on breadboard. To think AVR chips were some of the easiest to get into. I'll take a Mini/Micro/Teensy + Arduino any day for casual projects, despite some of the extra layers.
- allo37 5y agoYeah the Arduino libraries are a big help and let you get off the ground quickly. But the point I'm trying to make is that unless you're manually translating assembly instructions into opcodes, you're relying on some layer of "magic" somewhere to make your life easier. I don't really consider it "less complex" so much as "hiding complexity that most mere mortals won't care about".
- bsder 5y ago> the Arduino environment is too limiting The Arduino environment is limiting--that's the point. Arduino attempts to keep simple things simple. Complex things may or may not be possible--but that's not what an Arduino is for.
- rcxdude 5y agoExactly. If you need a blinky LED Arduino is fantastic at that. If you need a high-reliability embedded system handling 5 different simultaneous tasks, Arduino is going to be a world of pain. Where in the middle you bother to switch depends on your taste.
- MarkusWandel 5y agoI have a couple of Arduino projects that do 5 or more simultaneous things. Temperature sensors busy with a conversion, A/D converters taking readings, timers ticking, serial ports being watched for characters and so on. You can speak of "hard realtime" but all of this stuff works just fine in a polled fashion, just get through your main loop quickly and don't block on anything. With nothing much to do the main loop cycles 5-10K times per second even on simple AVR328. And then you have readable, easily maintained code without gnarly interrupt handling, realtime threads and all that. Need microsecond level hard realtime performance? Then don't do that. Though my superficial reading is that you can partly escape from the Arduino environment to do that too, without having to give up all of it. Need microwatt level power consumption? Then definitely learn to program the bare metal. I haven't had to, yet. Here's one of my less complex Arduino projects but the only one finished to a "show it off" quality. Realtime? Too limited by the Arduino paradigm? You be the judge.. https://github.com/MarkusWandel/battery-tester https://github.com/MarkusWandel/battery-tester I have to say, to get practical use out of the Arduino, you have to unlearn the "delay" function. If you never block on the main loop, you can do anything.
- bsder 5y ago> You can speak of "hard realtime" but all of this stuff works just fine in a polled fashion Erm, hard real time quite often is purely polled. Interrupts introduce a lot of non-determinism that polling completely sidesteps.
- Lichtso 5y agoI have to disagree here. Yes, the Arduino is made for beginners and it is easy (to use). But it is not simple. Just a week ago I ordered a RPi Pico and made an also easy to use Rust toolchain for it: Compilation, upload and run in one command "cargo run"! Some advantages I noticed so far: - The installed binaries (rustc for arm-v6-thumb etc) are much smaller than the Arduino IDE. - Can be programmed in standard C, Rust, Assembler, or what ever you like! - Simply add some libs which are not even made for embedded systems and get them running instantly - Does not require any special uploading driver, just acts as a mass storage device - Supports a wider range of technical limits (such as logic voltage levels) - Far more performant while also way cheaper I can say that I am done with Arduino and for me this is the clear winner. Maybe your bad experience just boils down to using the official SDK, which I agree is overtly complex and feels like it was just made to barely function.
- jatone 5y agothe RPI picos are wonderful. what you described for a process of uploading the program to the hardware is what they should all be. anything more complicated than that is a no go for me these days.