Ejemplo n.º 1
0
		public SenseHat(
			MainI2CDevice mainI2CDevice,
			ImuSensor imuSensor,
			PressureSensor pressureSensor,
			HumiditySensor humiditySensor)
		{
			_mainI2CDevice = mainI2CDevice;

			Display = new SenseHatDisplay(_mainI2CDevice);
			Joystick = new SenseHatJoystick(_mainI2CDevice);
			Sensors = new SenseHatSensors(imuSensor, pressureSensor, humiditySensor);
		}
Ejemplo n.º 2
0
		public SenseHatSensors(
			ImuSensor imuSensor,
			PressureSensor pressureSensor,
			HumiditySensor humiditySensor)
		{
			ImuSensor = imuSensor;
			PressureSensor = pressureSensor;
			HumiditySensor = humiditySensor;

			ImuSensor.OnReadingsChanged += (s, e) => ImuReadingsChanged();
			PressureSensor.OnReadingsChanged += (s, e) => PressureReadingsChanged();
			HumiditySensor.OnReadingsChanged += (s, e) => HumidityReadingsChanged();
		}