Пример #1
0
        public DigitalValue DigitalRead(DigitalPins pin)
        {
            var returnValue = ExecuteFunctionReturnValue("digitalread", pin.ToString());

            if (returnValue == SparkClient.ERROR_RETURN_VALUE)
            {
                throw new Exception("Failed to read value.");
            }
            return(returnValue == DIGITAL_HIGH_RETURN_VALUE ? DigitalValue.High : DigitalValue.Low);
        }
Пример #2
0
        public DigitalValue DigitalRead(DigitalPins pin)
        {
            var returnValue = ExecuteFunctionReturnValue("digitalread", pin.ToString());

            if (returnValue == SparkClient.ERROR_RETURN_VALUE)
            {
                throw new Exception("Failed to read value.");
            }
            return returnValue == DIGITAL_HIGH_RETURN_VALUE ? DigitalValue.High : DigitalValue.Low;
        }
Пример #3
0
        public int DigitalWrite(DigitalPins pin, DigitalValue pinValue)
        {
            var returnValue = ExecuteFunctionReturnValue("digitalwrite", pin.ToString(), pinValue.ToString().ToUpper());

            return(returnValue);
        }
Пример #4
0
 public int DigitalWrite(DigitalPins pin, DigitalValue pinValue)
 {
     var returnValue = ExecuteFunctionReturnValue("digitalwrite", pin.ToString(), pinValue.ToString().ToUpper());
     return returnValue;
 }