Problem on SerialTransfer library

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);
}

joeled:
do power_broke library,

LOL

...R

Where did you download "OLED_I2C.h" from? I admit I'm having a hard time finding that lib.

Power_Broker:
Where did you download "OLED_I2C.h" from? I admit I'm having a hard time finding that lib.

Rinky Dink

I have a ssd1306 oled i2c 0x3c address

:slight_smile:

Ok, two questions:

1.) What board are you compiling for?
2.) When you say the code "crashes", what does that mean? The more detail the better.

ok, I try to explain. I compile for the nano board and uno board getting the same crash. In the code posted with the instance of your library the display does not work and the board freezes. If I comment on your library istance the display returns to work and does not freeze the board. I hope that you understand .. thanks

In the adafruit code , the serial monitor write :

if (!display.begin(SSD1306_SWITCHCAPVCC, 0x3C)) { // Address 0x3D for 128x64
   Serial.println(F("SSD1306 allocation failed"));
    for (;;); // Don't proceed, loop forever
  }

I compiled the code for your board and got no errors, nor memory usage warnings. Not sure what to tell you unless you can give me a better idea what exactly is going wrong. It might be due to a memory problem - you can try to use easytransfer.h for a less flexible, but more memory efficient serial library.

The compilation of the code does not signal any error, but the code does not work ... The serial monitor does not respond and the board remains frozen ... If you manage to load the code on the board you realize it. Easytransfer have a problem with nano -> esp 8266 in structure_data type float, your library has no problems with esp8266 and as soon as I need it also esp8266 board ...

Update :
in the arduino mega 2560 board it works perfectly...