public LightSensorSampler(GTM.GHIElectronics.LightSensor lightSensor, SamplerBag samplers) { _lightSensor = lightSensor; _lightSensorPercentageSampler = new DoubleSampler(SampleLightSensorPercentage, "light_sensor_percentage"); samplers.Add(_lightSensorPercentageSampler); _lightSensorVoltageSampler = new DoubleSampler(SampleLightSensorVoltage, "light_sensor_voltage"); samplers.Add(_lightSensorVoltageSampler); }
public ButtonSampler(GTM.GHIElectronics.Button button, SamplerBag samplers) { _buttonPressedSampler = new LongSampler(null, "button_pressed"); samplers.Add(_buttonPressedSampler); _buttonReleasedSampler = new LongSampler(null, "button_released"); samplers.Add(_buttonReleasedSampler); button.ButtonPressed += new GTM.GHIElectronics.Button.ButtonEventHandler(button_ButtonPressed); button.ButtonReleased += new GTM.GHIElectronics.Button.ButtonEventHandler(button_ButtonReleased); }
public TemperatureHumiditySampler(Gadgeteer.Modules.Seeed.TemperatureHumidity temperatureHumidity, SamplerBag samplers) { _temperatureHumidity = temperatureHumidity; _temperatureSampler = new DoubleSampler(null, "temperature"); samplers.Add(_temperatureSampler); _humiditySampler = new DoubleSampler(null, "humidity"); samplers.Add(_humiditySampler); _temperatureHumidity.MeasurementComplete += new GTM.Seeed.TemperatureHumidity.MeasurementCompleteEventHandler(_temperatureHumidity_MeasurementComplete); }
public BarometerSampler(GTM.Seeed.Barometer barometer, SamplerBag samplers) { _barometer = barometer; _pressureSampler = new DoubleSampler(null, "barometer_pressure"); samplers.Add(_pressureSampler); _temperatureSampler = new DoubleSampler(null, "barometer_temperature"); samplers.Add(_temperatureSampler); _barometer.MeasurementComplete += new GTM.Seeed.Barometer.MeasurementCompleteEventHandler(_barometer_MeasurementComplete); }
public AnalogSampler(string id, GT.Socket socket_A, SamplerBag samplers) { _id = id; _analogInputPin3 = new GT.Interfaces.AnalogInput(socket_A, GT.Socket.Pin.Three, null); _analogInputPin4 = new GT.Interfaces.AnalogInput(socket_A, GT.Socket.Pin.Four, null); _analogInputPin5 = new GT.Interfaces.AnalogInput(socket_A, GT.Socket.Pin.Five, null); _analogInputPin3.Active = true; _analogInputPin4.Active = true; _analogInputPin5.Active = true; _pin3ProportionSampler = new DoubleSampler(null, _id + "_pin3_proportion"); samplers.Add(_pin3ProportionSampler); _pin4ProportionSampler = new DoubleSampler(null, _id + "_pin4_proportion"); samplers.Add(_pin4ProportionSampler); _pin5ProportionSampler = new DoubleSampler(null, _id + "_pin5_proportion"); samplers.Add(_pin5ProportionSampler); }