From f1219e411c45b615ed231415d1c19341cc8db873 Mon Sep 17 00:00:00 2001 From: borti4938 Date: Fri, 19 Aug 2016 14:47:43 +0200 Subject: [PATCH] Select previous item (dbl klick) on first element wraps around to last item --- Cart_Reader/Cart_Reader.ino | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Cart_Reader/Cart_Reader.ino b/Cart_Reader/Cart_Reader.ino index 683795a..93305ed 100644 --- a/Cart_Reader/Cart_Reader.ino +++ b/Cart_Reader/Cart_Reader.ino @@ -861,9 +861,9 @@ unsigned char questionBox_OLED(const char* question, char answers[7][20], int nu break; } } - else if (choice > 0) { - choice--; - } + else + choice = (choice > 0) ? choice - 1 : num_answers - 1; + // draw selection box display.drawPixel(0, 8 * choice + 12, WHITE);