Tiny4kOLED
Tiny4kOLED copied to clipboard
How to center my bitmap with 128x64 oled screen?
Hey,
I'm trying your amazing lib to my oled 128x64 screen and my ATTINY85 but I have a little problem with battery animation, take a look:
How can I center my bitmap? I tried to increase the Y but it not work. It seems I have a problem with a double buffer...
#include <Tiny4kOLED.h>
#include "SolomonSystech.h"
const uint8_t* batteryImages[] = {battery1, battery2, battery3, batteryfull};
int index = 0;
void setup() {
Serial.begin(9600);
oled.begin(128, 64, sizeof(tiny4koled_init_128x64r), tiny4koled_init_128x64r);
oled.clear();
oled.on();
oled.switchRenderFrame();
}
void loop() {
index = (index + 1) % 4;
oled.bitmap(32, 2, 95, 5, batteryImages[index]);
delay(500);
}
Thanks for your help
Don't call oled.switchRenderFrame(); That's for choosing which half of the memory to show on 128x32 displays. On a 128x64 display, you typically want to display all the memory all the time.