Beispiel #1
0
            public static void ReloadValues()
            {
                var values = I2C.ReadMultipleBytes(I2C.Registers.Infrared.Proximity.BackLeft.Low,
                                                   I2C.Registers.Infrared.SensorCount * 2);

                //anyone else hungry for spaghetti?
                BackLeft   = (values[1] << 8) | values[0];
                Left       = (values[3] << 8) | values[2];
                FrontLeft  = (values[5] << 8) | values[4];
                Front      = (values[7] << 8) | values[6];
                FrontRight = (values[9] << 8) | values[8];
                Right      = (values[11] << 8) | values[10];
                BackRight  = (values[13] << 8) | values[12];
                Back       = (values[15] << 8) | values[14];

                GroundLeft       = (values[17] << 8) | values[16];
                GroundFrontLeft  = (values[19] << 8) | values[18];
                GroundRight      = (values[23] << 8) | values[22];
                GroundFrontRight = (values[21] << 8) | values[20];
            }