示例#1
0
 protected AnaloguePortDeviceBase(AnaloguePort port, int deviceAddress, II2CDeviceFactory i2CDeviceFactory)
 {
     DisplayProperties = new List <DisplayPropertyBase>();
     DeviceAddress     = deviceAddress;
     I2CDeviceFactory  = i2CDeviceFactory;
     Port = port;
 }
示例#2
0
        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);
        }
示例#3
0
        public Sh1106(int deviceAddress, II2CDeviceFactory i2CDeviceFactory)
        {
            if (i2CDeviceFactory == null)
            {
                throw new ArgumentNullException(nameof(i2CDeviceFactory));
            }
            var bus = i2CDeviceFactory.GetOrCreateI2CDevice(deviceAddress);

            _serialInterface = new I2cInterface(bus);
        }
示例#4
0
 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)
 {
 }