From 3b287851e48c926fe17eea44e8042465e5435914 Mon Sep 17 00:00:00 2001 From: Daniel Friesel Date: Mon, 26 Dec 2011 23:16:25 +0100 Subject: wibble: Calculation adjustments --- wibble.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/wibble.c b/wibble.c index 611a9f8..3b11750 100644 --- a/wibble.c +++ b/wibble.c @@ -298,12 +298,12 @@ void handle_acc_auto(cwiid_wiimote_t *wiimote, struct cwiid_acc_mesg *am, } if ((a_y < -2) && !w_start) - w_start = now; - else if (a_y < -2) { + w_start = w_last = now; + else if ((a_y < -2) && ((now - w_last) > 0.2)) { w_count++; w_last = now; if (w_count > 5) { - printf("\r\033[2K8====) Wanking for %.f seconds at %4.1fHz", + printf("\r\033[2K%.f seconds at %4.1fHz", w_last - w_start, w_count / (w_last - w_start) ); -- cgit v1.2.3