Skip to content

Commit

Permalink
Merge pull request #44 from destroyedlolo/Experimental
Browse files Browse the repository at this point in the history
LCD 2004 supported as well
  • Loading branch information
destroyedlolo authored Nov 26, 2024
2 parents 6208a1b + 67dbbc6 commit 79fd50e
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 5 deletions.
Binary file added Images/2004.jpg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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 ...
13 changes: 11 additions & 2 deletions SelenitesLCD/CharPos.sel
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -21,14 +21,23 @@ lcd:SetCursor(0,0)
lcd:WriteString('Top')

lcd:SetCursor(0,1)
lcd:WriteString('Bottom')
lcd:WriteString('Bottom1602')

lcd:SetCursor(15,0)
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)
Expand Down
17 changes: 15 additions & 2 deletions src/SelPlugins/LCD/SelLCD.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down Expand Up @@ -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){
Expand Down
2 changes: 1 addition & 1 deletion src/include/Selene/SeleneVersion.h
Original file line number Diff line number Diff line change
Expand Up @@ -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 */

0 comments on commit 79fd50e

Please sign in to comment.