コード例 #1
0
 public Sound(ADS1015 adc, ADS1015.Channel channel, ADS1015.Gain gain, UnitsNet.ElectricPotential volts)
 {
     this.adc = adc;
     this.channel = channel;
     this.gain = gain;
     this.volts = volts;
 }
コード例 #2
0
        public SensorSound(ADS1015 adc, int SampleRateMilliseconds, string name)
            : base("sound", "p", SensorMakerDen.ValuesPerSample.One, SampleRateMilliseconds, name)
        {
            sound = new Sound(adc, ADS1015.Channel.A2, ADS1015.Gain.Volt5, ElectricPotential.From(5, ElectricPotentialUnit.Volt));

            StartMeasuring();
        }
コード例 #3
0
        public SensorLight(ADS1015 adc, int SampleRateMilliseconds, string name)
            : base("light", "p", SensorMakerDen.ValuesPerSample.One, SampleRateMilliseconds, name)
        {
            ldr = new LDR(adc, ADS1015.Channel.A3, ADS1015.Gain.Volt5, ElectricPotential.From(5, ElectricPotentialUnit.Volt));

            StartMeasuring();
        }
コード例 #4
0
        public SensorTemp(ADS1015 adc, int SampleRateMilliseconds, string name)
            : base("temp", "c", SensorMakerDen.ValuesPerSample.One, SampleRateMilliseconds, name)
        {
            temp = new Mcp9700A(adc, ADS1015.Channel.A4, ADS1015.Gain.Volt5);

            StartMeasuring();
        }
コード例 #5
0
 public Mcp970X(ADS1015 adc, ADS1015.Channel channel, ADS1015.Gain gain, int zeroDegreeOffset, double millivoltsPerDegree, int CalibrationOffset)
 {
     this.adc = adc;
     this.channel = channel;
     this.gain = gain;
     this.zeroDegreeOffset = zeroDegreeOffset;
     this.millivoltsPerDegree = millivoltsPerDegree;
     this.CalibrationOffset = CalibrationOffset;
 }
コード例 #6
0
        public ExplorerHat(bool hat)
        {
            if (hat) {
                adc = new ADS1015();

                explorerLEDs = new Led_Explorer[] {
                    new Led_Explorer(ExplorerPins.Led.Three, "led3"),
                    new Led_Explorer(ExplorerPins.Led.Four, "led4")
                };

                foreach (var led in explorerLEDs) {
                    led.Off();
                }
            }
        }
コード例 #7
0
 public Mcp9700A(ADS1015 adc, ADS1015.Channel channel, ADS1015.Gain gain)
     : base(adc, channel, gain, 530, 11, -2)
 {
 }
コード例 #8
0
 public Mcp9701AE(ADS1015 adc, ADS1015.Channel channel, ADS1015.Gain gain)
     : base(adc, channel, gain, 400, 20.5, -6)
 {
 }