Skip to content

Instantly share code, notes, and snippets.

@djuretic
Created Jul 27, 2014
Embed
What would you like to do?
Microview voltage
#include <MicroView.h>
void setup(){
uView.begin();
uView.clear(PAGE);
pinMode(A0, INPUT);
digitalWrite(A0, HIGH);
}
void loop(){
uView.clear(PAGE);
int result = analogRead(A0);
uView.setCursor(0,0);
uView.print("A0");
uView.setCursor(20, 0);
uView.print(result);
float voltage = result * (5.0 / 1023.0);
uView.setCursor(0, 10);
uView.print("V");
uView.setCursor(20, 10);
uView.print(voltage);
uView.display();
delay(200);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment