DacChannel Class
Namespace: GHIElectronics.TinyCLR.Devices.Dac · Assembly: GHIElectronics.TinyCLR.Devices.Dac
A single DAC channel opened from a DacController. Call WriteValue(int) for raw codes or WriteValue(double) for a 0.0–1.0 ratio of the output range.
public class DacChannel : IDisposable
Properties
ChannelNumber
public int ChannelNumber { get; }
Controller-relative channel index this object represents.
Controller
public DacController Controller { get; }
The DacController that owns this channel.
LastWrittenValue
public int LastWrittenValue { get; set; }
The most recent raw value written through WriteValue(int).
Methods
Dispose()
public void Dispose()
Releases the channel so another caller can open it.
WriteValue(int value)
public void WriteValue(int value)
Drives the channel to a raw output code.
| Parameter | Type | Description |
|---|---|---|
value | int | Code in [DacController.MinValue, DacController.MaxValue]. |
WriteValue(double ratio)
public void WriteValue(double ratio)
Drives the channel using a 0.0..1.0 fraction of the full output range.
| Parameter | Type | Description |
|---|---|---|
ratio | double | Normalized output level; 0.0 maps to DacController.MinValue and 1.0 to DacController.MaxValue. |