Conflict between TinyGPS and Adafruit_CharacterOLED libraries?
Moderators: adafruit_support_bill, adafruit

Conflict between TinyGPS and Adafruit_CharacterOLED libraries?

by ted0h on Fri May 31, 2013 7:13 pm

Hi, hoping someone can help me with a problem I'm having. I have an Arduino sketch currently running on a Pro Mini 5V, 16 MHz, which takes GPS input and outputs it to an LCD. I'm upgrading the GPS unit to an Adafruit ultimate GPS breakout, and the display to an OLED. The new GPS board seems to be working with the TinyGPS methods I'm already using, but when I tried to incorporate the Adafruit_CharacterOLED library, the sketch stopped working.

Because I initially wasn't sure if the problem was the GPS or the display, I went back to the TinyGPS "test_with_GPS_device" example sketch. Running the sketch with the Adafruit GPS gave the expected results, when I opened the serial monitor it immediately displayed the header info and then position updates every second.

Then, I added the following two lines to the "test_with_GPS_device" sketch:

Code: Select all | TOGGLE FULL SIZE
#include <Adafruit_CharacterOLED.h>
Adafruit_CharacterOLED lcd(12, 8, 11, 4, 5, 6, 7);


Now, when I open the serial monitor, it's blank for about 5 seconds, then it displays the header info and position information.

Finally, I added the following lines in the setup block of the sketch:

Code: Select all | TOGGLE FULL SIZE
lcd.begin(16, 2);
lcd.print("Acquiring...");


Now, serial monitor is blank for 15-30 seconds, then the header information pops up, followed by position info every second.

I do get a "Large amount of SRAM used" warning with the original and modified sketches.

When I use the LiquidCrystal library and initialization in the example sketch:

Code: Select all | TOGGLE FULL SIZE
#include <LiquidCrystal.h>
LiquidCrystal lcd(12, 11, 4, 5, 6, 7);


the serial monitor information is displayed immediately.

So, it seems the GPS will work fine with TinyGPS, but for whatever reason, the OLED library isn't fully compatible. Any suggestions on this one? Thanks for your help.

Ted
ted0h
 
Posts: 6
Joined: Sun Apr 21, 2013 12:35 pm

Re: Conflict between TinyGPS and Adafruit_CharacterOLED libraries?

by adafruit_support_bill on Sat Jun 01, 2013 4:36 am

The Character OLED library is about 90% the same as the Liquid Crystal library. It is slightly larger due to the additional handshaking required by the OLED display. The SRAM warning suggests that you may be close to running out (there is only 2K of SRAM on an Uno). The slightly larger Character OLED library may be just enough to push it over the edge.
User avatar
adafruit_support_bill
 
Posts: 29778
Joined: Sat Feb 07, 2009 9:11 am