the Arduino IDE is nice for some rapid testing of an idea or some dev board you bought on Aliexpress or Ebay, but not for real embedded programming.
What is the advantage of using the Arduino IDE (ie. C) instead of eg. CircuitPython?
To be a bit pedantic here (as if I was not already ), the Arduino IDE works with C++ which is also different from writing plain C.
As Ian.M already pointed out, the Arduino IDE is nice for some rapid testing of an idea or some dev board you bought on Aliexpress or Ebay, but not for real embedded programming.
Now onto your question. There are basically three targets to consider here.
a) AVR based MCU's
b) ARM based MCU's
c) ESP32 based MCU's
Sure there are more, but these are the main ones.
2. What is the advantage of using the Arduino IDE (ie. C) instead of eg. CircuitPython? Smaller + faster code?
2. What is the advantage of using the Arduino IDE (ie. C) instead of eg. CircuitPython? Smaller + faster code?
The main advantage is faster development time -- if you can accomplish your task in those environments. You code will, in general, not be smaller nor faster, but it might be fast enough for your use case.
the Arduino IDE works with a language called "Wiring" that is a compatible subset of both C++ and Java.
If you are working with a board that is programmed in Java then the IDE wraps your code with some Java class bollocks and puts some imports at the top.
There is no such thing as "ESP32 based MCUs". Older ESP chips used Cadence's Xtensa ISA. Newer ones use (and Espressif have said all future products will use) the RISC-V ISA.
Being snarky and pedantic is a bad look at the best of times, but it's even worse when you don't actually know what you're talking about.
The main advantage is faster development time -- if you can accomplish your task in those environments. You code will, in general, not be smaller nor faster, but it might be fast enough for your use case.
There is nothing wrong with using the Arduino platform or Circuit Python. However, modern microcontrollers have a lot of powerful functionality that these platforms do not give you access to. To use this functionality you'll need to use a C development environment tailored for the device.
Another aspect to consider is that some development environments have versatile debugging capabilities which can be very helpful when developing complex applications. The videos in this playlist, for instance, can give you an idea of what programming and debugging is like using the STM32CubeIDE:
Quotethe Arduino IDE works with a language called "Wiring" that is a compatible subset of both C++ and Java.
If you are working with a board that is programmed in Java then the IDE wraps your code with some Java class bollocks and puts some imports at the top.I'm pretty sure that the Arduino IDE has never supported Java, nor has any "Arduino" board ever supported embedded Java.
The language itself uses a subset of C++ (avoiding any construct that would use heap memory allocation AFAIK)
The very early history comes with "Wiring" and there was some Java compatibility there
Hello,
I only have a shallow experience with embedded software, and have a couple of questions, especially regarding writing software for ESP and Arduino processors:
1; What are the alternatives to run code on those processors?
- Arduino
- Adafruit CircuitPython
- esp-idf (= CircuitPython?)
- other?
2. What is the advantage of using the Arduino IDE (ie. C) instead of eg. CircuitPython? Smaller + faster code?
Thank you.
Quotethe Arduino IDE is nice for some rapid testing of an idea or some dev board you bought on Aliexpress or Ebay, but not for real embedded programming.Nonsense. Or rather, only true for a narrow definition of "real embedded programming" that many applications don't require.
A case in point is the Marlin firmware for 3D printers - v1.1.9 is a *very* large Arduino project, which can actually be run on an Arduino Mega2560. However the .ino file of the sketch is essentially empty (just comments) as all the code is in the associated .cpp and .h source files ...
I think it’s really important to do something nobody here has done so far, and that’s to separate the Arduino IDE (the desktop software) from the Arduino framework (the language and libraries), because they aren’t the indivisible monolith many people think they are.
In fact, one of the most common IDEs used for programming with the Arduino framework is PlatformIO in Visual Studio Code. This is particularly popular among advanced users, because the two Arduino IDEs (the original Java-based “Arduino 1.x” and the new, currently in beta “Arduino IDE” 2.0) are both just too dumbed-down for advanced use. (2.0 adds a lot, but it’s still nowhere near PlatformIO in VS Code.)
What a lot of people tend to forget is that MANY "apps for microcontrollers" are NOT "complex projects." You can write them "in Arduino", you can use circuit- or micro- Python; you could probably use a BASIC Stamp running interpreted bytecodes at ~1000 "instructions" per second, or Basic-52 entered on an ASR-33. Or one of those weird languages like Forth, JAL, or even assembly language.
Stop giving me these "Arduino's IDE is unsuitable for advanced use" comments. Especially if you can't demonstrate that your project is "advanced." People have done more, with less, for 60 years...
(AND ... that's how you become an "advanced programmer." By writing a lot of NOT advanced programs!)
Again, one must distinguish between the people who think using the Arduino framework is bad (utter nonsense IMHO) and those who think the Arduino IDE (the desktop apps) is bad.
In the first case, I think that’s nonsense, since it’s just libraries that simplify some things.
It doesn’t block you from digging deeper if (and when) you need to. And if anything, Arduino has become something quite rare in the MCU world: a fairly portable framework. The vast majority of Arduino code is portable across hardware architectures.
(AND ... that's how you become an "advanced programmer." By writing a lot of NOT advanced programs!)