 void loop() {
   while(Serial3.available()) gps << Serial3.read();
   TimedEvent.loop();
-  ButtonEvent.loop();
+  Button.process();
   stateMachine.update();
 }

// #include <avr/sleep.h>
// #include <pitches.h>

#include <SPI.h>
#include <Time.h>
// #include <EEPROM.h>
#include <Ucglib.h>
#include <TinyGPS++.h>
#include <Streaming.h>
#include <TimedEvent.h>
#include <ButtonEvent.h>
#include <FiniteStateMachine.h>

#define OLED_MOSI 11

  oled << datetime;

  oled.setFont(ucg_font_7x13Br);
  oled.setColor(0, 255, 0);

  oled.setPrintPos(0, oled.getHeight() / 2);
  oled << distanceTo << F(" miles");

  oled.setPrintPos(0, (oled.getHeight() / 2) + (oled.getFontAscent() - oled.getFontDescent()));
  oled << TinyGPSPlus::cardinal(course);

  oled.setFont(ucg_font_fixed_v0r);
  oled.setColor(255, 255, 255);

  oled.setPrintPos(0, oled.getHeight() + oled.getFontDescent());
  oled << status;

  oled.setPrintPos(0, oled.getHeight() + (oled.getFontDescent() + 12));
  oled << F("hdop: ") << gps.hdop.value() << F(" WP: ") << (waypoint_index + 1) << '/' << arraySize(waypoint) << "    ";
}

void setup() {
  button.clickHandler(onClick);
  button.holdHandler(onHold, 5000);

  TimedEvent.addTimer(GET_FIX_TIMER, 5000, gpsFailure);
  TimedEvent.addTimer(READ_LOCATION_TIMER, 60000, initiateSleep);
