How do you code multiple sensors to display on the qwiic micro oled?

I’m attempting to creating a multisensor system with a qwiic redboard. I’m using ENS160, BME688 and Soil Moisture sensors. When I try to figure out the coding to display on the micro oled it says that the sketch is too big for the board. Is there a way to shrink the sketch? Attached are the codes for just reading out the readings in Arduino IDE serial monitor and then my attempt to have it read to the oled.

Untitled document.txt (3.5 KB)

Untitled document.pdf (67.7 KB)

You can try a few things

  1. Our OLED library is pretty big because it covers a bunch of products; you can try switching to something like SSD1306Ascii (text-only) to use much less memory

  2. Your code has a few string classes, you can replace some with serial.print() to use less memory as well (string use dynamic memory, this can help with heap fragmentation)

  3. You can try an alternate library for the bme…again our is pretty big

  4. Remove as many strings/serial.prints as possible, minimize how many there are

  5. Use an MCU with more memory (esp32, etc)

:slight_smile: Good luck!