public static void Toggle(this Pin pin)
        {
            PinValue value = pin.Read();

            switch (value)
            {
            case PinValue.Low: value = PinValue.High; break;

            case PinValue.High: value = PinValue.Low; break;
            }

            pin.Write(value);
        }
 public static void Clear(this Pin pin)
 {
     pin.Write(PinValue.Low);
 }
 public static void Set(this Pin pin)
 {
     pin.Write(PinValue.High);
 }