Edit...
hi everyone, sorry for my language, I'm using google translator.
I need to use an ssd1306 oled display with the SerialTransfer do powerbroker2 library, by compiling the oled_i2c examples of 2 different libraries the code works, but if I insert serialtranfer, the code crashes the moment I make the serialtransfer instance. . I attach 2 examples of oled i2c adafruit and rinky dink..thanks
rinky dink code
#include <OLED_I2C.h>
#include <SerialTransfer.h>
#include <ST_CRC.h>
OLED myOLED(SDA, SCL); // Remember to add the RESET pin if your display requires it...
//********************************************************************
SerialTransfer myTransfer; ///// with this code not work , if comment this line code work
//********************************************************************
extern uint8_t SmallFont[];
void setup()
{
if (!myOLED.begin(SSD1306_128X64)) {
for (;;); // Don't proceed, loop forever
}
myOLED.setFont(SmallFont);
}
void loop()
{
myOLED.clrScr();
myOLED.print("Upper case:", LEFT, 0);
myOLED.print("ABCDEFGHIJKLM", CENTER, 16);
myOLED.print("NOPQRSTUVWXYZ", CENTER, 24);
myOLED.update();
delay (1000);
myOLED.clrScr();
myOLED.print("Numbers:", LEFT, 0);
myOLED.print("0123456789", CENTER, 16);
myOLED.update();
delay (1000);
myOLED.clrScr();
myOLED.print("Special:", LEFT, 0);
myOLED.print("!\"#$%&'()*+,-.", CENTER, 16);
myOLED.print("/:;<=>?@[\\]^_`", CENTER, 24);
myOLED.print("{|}~", CENTER, 32);
myOLED.update();
delay (1000);
}
adafruit code
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#include <SerialTransfer.h>
#include <ST_CRC.h>
#define SCREEN_WIDTH 128
#define SCREEN_HEIGHT 64
Adafruit_SSD1306 display(SCREEN_WIDTH, SCREEN_HEIGHT, &Wire);
//********************************************************************
SerialTransfer myTransfer; ///// with this code not work , if comment this line code work
//********************************************************************
void setup() {
Serial.begin(9600);
// SSD1306_SWITCHCAPVCC = generate display voltage from 3.3V internally
if (!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) { // Address 0x3D for 128x64
Serial.println(F("SSD1306 allocation failed"));
for (;;); // Don't proceed, loop forever
}
// Show initial display buffer contents on the screen --
// the library initializes this with an Adafruit splash screen.
display.display();
// Clear the buffer
display.clearDisplay();
}
void loop() {
display.clearDisplay();
for (int16_t i = 0; i < display.height() / 2 - 2; i += 2) {
display.drawRoundRect(i, i, display.width() - 2 * i, display.height() - 2 * i,
display.height() / 4, SSD1306_WHITE);
display.display();
delay(2);
}
delay(1000);
for (int16_t i = 0; i < display.height() / 2; i += 3) {
// The INVERSE color is used so rectangles alternate white/black
display.fillRect(i, i, display.width() - i * 2, display.height() - i * 2, SSD1306_INVERSE);
display.display(); // Update screen with each newly-drawn rectangle
delay(10);
}
delay(1000);
}