Absolutely, I agree that that would be nice, but I don't think it's that easy beyond the basic stuff like blinking an LED with delay
.
To give a specific example, you don't want to do Arduino-style things like while (millis() - prev < period)
on a Linux system, because that would just sit there consuming 100% CPU, producing heat without doing anything.
I think the APIs provided in the link above work just fine, and it's not hard to get started using them if you come from an Arduino background: if you're used to digitalWrite
, it's not a problem to start using gpio_write
on the RPi, for example. Especially the Python GPIO-Zero library is really easy to use, the C++ ones might be a bit harder to get running.
I think the library support is a bigger issue, but it's bit of a chicken-and-egg problem, people don't use the Pi for that kind of stuff because there are few libraries, so there aren't many users to write the libraries. And while some libraries can relatively easily be ported from Arduino to RPi (e.g. ones that just do SPI or I²C communication with a display or sensor), others that involve timing and more advanced features are not as trivial, so providing the familiar Arduino-like API isn't really going to help there either.