 #define GPSSerial Serial1
 #define USBSerial Serial
 
-#define BUT_STAR  3
-#define BUT_BLUE  7
-
 #define GPSECHO  true
 #define MEAN_EARTH_RADIUS 6371e3
 #define M_TO_FT 3.28084

void isr_start(void)
{
  if (debounce(3) ) {
    detachInterrupt(1) ;
    noInterrupts() ;
    coutner1++ ;
    interrupts() ;
    attachInterrupt(0, isr_start, HIGH) ;
  }
}

void isr_bluetooth(void)
{
  if ( debounce(7) ) {
    detachInterrupt(1) ;
    noInterrupts() ;
    coutner2++ ;
    interrupts() ;
    attachInterrupt(4, isr_bluetooth, HIGH) ;
  }
}

void isr_blank(void)
{
  // this function does nothing but it makes shit work 
  return ;
}

bool debounce(int pin) 
{
  bool safe = 1 ;
  for (int i = 0; i < 5; i++) {
     if (digitalRead(pin) != HIGH ) {
       safe = 0 ;
       return safe ;

Adafruit_GPS GPS(&GPSSerial);
HardwareSerial mySerial = Serial1;

volatile int tracking_en = 0 ; 
volatile int bluetooth_busy = 0 ;

void setup(void)
{
  attachInterrupt(1, isr_stop, HIGH) ;
  attachInterrupt(0,isr_start,HIGH) ;
  attachInterrupt(4,isr_bluetooth,HIGH);

  lcd_init();
  lcd_clear_display();
  lcd_write_str("Cache Rules Everything Around Me");

  USBSerial.begin(115200);
  delay(1000);

  GPS.begin(9600);

  GPS.sendCommand(PMTK_SET_NMEA_OUTPUT_RMCGGA);
  GPS.sendCommand(PMTK_SET_NMEA_UPDATE_100_MILLIHERTZ) ;
  GPS.sendCommand(PGCMD_ANTENNA);

  delay(1000);
  GPSSerial.println(PMTK_Q_RELEASE);
  lcd_clear_display() ; 
}

void loop(void)
{
  if (tracking_en) {
    char c = GPS.read();

    if ((c) && (GPSECHO)) {
      USBSerial.write(c);
    }

    if (GPS.newNMEAreceived()) {

      if (GPS.parse(GPS.lastNMEA()) && GPS.fix) {
         print_GPS_results() ;
      }
    }
  }
  delay(1500) ;
}

void print_GPS_results(void)
