secondEvent()

Examples

void setup() {
  noLoop();
}

void draw() {
  fill(BLACK);

  int s = second();    // Values from 0 - 61 (60 or 61 are leap-seconds)

  // C-style string
  char str[15];
  snprintf(str, 15, "Second: %d", s);

  text(str, 10, 28);
}

// The secondEvent() function is called every second.
// Define ENABLE_SECOND_EVENT in settings.h, if you use this function.
void secondEvent() {
  redraw();
}

Description

The secondEvent() function is called when the second is changed. If you use this function, you have to define "ENABLE_SECOND_EVENT" at settings.h.

Syntax

secondEvent()

Returns

void

Related

dayEvent()
hourEvent()
minuteEvent()

Back to index