public IoTButton(Connectors gpio)
 {
     pin = new IoTPin(gpio);
     pin.SetDirection(IoTPinDirection.DirectionIn);
     pin.SetActiveType(IoTActiveType.ActiveLow);
     IsPressed = false;
     tracer.Verbose("Initial value: " + IsPressed);
 }
Example #2
0
 public IoTSensor(Connectors gpio)
 {
     pin = new IoTPin(gpio);
     pin.SetDirection(IoTPinDirection.DirectionIn);
     pin.SetActiveType(IoTActiveType.ActiveLow);
     HasPresence = pin.Value;
     tracer.Verbose("Initial value: " + HasPresence);
 }
 public IoTRelay(params Connectors [] gpio)
 {
     pins = new IoTPin [gpio.Length];
     for (int i = 0; i < gpio.Length; i++)
     {
         pins [i] = new IoTPin(gpio [i]);
         pins [i].SetDirection(IoTPinDirection.DirectionOutInitiallyLow);
         pins [i].SetActiveType(IoTActiveType.ActiveLow);
         EnablePin(i, false);
     }
 }