#include <SPI.h>
#include <Wire.h>
#include <Adafruit_GFX.h>
#include <Adafruit_SSD1306.h>
#define OLED_RESET 4
Adafruit_SSD1306 display(OLED_RESET);
int potPin=A0;
int potVal;
float v2;
void setup() {
// put your setup code here, to run once:
display.begin(SSD1306_SWITCHCAPVCC, 0x3C);
display.clearDisplay();
pinMode(potPin, INPUT);
}
void loop() {
// put your main code here, to run repeatedly:
potVal=analogRead(potPin);
v2=(5./1023)*potVal;
display.setTextSize(2);
display.setTextColor(WHITE);
display.setCursor(0,0);
display.println("the potval");
display.display();
display.setTextSize(2);
display.setTextColor(WHITE);
display.setCursor(10,20);
display.println(v2);
display.display();
}