Inheritance: IDisposable
Esempio n. 1
0
        private static MainI2CDevice CreateDisplayJoystickI2CDevice()
        {
            var device = Pi.I2C.AddDevice(0x46);

            MainI2CDevice main = new MainI2CDevice(device);

            Console.WriteLine("I2C created");
            return(main);
        }
Esempio n. 2
0
        private static async Task <ISenseHat> GetSenseHatTask()
        {
            MainI2CDevice mainI2CDevice = await CreateDisplayJoystickI2CDevice().ConfigureAwait(false);

            ImuSensor imuSensor = await CreateImuSensor().ConfigureAwait(false);

            PressureSensor pressureSensor = await CreatePressureSensor().ConfigureAwait(false);

            HumiditySensor humiditySensor = await CreateHumiditySensor().ConfigureAwait(false);

            return(new SenseHat(mainI2CDevice, imuSensor, pressureSensor, humiditySensor));
        }
Esempio n. 3
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);
        }
        private static ISenseHat CreateSenseHat()
        {
            MainI2CDevice mainI2CDevice = CreateDisplayJoystickI2CDevice();

            ImuSensor imuSensor = CreateImuSensor();

            PressureSensor pressureSensor = CreatePressureSensor();

            HumiditySensor humiditySensor = CreateHumiditySensor();

            return(new SenseHat(mainI2CDevice, imuSensor, pressureSensor, humiditySensor));
        }
Esempio n. 5
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);
		}
        public SenseHatDisplay(MainI2CDevice mainI2CDevice)
        {
            _mainI2CDevice = mainI2CDevice;

            Screen = new Image(8, 8);

            RedGamma   = 1.8;
            GreenGamma = 2.0;
            BlueGamma  = 1.8;

            Reset();

            UpdateDirectionParameters();
        }
Esempio n. 7
0
        public SenseHatDisplay(MainI2CDevice mainI2CDevice)
        {
            _mainI2CDevice = mainI2CDevice;

            Screen = new Color[8, 8];

            RedGamma   = 1.8;
            GreenGamma = 2.0;
            BlueGamma  = 1.8;

            //RedGamma = 2.8;
            //GreenGamma = 2.8;
            //BlueGamma = 2.8;

            Reset();

            UpdateDirectionParameters();
        }
Esempio n. 8
0
		public SenseHatDisplay(MainI2CDevice mainI2CDevice)
		{
			_mainI2CDevice = mainI2CDevice;

			Screen = new Color[8, 8];

			RedGamma = 1.8;
			GreenGamma = 2.0;
			BlueGamma = 1.8;

			//RedGamma = 2.8;
			//GreenGamma = 2.8;
			//BlueGamma = 2.8;

			Reset();

			UpdateDirectionParameters();
		}
Esempio n. 9
0
        private static ISenseHat CreateSenseHat()
        {
            MainI2CDevice mainI2CDevice = new MainI2CDevice(DeviceAddress);

            ImuSensor imuSensor = new LSM9DS1ImuSensor(
                LSM9DS1Defines.ADDRESS0,
                LSM9DS1Defines.MAG_ADDRESS0,
                new LSM9DS1Config(),
                new SensorFusionRTQF());

            imuSensor.Init();

            PressureSensor pressureSensor = new LPS25HPressureSensor(LPS25HDefines.ADDRESS0);

            pressureSensor.Init();

            HumiditySensor humiditySensor = new HTS221HumiditySensor(HTS221Defines.ADDRESS);

            humiditySensor.Init();

            return(new SenseHat(mainI2CDevice, imuSensor, pressureSensor, humiditySensor));
        }
 public SenseHatJoystick(MainI2CDevice mainI2CDevice)
 {
     _mainI2CDevice = mainI2CDevice;
 }
		public SenseHatJoystick(MainI2CDevice mainI2CDevice)
		{
			_mainI2CDevice = mainI2CDevice;
		}