Skip to content

Commit edd3047

Browse files
committed
16x2 display: Show custom symbol for second profile
When the second config profile is active, we show an intervted "2" symbol at the upper right corner of the main view. Normally the break symbol is shown in that position. If the user triggers the break, the break symbol takes precedence over the custom "2" symbol.
1 parent bbdaed6 commit edd3047

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

Arduino_Pedelec_Controller/display.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -266,6 +266,7 @@ static void display_nokia_setup() //first time setup of nokia display
266266
// TODO: Add PROGMEM support
267267
static const byte serial_break_symbol[8] = { 0x0,0xa,0x11,0x15,0x11,0xa,0x0,0x0 }; //Symbol for showing that the bikes brake is active
268268
static const byte serial_batt_symbol[8] = { 0xe,0x1f,0x1f,0x1f,0x1f,0x1f,0x1f,0x0 }; //Symbol for the battery
269+
static const byte serial_profile2_symbol[8] = { 0x1f,0x11,0x1d,0x19,0x17,0x11,0x1f,0x0 }; //Symbol for showing that the second profile is active
269270
#endif
270271

271272
static void display_16x2_setup()
@@ -278,10 +279,11 @@ static void display_16x2_setup()
278279
#endif
279280

280281
#if (DISPLAY_TYPE & DISPLAY_TYPE_16X2)
281-
// Online editor for custom chars:
282+
// Online editor for custom chars (5x8 pixels):
282283
// http://www.quinapalus.com/hd44780udg.html
283284
lcd.createChar(0x01, serial_break_symbol);
284285
lcd.createChar(0x02, serial_batt_symbol);
286+
lcd.createChar(0x03, serial_profile2_symbol);
285287
#endif
286288
}
287289

@@ -360,6 +362,8 @@ static void display_16x2_view_main()
360362
// Break status
361363
if(brake_stat==0)
362364
lcd.write(0x01);
365+
else if (current_profile) // second profile active?
366+
lcd.write(0x03);
363367
else
364368
lcd.print(MY_F(" "));
365369

0 commit comments

Comments
 (0)