Hi everybody,
here is a code snippet to define custom chars in HD44780 controllers:
To print use
Have fun!
Mauro Zanin
here is a code snippet to define custom chars in HD44780 controllers:
B4X:
#if C
#include <LiquidCrystal.h>
byte psensc[8]= {
B00100,
B00100,
B00100,
B00100,
B00100,
B00100,
B00100,
B00000
};
byte puntooffc[8] ={
B00000,
B11111,
B10001,
B10001,
B10001,
B10001,
B11111,
B00000
};
byte infc[8] ={
B00000,
B00000,
B00000,
B01011,
B10101,
B11010,
B00000,
B00000
};
byte frecciadxc[8] ={
B00000,
B00100,
B00010,
B11111,
B00010,
B00100,
B00000,
B00000
};
byte frecciasxc[8] ={
B00000,
B00100,
B01000,
B11111,
B01000,
B00100,
B00000,
B00000
};
void Initchar (B4R::Object* o) {
LiquidCrystal lcd(9,8,7,6,5,4); //adapt to you hardware cabling
lcd.begin (20,4);
lcd.createChar(1, psensc);
lcd.createChar(2, infc);
lcd.createChar(3, frecciadxc);
lcd.createChar(4, frecciasxc);
lcd.createChar(5, puntooffc);
};
#end if
To print use
B4X:
RunNative("Initchar",Null)
lcd.print(chr(1))
lcd.print(chr(2))
.....
.....
Have fun!
Mauro Zanin