Exemplo n.º 1
0
 private void set_heartbeat_timer()
 {
     heartbeat_timer2       = new Gadgeteer.Timer(HEARTBEAT_INTERVAL);
     heartbeat_timer2.Tick += new Gadgeteer.Timer.TickEventHandler((timer) => {
         send_heartbeat();
     });
     heartbeat_timer2.Start();
 }
Exemplo n.º 2
0
        void ProgramStarted()
        {
            /*******************************************************************************************
            *
            * Please write application below
            *
            *******************************************************************************************/

            Gadgeteer.Timer timer = new Gadgeteer.Timer(5000);
            timer.Tick += timer_Tick;
            timer.Start();

            Debug.Print("Program Started");
        }
Exemplo n.º 3
0
        private void InitializeWifi()
        {
            Debug.Print("SolarPulse - Initialize Wifi.");

            var connected = ConnectWifi();
            if (connected) {
                lightTimer = new Gadgeteer.Timer(1000, Gadgeteer.Timer.BehaviorType.RunOnce); // every 1 second (1000ms)
                lightTimer.Tick += timer_Tick;
                lightTimer.Start();

                this.ShowMainScreen();
            }
            else {
                this.wifiInitializationTimer.Start();
            }
        }
Exemplo n.º 4
0
 private void SetupTimers()
 {
     _timerBlink = new Gadgeteer.Timer(500);
     _timerBlink.Tick += BlinkTick;
     _timerBlink.Start();
 }
Exemplo n.º 5
0
 private void set_heartbeat_timer()
 {
     heartbeat_timer2 = new Gadgeteer.Timer(HEARTBEAT_INTERVAL);
     heartbeat_timer2.Tick += new Gadgeteer.Timer.TickEventHandler((timer) => {
         send_heartbeat();
     });
     heartbeat_timer2.Start();
 }
Exemplo n.º 6
0
 public void StartChecking()
 {
     Gadgeteer.Timer timer = new Gadgeteer.Timer(20000);
     timer.Tick += timer_Tick;
     timer.Start();
 }
Exemplo n.º 7
0
 private void SetupTimers()
 {
     _timerBlink       = new Gadgeteer.Timer(500);
     _timerBlink.Tick += BlinkTick;
     _timerBlink.Start();
 }
Exemplo n.º 8
0
        // This method is run when the mainboard is powered up or reset.
        void ProgramStarted()
        {
            /*******************************************************************************************
            Modules added in the Program.gadgeteer designer view are used by typing
            their name followed by a period, e.g.  button.  or  camera.

            Many modules generate useful events. Type +=<tab><tab> to add a handler to an event, e.g.:
                button.ButtonPressed +=<tab><tab>

            If you want to do something periodically, use a GT.Timer and handle its Tick event, e.g.:
                GT.Timer timer = new GT.Timer(1000); // every second (1000ms)
                timer.Tick +=<tab><tab>
                timer.Start();
            *******************************************************************************************/

            this.InitializeDisplay();
            this.ShowSplashScreen();

            this.wifiInitializationTimer = new Gadgeteer.Timer(1000, Gadgeteer.Timer.BehaviorType.RunOnce);
            wifiInitializationTimer.Tick += timer => {
                    this.InitializeWifi();
                };
            wifiInitializationTimer.Start();

            var bluetoothInitializationTimer = new Gadgeteer.Timer(1000, Gadgeteer.Timer.BehaviorType.RunOnce);
            bluetoothInitializationTimer.Tick += timer => {
                this.InitializeBluetooth();
            };
            bluetoothInitializationTimer.Start();

            // Use Debug.Print to show messages in Visual Studio's "Output" window during debugging.
            Debug.Print("Program Started");
        }