Exemplo n.º 1
0
        /// <summary>
        /// Returns a reading of the measured AC current.
        /// </summary>
        /// <returns>AC current reading.</returns>
        public double Read_AC_Current()
        {
            double read        = 0.0;
            double calculation = 0.0;

            for (int i = 0; i < 400; i++)
            {
                read += ain.ReadProportion();
            }

            read       /= 400;
            calculation = 21.2 * read - 13.555;

            return(calculation);
        }
Exemplo n.º 2
0
        private double Read(GTI.AnalogInput input)
        {
            double total = 0;

            for (int i = 0; i < 10; i++)
            {
                total += input.ReadProportion();
            }

            return(total / 10);
        }
Exemplo n.º 3
0
 /// <summary>
 ///  Returns the current position of the potentiometer relative to its maximum: range 0.0 to 1.0
 /// </summary>
 public double ReadPotentiometerPercentage()
 {
     return(input.ReadProportion());
 }
Exemplo n.º 4
0
 /// <summary>
 ///  Returns the current strength of the light relative to its maximum: range 0.0 to 100.0
 /// </summary>
 /// <returns>A percentage between 0 and 100.</returns>
 public double ReadLightSensorPercentage()
 {
     return(input.ReadProportion() * 100);
 }