Ejemplo n.º 1
0
        private void OnNewValueEvent(object sender, ArduinoSerialCom.ValueChangedEventArgs valueChangedEventArgs)
        {
            TypeStaticValue value = _serial.getValue(valueChangedEventArgs.Index);

            if (valueChangedEventArgs.Index == _tempIndex && value.getType() == TypeStaticValue.StaticType.INT)
            {
                _lastTemp = (double)value.getIntValue() / 100;
            }
            else if (valueChangedEventArgs.Index == _lightIndex && value.getType() == TypeStaticValue.StaticType.INT)
            {
                _lastLight = value.getIntValue();
            }
            else if (valueChangedEventArgs.Index == _windDirectionIndex && value.getType() == TypeStaticValue.StaticType.INT)
            {
                _lastWindDirection = value.getIntValue();
            }
            PrintWeatherMessage();
        }
Ejemplo n.º 2
0
 private void OnNewValueEvent(object sender, ArduinoSerialCom.ValueChangedEventArgs valueChangedEventArgs)
 {
     Console.WriteLine("New value in index:" + valueChangedEventArgs.Index);
     Console.WriteLine("Value:" + serial.getValue(valueChangedEventArgs.Index).ToString());
 }