ArduinoOnPc icon indicating copy to clipboard operation
ArduinoOnPc copied to clipboard

adding a file API

Open marcmerlin opened this issue 5 years ago • 3 comments
trafficstars

Some code that does graphics loads graphics from "disk" before displaying it on neopixels/RGBPanels/TFT. You are probably familiar with the "diskless" method that adafruit uses in https://github.com/ChrisMicro/ArduinoOnPc/blob/master/examples/Adafruit_pictureDragon/Adafruit_pictureDragon.h When doing animated gifs, we can do better. On teensy, people read from sdcard On ESP8266, ESP32 the more common way to do this is FatFS (which now replaces SPIFFS) from flash. https://github.com/marcmerlin/AnimatedGIFs
supports all 3 methods.

If you want to see an example of API use, see: https://github.com/marcmerlin/AnimatedGIFs/blob/master/FilenameFunctions.cpp I think it would be best to emulate the ESP32 File API (the ESP8266 is a bit weird), so you can ignore the #ifdef FSOSD (filesystem object SDcard) an any ifdef ESP8266.

Full API test: https://github.com/espressif/arduino-esp32/blob/master/libraries/FFat/examples/FFat_Test/FFat_Test.ino

And if you're wondering, yes, it's nice to emulate that code on PC, but it's even better to be able to run arduino code on Raspeberry Pi (which I can now do thanks to your code) on X11 using your driver (even if it's a bit slow as per https://github.com/ChrisMicro/ArduinoOnPc/issues/6 ) via my glue driver https://github.com/marcmerlin/FastLED_TFTWrapper_GFX or my new RGBPanel glue driver, which I just wrote: https://github.com/marcmerlin/FastLED_RPIRGBPanel_GFX

marcmerlin avatar Jan 01 '20 10:01 marcmerlin

I just merged my rPi RGBPanel work in case you are curious: https://github.com/marcmerlin/ArduinoOnPc-FastLED-GFX-LEDMatrix/pull/1/

marcmerlin avatar Jan 01 '20 12:01 marcmerlin

So, I'm now stuck with arduino code that does need access to a file API. Is that something that you might have time/resources to add, or not so much?

marcmerlin avatar Jan 08 '20 05:01 marcmerlin

Having a file API would be a good idea. But at the moment I have a lot of other projects.

ChrisMicro avatar Jan 10 '20 06:01 ChrisMicro