Conflicting libraries

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
User avatar
nebelr
 
Posts: 3
Joined: Mon Jun 29, 2015 11:19 am

Conflicting libraries

Post by nebelr »

I have been working on a project where I am using the below components to make a ambient condition sensor that can log data to a server.
- Pro Trinket 3.3V
- ESP8266 (wifi module)
- DHT22 (temp sensor)
- MPL3115A2 (Barometric Pressure Sensor)
- 128x64 OLED using I2c

Below are the libraries I have defined.
For some reason when i have them all in the sketch, the program freezes while trying to run.
Is there something simple I am missing or will you need a more detailed description of my project.

Code: Select all

#include "DHT.h"
#include <SoftwareSerial.h>
#include <Wire.h>
#include <Adafruit_MPL3115A2.h>
#include <SPI.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>

User avatar
adafruit_support_bill
 
Posts: 88088
Joined: Sat Feb 07, 2009 10:11 am

Re: Conflicting libraries

Post by adafruit_support_bill »

That sounds like a memory problem: https://learn.adafruit.com/memories-of- ... o-memories
Specifically, running out of SRAM. The OLED display is taking up half of what is available. And SoftwareSerial has some good-sized buffers as well. The link above has some tips on optimizing. But you may need to move to a bigger processor.

User avatar
nebelr
 
Posts: 3
Joined: Mon Jun 29, 2015 11:19 am

Re: Conflicting libraries

Post by nebelr »

I was able to use the freeRam function to see that before adding the OLED i had 1102 free and after adding the libraries and starting the display i had -32070.

I am tying to keep my project to a small form factor and a low price point as I will be making multiple, what would be a good next step?

Switch boards?
Use an LCD display?
Ditch the display completely?
Use two Pro Trinkets?

Any and all suggestions are welcome.

User avatar
adafruit_support_bill
 
Posts: 88088
Joined: Sat Feb 07, 2009 10:11 am

Re: Conflicting libraries

Post by adafruit_support_bill »

The biggest offender there is the OLED display. The monochrome OLEDs need a frame-buffer in SRAM. The color OLED and TFT displays do not need frame-buffers, so they are much easier on the memory requirements. They will be a bit slower and larger. But probably less bulk than adding another processor.

User avatar
Franklin97355
 
Posts: 23910
Joined: Mon Apr 21, 2008 2:33 pm

Re: Conflicting libraries

Post by Franklin97355 »

You can also customize the libraries to remove the parts you don't need. This may give you a bit more room but it is not for beginners on a schedule as it is mostly trial and error programming.

User avatar
nebelr
 
Posts: 3
Joined: Mon Jun 29, 2015 11:19 am

Re: Conflicting libraries

Post by nebelr »

I was able to slice and dice the library to solve the SRAM issue.
Thank You for your comments and support.

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino”