Created
January 13, 2024 02:32
-
-
Save dsvakola/2e644c2f30242ce6b57c4d481fb79a5c to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Understanding the use of Serial Monitor & Serial Plotter to measure actual voltage using Arduino */ | |
int potpin = A0; | |
float pot_voltage = 0; | |
float actualvoltage; | |
void setup() | |
{ | |
Serial.begin(9600); | |
} | |
void loop() | |
{ | |
pot_voltage = analogRead(potpin); | |
actualvoltage = ((pot_voltage)*(4.9/1023.0)); | |
Serial.print("Pot Voltage: "); | |
Serial.print(actualvoltage); | |
Serial.println("V"); | |
delay(1000); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment