This line in lick_detector.h
#define BASELINE_SAMPLE_INTERVAL (1000ul)
could be extended to 5000 to mitigate adaptive-threshold issues where the mouse licks for long bouts--several seconds. Otherwise, the adaptive threshold adapts to a baseline that is too far away from nominal to read licks correctly.