Beispiel #1
0
void Time::delay(double seconds) {
    Clock *clk = getClock();
    if (clk) {
        clk->delay(seconds);
    } else {
        SystemClock::delaySystem(seconds);
    }
}
Beispiel #2
0
// -----------------------------------------------------------------------------
int main (int argc, char **argv) {


  g.open();
  led.setMode (Pin::ModeOutput); // the led pin is an output
  led.write (0); // turn off the led

  // sighandler() intercepts CTRL+C
  signal (SIGINT, sighandler);
  signal (SIGTERM, sighandler);
  cout << "Press Ctrl+C to abort ..." << endl;
  for (;;) {

    led.toggle(); // blinking led
    clk.delay (1000);
    cout << '.' << flush; // print one point per second
  }

  return 0;
}