diff --git a/examples/Widgets/Widgets.ino b/examples/Widgets/Widgets.ino index cb2477cb..fc2a432e 100644 --- a/examples/Widgets/Widgets.ino +++ b/examples/Widgets/Widgets.ino @@ -10,6 +10,7 @@ #define LCD_ROWS 2 #define LCD_COLS 16 +#define LCD_ADDR 0x27 // Custom characters byte plusMinus[8] = {B00000, B00100, B01110, B00100, B00000, B01110, B00000, B00000}; // ± @@ -17,7 +18,7 @@ byte euro[8] = {B00111, B01000, B11110, B01000, B11110, B01000, B00111, B00000}; const char* options[] = {"Buy", "Sell"}; const char* days[] = {"Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun"}; -const char* pinChars = "123456789ABCDEF"; +const char pinChars[] = "123456789ABCDEF"; MENU_SCREEN( mainScreen, @@ -33,14 +34,14 @@ MENU_SCREEN( WIDGET_RANGE(10, 5, 0, 1000, "%.1d\003", 1)), ITEM_WIDGET( "Quantity", - [](float quantity, int tollerance) { Serial.println(quantity); Serial.println(tollerance); }, + [](float quantity, int tolerance) { Serial.println(quantity); Serial.println(tolerance); }, WIDGET_RANGE(1.0f, 0.1f, 0.1f, 100.0f, "%.1f", 0), WIDGET_RANGE(10, 1, 0, 100, "\002%d%%", 1)), ITEM_WIDGET( "Freq", [](int hour, int minute, const char* day) { Serial.println(hour); Serial.println(minute); Serial.println(day); }, - WIDGET_RANGE(0, 1, 0, 23, "%02d", 0, true), - WIDGET_RANGE(0, 1, 0, 59, ":%02d", 0, true), + WIDGET_RANGE(0, 1, 0, 23, "%02d", 0, false), + WIDGET_RANGE(0, 1, 0, 59, ":%02d", 0, false), WIDGET_LIST(days, sizeof(days) / sizeof(days[0]), 0, " on %s", 0, true)), ITEM_WIDGET( "Start", @@ -56,7 +57,7 @@ MENU_SCREEN( WIDGET_LIST(pinChars, strlen(pinChars), 10, "%c", 0, true), WIDGET_LIST(pinChars, strlen(pinChars), 14, "%c", 0, true))); -LiquidCrystal_I2C lcd(0x27, LCD_COLS, LCD_ROWS); +LiquidCrystal_I2C lcd(LCD_ADDR, LCD_COLS, LCD_ROWS); LiquidCrystal_I2CAdapter lcdAdapter(&lcd); CharacterDisplayRenderer renderer(&lcdAdapter, LCD_COLS, LCD_ROWS); LcdMenu menu(renderer);