Exemplo n.º 1
0
 public ControlButton(Cpu.Pin interruptPin, string color, byte hue, Nexus nexus)
 {
     _interruptPort = new InterruptPort(interruptPin, false, Port.ResistorMode.PullUp, Port.InterruptMode.InterruptEdgeLow);
     _interruptPort.OnInterrupt += new NativeEventHandler(ControlButton_OnInterrupt);
     _color = color;
     _hue = hue;
     _nexus = nexus;
 }
Exemplo n.º 2
0
        public static void Main()
        {
            Debug.Print("Hello from: " + DeviceId);
            _credential = new NetworkCredential(DeviceId, DeviceId);

            // TestSDCard();

            _nexus = new Nexus();

            _led = new OutputPort(Pins.ONBOARD_LED, false);
            _button = new InterruptPort(Pins.ONBOARD_SW1, false, Port.ResistorMode.Disabled, Port.InterruptMode.InterruptEdgeBoth);
            _button.OnInterrupt += new NativeEventHandler(button_OnInterrupt);

            _vitals = new DeviceVitals(NapkinServerUri, DeviceId, _credential);

            _cycleThread = new Thread(CycleDriver);
            _cycleThread.Start();
        }