Skip to content

Commit

Permalink
Merge pull request #1 from kahvm/support-degree-sign-lcd1602
Browse files Browse the repository at this point in the history
Support for degree sign on LCD1602
  • Loading branch information
kahvm authored Mar 1, 2018
2 parents 695bb58 + 9dc4fef commit 7a4e3d9
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion src/_P012_LCD.ino
Original file line number Diff line number Diff line change
Expand Up @@ -203,7 +203,7 @@ boolean Plugin_012(byte function, struct EventStruct *event, String& string)
String tmpString = deviceTemplate[x];
if (lcd && tmpString.length())
{
String newString = parseTemplate(tmpString, col);
String newString = P012_parseTemplate(tmpString, col);
lcd->setCursor(0, x);
lcd->print(newString);
}
Expand Down Expand Up @@ -303,3 +303,13 @@ boolean Plugin_012(byte function, struct EventStruct *event, String& string)
}
return success;
}

// Perform some specific changes for LCD display
// https://www.letscontrolit.com/forum/viewtopic.php?t=2368
String P012_parseTemplate(String &tmpString, byte lineSize) {
String result = parseTemplate(tmpString, lineSize);
const char degree[3] = {0xc2, 0xb0, 0}; // Unicode degree symbol
const char degree_lcd[2] = {0xdf, 0}; // P012_LCD degree symbol
result.replace(degree, degree_lcd);
return result;
}

0 comments on commit 7a4e3d9

Please sign in to comment.