#include <U8g2lib.h>

U8G2_SSD1306_128X64_NONAME_F_SW_I2C u8g2(U8G2_R0, /* clock=*/ A5, /* data=*/ A4, /* reset=*/ U8X8_PIN_NONE);

float casey = 123.45; // Your float value
long pageStartTime;


float fourDaysAgoCasey = 5675;
float threeDaysAgoCasey = 5689;
float twoDaysAgoCasey = 5706;
float yesterdayCasey = 5723;

float rightNowCasey = 5740;


void setup(void) {
  u8g2.begin();
}

void loop(void) {



if (millis() - pageStartTime > 1000) {
  
  casey = casey + 1;
  u8g2.firstPage();
  do {
    u8g2.setFont(u8g2_font_ncenB14_tr);  //u8g2_font_6x10_mf for list of last readings.
    u8g2.setCursor(0, 16); // Adjust the X and Y coordinates to position your text
    char caseyStr[10]; // Assuming your float will have up to 6 decimal places
    dtostrf(rightNowCasey, 4, 0, caseyStr); // Convert the float to a string
    u8g2.print("Casey: ");
    u8g2.setFont(u8g2_font_6x10_mf);  //u8g2_font_6x10_mf
    u8g2.print(caseyStr);
    //u8g2.setFont(u8g2_font_5x7_tr);   //u8g2_font_5x7_tr
    u8g2.drawLine(0, 63, 100, 23);  //u8g2.drawLine(x1, y1, x2, y2);

    pageStartTime = millis();
  } while (u8g2.nextPage());
}
  //delay(1000); // Delay for 1 second (adjust as needed)
}