Пример #1
0
 /// <summary>
 /// Pulses the mainboard's debug LED, if present.  Note that there may be more than one LED on the mainboard. One labelled "PWR" will always be on when the mainboard is powered.  The debug LED is labelled "LED" (if present).
 /// This method also writes "PulseDebugLED called" on the debug print output.
 /// </summary>
 /// <remarks>
 /// The Debug LED can also be turned on/off using the <see cref="Program.Mainboard"/> interface directly.
 /// </remarks>
 public void PulseDebugLED()
 {
     if (LEDOffTimer == null)
     {
         LEDOffTimer       = new Timer(new TimeSpan(0, 0, 0, 0, 10));
         LEDOffTimer.Tick += new Timer.TickEventHandler(LEDOffTimer_Tick);
     }
     Mainboard.SetDebugLED(true);
     Debug.Print("PulseDebugLED called");
     LEDOffTimer.Start();
 }
Пример #2
0
 /// <summary>
 /// Starts the application, invoking the dispatcher to handle events and timers. This call does not return.
 /// </summary>
 /// <exception cref="T:System.Exception">An attempt was made to call this method more than once.</exception>
 // Note: double-slash comment below so it doesn't appear in the API docs
 // deliberately a non-static call
 protected void Run()
 {
     if (_runCalled)
     {
         throw new Exception("Do not call GT.Program.Run twice (templates should call it once already)");
     }
     _runCalled = true;
     Mainboard.PostInit();
     _dispatcherStarted = true;
     Dispatcher.Run();
 }
Пример #3
0
 public void PulseDebugLED()
 {
     if (this.LEDOffTimer == null)
     {
         this.LEDOffTimer       = new Timer(new TimeSpan(0, 0, 0, 0, 10));
         this.LEDOffTimer.Tick += new Timer.TickEventHandler(this.LEDOffTimer_Tick);
     }
     Mainboard.SetDebugLED(true);
     Debug.WriteLine("PulseDebugLED called");
     this.LEDOffTimer.Start();
 }
Пример #4
0
 void LEDOffTimer_Tick(Timer timer)
 {
     LEDOffTimer.Stop();
     Mainboard.SetDebugLED(false);
 }
Пример #5
0
 private void LEDOffTimer_Tick(Timer timer)
 {
     this.LEDOffTimer.Stop();
     Mainboard.SetDebugLED(false);
 }
Пример #6
0
 public CerbuinoBoard(FirmataService firmata, Mainboard mb)
 {
     _firmata = firmata;
     _mb = mb;
 }