It is a wrap for this Github project. Quite old but nevertheless very nifty.
See the detail usage of the library here.
Note the following:
".....It works by creating a memory array for the 20x16 pixel bitmap that the functions work within. It then converts this bitmap to the 8 custom characters available with the HD44780 and displaying them as 2 rows of 4 characters at the location specified. As each character is 5x8 pixels and arranged in a 4x2 character array, the total addressable resolution is 20x16. As there's an 8 custom character limit with the HD44780, 20x16 is the maximum resolution that can be achieved (5*4=20 X 8*2=16)....."
Attached the B4R lib files. Copy the folder with its contents to the root of your B4R additional libs folder. Copy rLCDBitmap.xml to the root of your B4R additional libs folder.
Popup help available in the library.
Sample B4R project attached
Wiring diagram:
Snapshot:
Sample code:
Will post another couple of samples with what the library can do.
See the detail usage of the library here.
Note the following:
".....It works by creating a memory array for the 20x16 pixel bitmap that the functions work within. It then converts this bitmap to the 8 custom characters available with the HD44780 and displaying them as 2 rows of 4 characters at the location specified. As each character is 5x8 pixels and arranged in a 4x2 character array, the total addressable resolution is 20x16. As there's an 8 custom character limit with the HD44780, 20x16 is the maximum resolution that can be achieved (5*4=20 X 8*2=16)....."
Attached the B4R lib files. Copy the folder with its contents to the root of your B4R additional libs folder. Copy rLCDBitmap.xml to the root of your B4R additional libs folder.
Popup help available in the library.
Sample B4R project attached
Wiring diagram:
Snapshot:
Sample code:
B4X:
#Region Project Attributes
#AutoFlushLogs: True
#CheckArrayBounds: True
#StackBufferSize: 300
#End Region
Sub Process_Globals
'These global variables will be declared once when the application starts.
'Public variables can be accessed from all modules.
Public Serial1 As Serial
Dim lcd As LiquidCrystal 'rLiquidCrystal must be enabled in the B4R IDE
Dim bitmap As LcdBitmap 'rLCDBitmap must be enabled in the B4R IDE
Dim t As Timer
Dim cnt As Byte = 0
End Sub
Private Sub AppStart
Serial1.Initialize(115200)
Log("AppStart")
t.Initialize("t_tick", 2000)
lcd.Initialize(8,255,9, Array As Byte(4,5,6,7)) 'initialize the LCD (rLiquidCrystal) library
lcd.Begin(16,2)
bitmap.Initialize(lcd, 0, 0)
bitmap.begin
lcd.SetCursor(7, 0)
lcd.Write("LCDBitmap")
bitmap.rectFill(0, 0, 19, 15, bitmap.COLOR_ON, bitmap.UPDATE_OFF)
bitmap.rectFill(2, 2, 17, 13, bitmap.COLOR_OFF, bitmap.UPDATE_OFF)
bitmap.rectFill(4, 4, 15, 11, bitmap.COLOR_ON, bitmap.UPDATE_OFF)
bitmap.rect(6, 6, 13, 9, bitmap.COLOR_OFF, bitmap.UPDATE_ON)
t.Enabled = True
End Sub
Sub t_tick
cnt = cnt + 1
If cnt = 1 Then
bitmap.move(1, 0)
else if cnt = 2 Then
bitmap.move(2,0)
else if cnt = 3 Then
bitmap.move(3,0)
bitmap.clear_text
Else
bitmap.move(0,0)
lcd.SetCursor(7, 0)
lcd.Write("LCDBitmap")
cnt = 0
End If
End Sub
Will post another couple of samples with what the library can do.
Attachments
Last edited: