Exemplo n.º 1
0
        private int _GetOutputData()
        {
            Initialize();
            int result = 0;

            if (device != null)
            {
                result = device.Read();
            }
            device.PowerDown();
            return(result);
        }
Exemplo n.º 2
0
        private static void Loop(HX711 scale)
        {
            var result = scale.GetUnits(10);

            //Blink the on board led according to the weight
            for (int i = 0; i < Math.Abs(result / 10); i++)
            {
                Led.Write(true);
                Thread.Sleep(100);
                Led.Write(false);
                Thread.Sleep(100);
            }

            scale.PowerDown(); // put the ADC in sleep mode for two seconds
            Thread.Sleep(2000);
            scale.PowerUp();
        }