/*      ATTINY85                            Out/10/2022          Esdras Silva
    Programa Display e Temperatura NTC100K a 25C 
     oled.setFont(FONT6X8);
     oled.setFontX2(FONT6X8);
     oled.setFont(FONT8X16);
     oled.setFont(FONT8X16);
 */
#include <TinyWireM.h>
#include <Tiny4kOLED.h>

#define buttonPin PB3 
unsigned int rpm;

const float BETA = 3950; // should match the Beta Coefficient of the thermistor

void prepareDisplay() {
  oled.clear();
  oled.begin();
  oled.setFont(FONT6X8);
  oled.setCursor(5,1);
  oled.print(F("High:"));
  oled.setCursor(5,3);
  oled.print(F("Low:")); 
}

void setup() {
  oled.begin(128, 64, sizeof(tiny4koled_init_128x64br), tiny4koled_init_128x64br);
 //oled.setRotation(0);
 // Two fonts are supplied with this library, FONT8X16 and FONT6X8
 // To clear all the memory
    oled.clear();
    oled.on();
    prepareDisplay();
    oled.setFont(FONT8X16); 
    pinMode(buttonPin, INPUT_PULLUP); // Configura PB3 como entrada con pull-up interno 
}

void loop() {
  
  static long startTime = 0;
  long currentTime;
  
  int analogValue = analogRead(PB3);
  int buttonState = digitalRead(buttonPin);

  if(buttonState == LOW){
    oled.setCursor(0, 5);
    oled.print("Button: LOW ");
  } else {
    oled.setCursor(0, 5);
    oled.print("Button: HIGH"); 
  }
  }
ATTINY8520PU