示例#1
0
        public KompassHMC6343(WirinPiWrapper wiringPiLib)
        {
            WiringPiLib = wiringPiLib;
            //Wait at least 500 milli-seconds for device initialization. The HMC6343 is in the default Run Mode
            Thread.Sleep(501);

            fd = wiringPiLib.WiringPiI2CSetup(I2CdeviceID);

            if (fd < 0)
            {
                Console.WriteLine("F****D UP wiringPiI2CSetup");
            }

            Thread.Sleep(5);

            //Set Orientation
            wiringPiLib.WiringPiI2CWrite(I2CdeviceID, ORIENTATION_LEVEL);
        }