AD5328 - Digital to Analog Convertor

July 29, 2021 ยท View on GitHub

AD5328 is an Digital-to-Analog converter (DAC) with 12 bits of resolution.

Documentation

Product information and documentation can he found here

Usage

using System.Device.Spi;
using System.Threading;
using Iot.Device.DAC;
using UnitsNet;

var spisettings = new SpiConnectionSettings(0, 1)
{
    Mode = SpiMode.Mode2
};

var spidev = SpiDevice.Create(spisettings);
var dac = new AD5328(spidev, ElectricPotential.FromVolts(2.5), ElectricPotential.FromVolts(2.5));
Thread.Sleep(1000);
dac.SetVoltage(0, ElectricPotential.FromVolts(1));