How to print SD Card Success / Fail to OLED

To keep your furstration contained, some pointers.

  • You can find @rickkas7's code here
  • You can download the sources and copy/past the contents of the .h and .cpp files in src as new tabs into your project in Web IDE as shown here (add files, name them exactly as the originals, copy/past original code to respective tab).
  • Add the include statements required to talk to the display
  • Add a line of extern Adafruit_SSD1306 display; (or however you've called it in your main .ino)
  • Find the Log.xxx() (or DEBUG_xxx) statements that produce the messages you want to redirect (see bellow)
  • Add the code to print your message to the display

Alternatively you could introduce a new SDCARD_LOGHANDLER_DEBUG_LEVEL which doesn't send to Serial but rather to your display.

Some code lines that wouldn't be hard to locate

Lines to have a closer look at in SdCardLogHandlerRK.cpp

  • Writing to SD Success or Writing to SD Failed could most likely be injected here
  • No Card Found or Card Ejected could most likely be injected here
4 Likes