void ProgramStarted() { Debug.Print("Hello from: " + DeviceId); _credential = new NetworkCredential(DeviceId, DeviceId); new TemperatureHumiditySampler(temperatureHumidity, _samplers); new LightSensorSampler(lightsensor, _samplers); _vitals = new DeviceVitals(NapkinServerUri, DeviceId, _credential); _cycleThread = new Thread(CycleDriver); _cycleThread.Start(); }
// private AnalogSampler _gasSenseSampler; void ProgramStarted() { Debug.Print("Hello from: " + DeviceId); _credential = new NetworkCredential(DeviceId, DeviceId); new ButtonSampler(button, _samplers); new LightSensorSampler(lightsensor, _samplers); new BarometerSampler(barometer, _samplers); // GT.Socket socket2 = Gadgeteer.Socket.GetSocket(2, true, null, null); // _gasSenseSampler = new AnalogSampler("gas_sense", socket2, _samplers); _vitals = new DeviceVitals(NapkinServerUri, DeviceId, _credential); _cycleThread = new Thread(CycleDriver); _cycleThread.Start(); }
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(); }