#include "U8glib.h"
#define PotPin A3
U8GLIB_SSD1306_128X64 u8g(U8G_I2C_OPT_DEV_0 | U8G_I2C_OPT_NO_ACK | U8G_I2C_OPT_FAST); // Fast I2C / TWI
int FuelMeter = 0;
int Fuel = 54;
int potVal = 0;
void setup() {
u8g.setFont(u8g_font_tpssb);
u8g.setColorIndex(1);
}
void loop() {
potVal = analogRead(A3);
Fuel = map(potVal, 0, 1023, 1, 50);
FuelMeter = map(potVal, 0, 1023, 50, 1);
u8g.firstPage();
do {
u8g.drawFrame(100, 0, 20, 50);
u8g.drawBox(100, (FuelMeter - 1), 20, Fuel);
u8g.drawStr(98, 62, "Fuel");
} while ( u8g.nextPage() );
}