Changes between Version 8 and Version 9 of Docs/Prog/Manual/ApplicationLibraries/lib825ev/DAC
- Timestamp:
- 09/20/18 12:41:14 (6 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Docs/Prog/Manual/ApplicationLibraries/lib825ev/DAC
v8 v9 26 26 void SetDACVoltage(float voltage) 27 27 { 28 // The DAC output is controlled by a 16 bit register so we multipl ethe maximum 16-bit value 0xFFFF times output percentage/100 desired.28 // The DAC output is controlled by a 16 bit register so we multiply the maximum 16-bit value 0xFFFF times output percentage/100 desired. 29 29 // For example maximum 10 V would be 0xFFFF * (10.0 / 10.0) = 0xFFFF * 1.0 = 0xFFFF, 5V would be 0xFFFF * (5.0 / 10.0) = 0xFFFF * 0.5 = 0x8000 30 30 uint16 value = (uint16)(0xFFFF * (voltage / 10.0));