MCP4725

Dependents:   Cube_Mini_Template

Revision:
8:28af46e7207f
Parent:
7:5cfc0f623d5b
--- a/mcp4725.cpp	Fri May 08 17:01:46 2020 +0000
+++ b/mcp4725.cpp	Fri May 29 11:34:05 2020 +0000
@@ -55,7 +55,7 @@
 {
 
     
-    int dac_value_2 = (int) (0xFFF * (dac_value/5.0f) );
+    int dac_value_2 = (int) (0xFFF * (dac_value/5.029f) ); // Divide dac_value by the reference voltage // Optimally the reference voltage is exactly 5.0V but this is not the case here. // The Ref voltage is 5.029V
     char data[3]={0};
     int write_command;