rwblinn Well-Known Member Licensed User Longtime User Jun 13, 2016 #1 Hi, how to write special characters, like arrow_up and arrow_down to the LCD display? The rLiquidLibrary does not support the definition of special characters yet. Thinking of something, like 'Define the special char layout B4X: Private LCDArrowUp(8) As Byte = Array As Byte(0x04, 0x0E, 0x15, 0x04, 0x04, 0x04, 0x04, 0x00) Private LCDArrowDown(8) As Byte = Array As Byte(0x00, 0x04, 0x04, 0x04, 0x04, 0x15, 0x0E, 0x04) 'Define the special char B4X: lcd.DefineSpecialChar(0, LCDArrowUp) lcd.DefineSpecialChar(1, LCDArrowDown) 'Write the special char B4X: lcd.Write(LCDArrowUp)
Hi, how to write special characters, like arrow_up and arrow_down to the LCD display? The rLiquidLibrary does not support the definition of special characters yet. Thinking of something, like 'Define the special char layout B4X: Private LCDArrowUp(8) As Byte = Array As Byte(0x04, 0x0E, 0x15, 0x04, 0x04, 0x04, 0x04, 0x00) Private LCDArrowDown(8) As Byte = Array As Byte(0x00, 0x04, 0x04, 0x04, 0x04, 0x15, 0x0E, 0x04) 'Define the special char B4X: lcd.DefineSpecialChar(0, LCDArrowUp) lcd.DefineSpecialChar(1, LCDArrowDown) 'Write the special char B4X: lcd.Write(LCDArrowUp)
Erel B4X founder Staff member Licensed User Longtime User Jun 13, 2016 #2 You can use this inline code: B4X: RunNative("createChars", Null) RunNative("writeChar", 0) #if C Byte smiley[8] = { B00000, B10001, B00000, B00000, B10001, B01110, B00000, }; void createChars(B4R::Object* o) { b4r_main::_lcd->lc->createChar(0, smiley); } void writeChar(B4R::Object* o) { b4r_main::_lcd->lc->write((Byte)o->toULong()); } #end if Upvote 0
You can use this inline code: B4X: RunNative("createChars", Null) RunNative("writeChar", 0) #if C Byte smiley[8] = { B00000, B10001, B00000, B00000, B10001, B01110, B00000, }; void createChars(B4R::Object* o) { b4r_main::_lcd->lc->createChar(0, smiley); } void writeChar(B4R::Object* o) { b4r_main::_lcd->lc->write((Byte)o->toULong()); } #end if