protected AnaloguePortDeviceBase(AnaloguePort port, int deviceAddress, II2CDeviceFactory i2CDeviceFactory) { DisplayProperties = new List <DisplayPropertyBase>(); DeviceAddress = deviceAddress; I2CDeviceFactory = i2CDeviceFactory; Port = port; }
public LightSensor(AnaloguePort port, int deviceAddress, II2CDeviceFactory i2CDeviceFactory, bool normalizeValue = true) : base(port, deviceAddress, i2CDeviceFactory) { _normalizeValue = normalizeValue; var(pin1, _) = Port.ToPinPair(); var bus = I2CDeviceFactory.GetOrCreateI2CDevice(deviceAddress); _adc = new AnalogueDigitalConverter(bus, pin1); AddToDisposables(_adc); }
public Sh1106(int deviceAddress, II2CDeviceFactory i2CDeviceFactory) { if (i2CDeviceFactory == null) { throw new ArgumentNullException(nameof(i2CDeviceFactory)); } var bus = i2CDeviceFactory.GetOrCreateI2CDevice(deviceAddress); _serialInterface = new I2cInterface(bus); }
public Potentiometer(AnaloguePort port, int deviceAddress, II2CDeviceFactory i2CDeviceFactory) : this(port, deviceAddress, i2CDeviceFactory, true) { }
public SoundSensor(AnaloguePort port, int deviceAddress, II2CDeviceFactory i2CDeviceFactory) : this(port, deviceAddress, i2CDeviceFactory, true) { }