#include <TinyWireM.h>
#include <Tiny4kOLED.h>
#define buttonPin PB3
void prepareDisplay() {
oled.clear();
oled.begin();
oled.setFont(FONT6X8);
}
void setup() {
oled.begin(128, 64, sizeof(tiny4koled_init_128x64br), tiny4koled_init_128x64br);
oled.clear();
oled.on();
prepareDisplay();
oled.setFont(FONT8X16);
pinMode(buttonPin, INPUT_PULLUP);
}
void loop() {
int buttonState = digitalRead(buttonPin);
if (buttonState == LOW) {
oled.setCursor(5, 1);
oled.print(" LOW");
} else {
oled.setCursor(5, 1);
oled.print("HIGH");
}
}