/*
19/08/21
Much smoother with banner out of setup
SPI & Wire includes seem not to matter included in libs?
*/
#include <Adafruit_GPS.h>
//#include <SPI.h> // No difference in or out
//#include <Wire.h> // I2C needs it? no difference in or out
//#include <Adafruit_GFX.h> // Not be needed for basic txt
#include <Adafruit_SSD1306.h>
#define SCREEN_WIDTH 128 // OLED display width, in pixels
#define SCREEN_HEIGHT 64 // OLED display height, in pixels
#define OLED_CLK 8
#define OLED_MOSI 9
#define OLED_RESET 10
#define OLED_DC 11
#define OLED_CS 12
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, OLED_MOSI, OLED_CLK, OLED_DC, OLED_RESET, OLED_CS);
Adafruit_GPS GPS(&Wire);
// Dummy vars for loop
float v = 1708; // Version
float t = 15.27; // Temp
float h = 87.81; // Humidity
int tp = 0; // Total Posts
void setup() {
GPS.begin(0x10);
Serial.begin(115200);
Serial.println("GPS data disp on SSD1306");
display.begin(SSD1306_SWITCHCAPVCC);
display.display();
delay(1000);
display.clearDisplay();
display.display();
display.setTextSize(1);
display.setTextColor(SSD1306_WHITE);
}
void loop() {
char g_data = GPS.read();
String gpsString[5] = String('g_data');
Serial.print(F(g_data));
unsigned int SLen = gpsString[5].length();
display.setCursor(0, 34), display.print(F("GPS : ")), display.print(g_data);
display.setCursor(0, 46), display.print(F("SLen: ")), display.print(SLen);
display.display();
// delay(1000);
display.clearDisplay();
display.display();
}
Code works without SPI.h and Wire.h included, is this because the GPS and SSD device libs have the required components already ?