Skip to content

Commit

Permalink
Fix calculation
Browse files Browse the repository at this point in the history
Datasheet says: “The ADC converts an analog input voltage to a 10-bit
digital value through successive approximation. The minimum value
represents GND and the maximum value represents the voltage on the AREF
pin minus 1 LSB.”
  • Loading branch information
Yveaux committed Oct 2, 2017
1 parent 29261f9 commit 2b2362b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Vcc.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ float Vcc::Read_Volts(void)
// Result is now stored in ADC.

// Calculate Vcc (in V)
float vcc = 1.1*1023.0 / ADC;
float vcc = 1.1*1024.0 / ADC;

// Apply compensation
vcc *= m_correction;
Expand Down

0 comments on commit 2b2362b

Please sign in to comment.