Closed tobiasfaust closed 4 years ago
self solved ;)
#include "SSD1306Wire.h"
SSD1306Wire* ssd;
void oled_setup() {
// Read parameters previously from SPIFFS via getParameters procedure
Serial.print("Starting OLED 1306: (");
Serial.print(i2caddress_oled);
Serial.print(", ");Serial.print(pin_sda);
Serial.print(", ");Serial.print(pin_scl);
Serial.println(")");
ssd = new SSD1306Wire(i2caddress_oled, pin_sda, pin_scl);
ssd->init();
ssd->flipScreenVertically();
ssd->setFont(ArialMT_Plain_24);
}
void oled_loop() {
// clear the display
ssd->clear();
// draw the percentage as String
ssd->setTextAlignment(TEXT_ALIGN_CENTER);
ssd->drawString(64, 15, String(hcsr04_level) + "%");
// write the buffer to the display
ssd->display();
}
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
Hi, global declaration of display works with
SSD1306Wire display(0x3c, D3, D5);
But i need the declaration of i2C Pins and i2cAddress inside of setup() because all user-defined parameters has to load from SPIFFS before. Has anyone a hint for me to solve this?