Exemplo n.º 1
0
 private void PerformContinuousReads()
 {
     while (IsRunning)
     {
         try
         {
             Thread.Sleep(ReadInterval);
             var sensorData = new SensorDataReadEventArgs(temperatureCelsius: 1, humidityPercentage: 1);
             OnMeasure?.Invoke(this, sensorData);
         }
         catch
         {
             // swallow
         }
     }
 }
Exemplo n.º 2
0
 private void TemperatureSensor_OnDataAvailable(object sender, TemperatureSensorAM2302.AM2302DataReadEventArgs e)
 {
     OnMeasure?.Invoke(this, new SensorDataReadEventArgs(e.TemperatureCelsius, e.HumidityPercentage));
 }