Exemplo n.º 1
0
 private void SendEvent()
 {
     if (PiFaceInterrupt != null)
     {
         PiFaceEventArgs pfea = new PiFaceEventArgs();
         pfea.PinMask  = Read(INTFB);   // find out what caused the interrupt
         pfea.PinState = Read(INTCAPB); // read the state of the pins
         PiFaceInterrupt(this, pfea);
     }
 }
Exemplo n.º 2
0
 // PI face change event
 private void Spi_driver_PiFaceInterrupt(object sender, PiFaceEventArgs e)
 {
     if (StatusUpdate != null)
     {
         StatusUpdate(this, new HttpServerStatusArgs(0, "hardware update", 0));
     }
     if (_spiDriver.HardwareOk() && (_timer == null))
     {
         _timer = new Timer(_timerCallabck, this, TimeSpan.FromMilliseconds(500), TimeSpan.FromMilliseconds(500));
         _stopWatch.Start();
         _motorTimer = new Timer(_motorTimerCallabck, this, TimeSpan.FromMilliseconds(1), TimeSpan.FromMilliseconds(1));
     }
 }
 private void SendEvent()
 {
     if (PiFaceInterrupt != null)
     {
         PiFaceEventArgs pfea = new PiFaceEventArgs();
         pfea.PinMask = Read(INTFB); // find out what caused the interrupt
         pfea.PinState = Read(INTCAPB); // read the state of the pins
         PiFaceInterrupt(this, pfea);
     }
 }