 byte sendByte(byte val)
 {
     return sendData(&val, 1);
-}
+}
const byte ackVal = 0b11110000; // 240 decimal

#if ROLE == ROLE_GROUND
#define HEARTBEAT_INTERVAL_MILLIS 1000
#define DISPLAY_TIME_MILLIS 1000

// can be digital pinsa
uint8_t triggerButtonPin = A0;
uint8_t resetButtonPin = A1;


        float temperature;
        bmp.getTemperature(&temperature);

        float seaLevelPressure = SENSORS_PRESSURE_SEALEVELHPA;

        float currentAlt = bmp.pressureToAltitude(seaLevelPressure, event.pressure, temperature);
        return smoothAltitude(currentAlt);
    }

    return -1;
}
float smoothAltitude(float newAlt) {
    // cycle every time this is called
    lastAltitudes[lastAltitudeIndex] = newAlt;
    lastAltitudeIndex++;
    if (lastAltitudeIndex >= ALTITUDE_SMOOTHING) {
        lastAltitudeIndex = 0;
    }

    // get average
    float sum = 0;
    for (int i = 0; i < ALTITUDE_SMOOTHING; i++) {
        sum += lastAltitudes[i];
    }
    return sum / ALTITUDE_SMOOTHING;
}

#endif
