示例#1
0
        public bool IsLow()
        {
            float vbat;

            vbat = _talon.GetBusVoltage();

            if (vbat > 10.50)
            {
                _dnCnt = 0;
                if (_upCnt < 100)
                {
                    ++_upCnt;
                }
            }
            else if (vbat < 10.00)
            {
                _upCnt = 0;
                if (_dnCnt < 100)
                {
                    ++_dnCnt;
                }
            }

            if (_dnCnt > 50)
            {
                batIsLow = true;
            }
            else if (_upCnt > 50)
            {
                batIsLow = false;
            }
            else
            {
                //don't change filter ouput
            }
            return(batIsLow);
        }