Changes between Version 7 and Version 8 of Docs/Prog/Manual/ApplicationLibraries/lib825ev/DAC
- Timestamp:
- 09/20/18 12:39:22 (6 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
Docs/Prog/Manual/ApplicationLibraries/lib825ev/DAC
v7 v8 27 27 { 28 28 // The DAC output is controlled by a 16 bit register so we multiple the maximum 16-bit value 0xFFFF times output percentage/100 desired. 29 // For example maxi um 10 V would be 0xFFFF * (10.0 / 10.0) = 0xFFFF * 1.0 = 0xFFFF, 5V would be 0xFFFF * (5.0 / 10.0) = 0xFFFF * 0.5 = 0x800029 // 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)); 31 31 SetDACReg(nDAC, dacAD5422Data, value, WAIT_ACK); 32 32 } 33 33 34 35 36 34 }}}