Porting Arduino drivers to Daisy

Is it relatively easy to convert an Arduino driver to Daisy? Seeing as they are written in C++ also and refer to all the pins the same, isn’t it a matter of changing the required references for Daisy? I had a look through the LiquidCrystal I2C library for displays and looks more complex than I thought but in principle?

When I first started on this journey I imagined that because Arduino has lots of peripherals with drivers they would also be available for Daisy. While I think there is enough in the Daisy library to design it would be nice to try out other devices for projects.

Arduino libraries website.

https://www.arduinolibraries.info/categories/signal-input-output

Article on writing drivers for Arduino

Thanks for sharing!
If you are thinking of using the Arduino toolchain for Daisy, be warned: It is a dead end until someone opens up a way to use more than 128kBytes of program memory. So unfortunately to get something useful, you will have to go one step further and convert the driver to be compatible with libDaisy instead of Daisyduino.
:crazy_face:

Yes, sorry I meant drivers for C++ in libDaisy. I set up the C++ dev environment and have been looking in src/dev at the drivers and then I started looking at the Arduino drivers to compare and see there is a lot of similarity in the code.

I’m sure there is some interest in the community for people to use other peripherals and would be good to discuss this.

I’m looking to try a simple Arduino driver I could try to learn how to do this and looking for some pointers where to start.

I’m particularly interested in DAC MPC4728, ADC MCP3204 and CD74HC4067 multiplexer. I see there is a tutorial for the MPC4725 but looks like just for Arduino and one for the CD4051 mutliplexer which I hope will work with the CD74HC4067 as well.

The MCP23017 I/O expander btw is a good one that has a libDaisy driver.

PS. I very quickly gave up using Arduino. VS Code C++ is much easier to use and more understandable.

Hi,
In my opinion, the differences between cpp and .ino are rather small. The resources of drivers and perhaps even more interesting of tutorials and docu of Arduino are a very big advantage. I like the possibility to use my own code with different microcontrollers. So in my opinion SE should get busy to move the stuff to a version of Arduino, which can do >128kB. It is such a waste of time of the customers, that each customer has to learn libDaisy and perhaps convert libraries…

While it may be convenient to many users Arduino also has a lot of limitations and has a lot of inefficiencies under the hood.

It hides away a bunch of stuff using their Wiring library and other C++ tricks, but that doesn’t mean you’ll be able to create any proper audio device using it. Beyond some tinkering it’s just too limiting.

Having much tighter integration is then possible using libDaisy. It does make sense that this is where the focus is as that is also where all the advanced usage is done (and ultimately where likely most revenue comes from: bulk sales to vendors that don’t use Arduino for their products).

I do agree that it would be nice to have a broader driver support, but that doesn’t mean this should come from Arduino libraries because as said they come with a lot of downsides under the hood.

1 Like

Hi, Without knowing much about the inefficiencies of coding in Arduino I can understand this. I found Arduino slow to compile and having moved to VS code I find it much easier to use and understand how the libraries and drivers are linked. I have no problem using Arduino IDE for the Uno but it just didn’t seem up to task for STM32 controllers.

The real reason though I started this topic was to discuss having more availability of drivers like Adafruit and Arduino have to use with Daisy,