value Property

Top  Previous  Next

Gets or sets the analog value to be output.



Property Value

The value to be output on the analog output pin.


Each increment in the value property is equal to the voltage reference divided by max. Given a desired voltage, the value to set can be computed as follows:


Cell.DAC.value = Vtarget * Cell.DAC.max / Vref;


where Vtarget has been assigned the desired output voltage and Vref has been assigned the actual reference voltage. The reference voltage is determined by the reference property.


Cell.DAC.reference = Cell.DAC.ref1V;// use 1.0V internal reference
Cell.DAC.value = 0.65 * Cell.DAC.max;// set output to 0.65V

See Also

max Constant, reference Property