diff --git a/Images/2004.jpg b/Images/2004.jpg new file mode 100644 index 0000000..7f0b383 Binary files /dev/null and b/Images/2004.jpg differ diff --git a/README.md b/README.md index f7481a6..ca69afa 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,11 @@ Small system dashboard on a tiny **OLED** display. Display useful information on small and cheap **LCD** display with the capability to customize characters. + +![2004](Images/2004.jpg) + +20x04 **LCD** is supported as well. + --- [docs directory](docs/) contains various ... documentations : installation procedures, API of plugins ... diff --git a/SelenitesLCD/CharPos.sel b/SelenitesLCD/CharPos.sel index 549341a..79e6e44 100644 --- a/SelenitesLCD/CharPos.sel +++ b/SelenitesLCD/CharPos.sel @@ -6,7 +6,7 @@ Selene.LetsGo() -- ensure late building dependencies -- Init the screen handle - -- Suitable for my BananaPI under Gentoo + -- Suitable for my BananaPI under Arch/Gentoo local lcd = SelLCD.Init(1, 0x27, true, false) if not lcd then lcd = SelLCD.Init(2, 0x27, true, false) @@ -21,7 +21,7 @@ lcd:SetCursor(0,0) lcd:WriteString('Top') lcd:SetCursor(0,1) -lcd:WriteString('Bottom') +lcd:WriteString('Bottom1602') lcd:SetCursor(15,0) lcd:WriteString('v') @@ -29,6 +29,15 @@ lcd:WriteString('v') lcd:SetCursor(15,1) lcd:WriteString('^') +lcd:SetCursor(0,3) +lcd:WriteString('Bottom2004') + +lcd:SetCursor(19,0) +lcd:WriteString('V') + +lcd:SetCursor(19,3) +lcd:WriteString('T') + io.stdin:read'*l' lcd:Backlight(false) diff --git a/src/SelPlugins/LCD/SelLCD.c b/src/SelPlugins/LCD/SelLCD.c index 33cf783..a9c29c2 100644 --- a/src/SelPlugins/LCD/SelLCD.c +++ b/src/SelPlugins/LCD/SelLCD.c @@ -321,7 +321,7 @@ static void lcdc_SetDDRAM(struct LCDscreen *lcd, uint8_t pos){ * @param screen point to the screen handle * @tparam uint8_t position (<80 otherwise reset to 0) */ - if(pos > 79) + if(pos > 0xe8) pos = 0; selLCD.SendCmd(lcd, 0x80 | pos); @@ -349,7 +349,20 @@ static void lcdc_SetCursor(struct LCDscreen *lcd, uint8_t x, uint8_t y){ * Notez-bien : there is no boundary check. Up to the developer to know what * it is doing. */ - selLCD.SetDDRAM(lcd, y*0x40 + x); + uint8_t p; + + switch(y){ + case 1: + p = 0x40; break; + case 2: + p = 0x14; break; + case 3: + p = 0x54; break; + default: + p = 0x00; + } + p += x; + selLCD.SetDDRAM(lcd, p); } static int lcdl_SetCursor(lua_State *L){ diff --git a/src/include/Selene/SeleneVersion.h b/src/include/Selene/SeleneVersion.h index 518ebfb..eb8d12f 100644 --- a/src/include/Selene/SeleneVersion.h +++ b/src/include/Selene/SeleneVersion.h @@ -60,4 +60,4 @@ */ /* Version exposed to application (including Lua side) */ -#define SELENE_VERSION 8.0200 /* major, minor, sub */ +#define SELENE_VERSION 8.0300 /* major, minor, sub */