void oledDrawString(int x, int y, const char* text) { if (!text) return; const char *c; int l = 0; for (c = text; *c; c++) { oledDrawChar(x + l, y, *c); l += fontCharWidth(*c) + 1; } }
void oledDrawString(int x, int y, const char *text, int font) { if (!text) return; int l = 0; int size = (font & FONT_DOUBLE ? 2 : 1); for (; *text; text++) { char c = oledConvertChar(*text); if (c) { oledDrawChar(x + l, y, c, font); l += size * (fontCharWidth(font & 0x7f, c) + 1); } } }
void oledDrawString(int x, int y, const char* text) { if (!text) return; int l = 0; char c; for (; *text; text++) { c = oledConvertChar(*text); if (c) { oledDrawChar(x + l, y, c); l += fontCharWidth(c) + 1; } } }
void oledDrawString(int x, int y, const char* text) { if (!text) return; int size = 1; if (*text == 0x01) { // double size text++; size = 2; } int l = 0; char c; for (; *text; text++) { c = oledConvertChar(*text); if (c) { oledDrawChar(x + l, y, c, size); l += size * (fontCharWidth(c) + 1); } } }
void oledDebug(const char *line) { int i; static const char *lines[8] = {0, 0, 0, 0, 0, 0, 0, 0}; static char id = 3; for (i = 0; i < 7; i++) { lines[i] = lines[i + 1]; } lines[7] = line; oledClear(); for (i = 0; i < 8; i++) { if (lines[i]) { oledDrawChar(0, i * 8, '0' + (id + i) % 10, 1); oledDrawString(8, i * 8, lines[i]); } } oledRefresh(); id = (id + 1) % 10; }