B4R Tutorial [Tool]LCD Display Designer

Tool to design LCD Display Layouts for 20x4 or 16x2 displays connected to Arduino, Raspberry Pi or other.

1613395535658.png

Screenshot application with generated B4R code and an Arduino UNO with LCD2004 showing the text designed via B4R program.

Functionality
  • Design LCD display layouts for 20x4 (20 columns, 4 rows) or 16x2 displays (16 columns, 2 rows).
  • Save / open the display layout to / from a text file located in the application folder.
  • Generate simple B4R or C++ code.
  • Example B4R program included.
Attached
B4J Source code & library rLiquidCrystal_I2C.

Notes
  • Tool written with B4J v8.90.
  • For B4R programs, the B4R library rLiquidCrystal_I2C v1.10 and for Arduino C++ sketches, the library LiquidCrystal_I2C are required (attached).
  • Also published on GitHub with topics B4X, B4R, B4J.
  • Related: LCD Custom Char Maker Tool.
To-do
  • LCD Display Character Navigation via Arrow Keys
  • Custom Character Placeholder
Change Log
20210215: v1.01
 

Attachments

  • rLiquidCrystal_I2C-110.zip
    23.3 KB · Views: 489
  • lcddisplaydesigner.zip
    6.6 KB · Views: 488
Last edited:

hatzisn

Well-Known Member
Licensed User
Longtime User
Good afternoon @rwblinn. When I try to save it I get this:

1613398686778.png
 

hatzisn

Well-Known Member
Licensed User
Longtime User
It works perfect now. Great tool. Thanks.
 

peacemaker

Expert
Licensed User
Longtime User
Good tool, thanks.
But in B4J 9.50 (64bit) works only in Debug mode.
Release mode gives error:
main._appstart (java line: 99)
java.io.FileNotFoundException: Main.bjl
at anywheresoftware.b4a.objects.streams.File.OpenInput(File.java:235)
at anywheresoftware.b4j.objects.LayoutBuilder.loadLayout(LayoutBuilder.java:67)
at anywheresoftware.b4j.objects.PaneWrapper.LoadLayout(PaneWrapper.java:101)
at b4j.example.main._appstart(main.java:99)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:566)
at anywheresoftware.b4a.BA.raiseEvent2(BA.java:111)
at anywheresoftware.b4a.BA.raiseEvent(BA.java:98)
at b4j.example.main.start(main.java:37)
at javafx.graphics/com.sun.javafx.application.LauncherImpl.lambda$launchApplication1$9(LauncherImpl.java:846)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runAndWait$12(PlatformImpl.java:455)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$10(PlatformImpl.java:428)
at java.base/java.security.AccessController.doPrivileged(Native Method)
at javafx.graphics/com.sun.javafx.application.PlatformImpl.lambda$runLater$11(PlatformImpl.java:427)
at javafx.graphics/com.sun.glass.ui.InvokeLaterDispatcher$Future.run(InvokeLaterDispatcher.java:96)
at javafx.graphics/com.sun.glass.ui.win.WinApplication._runLoop(Native Method)
at javafx.graphics/com.sun.glass.ui.win.WinApplication.lambda$runLoop$3(WinApplication.java:174)
at java.base/java.lang.Thread.run(Thread.java:834)
 

rwblinn

Well-Known Member
Licensed User
Longtime User
But in B4J 9.50 (64bit) works only in Debug mode.
Release mode gives error:

Hi,

thanks for reporting.
Tested with Java 11 = Load the project, opened Main.bjl in the designer, saved Main.bjl without making changes, compiled in release mode -> No issues.
Attached the source used.

B4X:
B4J Version: 9.50
Parsing code.    (0.01s)
    Java Version: 11
Building folders structure.    (0.01s)
Compiling code.    (0.01s)
Compiling layouts code.    (0.01s)
Organizing libraries.    (0.00s)
Compiling generated Java code.    (2.02s)
Building jar file.    (0.23s)
    Jar file created: D:\projects\tools\lcd-display-designer\source\Objects\lcddisplaydesigner.jar
Running application.    (0.01s)
Completed successfully.
 

Attachments

  • lcddisplaydesigner.zip
    6.6 KB · Views: 170

rwblinn

Well-Known Member
Licensed User
Longtime User
Reproduced the error using the same folder name containing the subfolder with the characters ...\!!!\...
There was no error after changing the "!!!" in the subfolder name to "test", i.e. C:\TEMP\...\test\...
So seems caused by the folder name containing the special characters !.
 

peacemaker

Expert
Licensed User
Longtime User
folder name containing the special characters !
INDEEEED ! You are right ! I had such troubles before in other projects - and now clear why.

Googled a bit: https://stackoverflow.com/questions...irectories-which-end-with-an-exclamation-mark
Seems, exactly 3 pcs of exclamation marks "!!!" are the magic symbol.
UPD: no, even single "!" symbol in the path breaks Java for B4J under Windows. Maybe under Linux also ?
UPD2: this forum has mentioning about this Java bug many times, in the file path and data streams...of any B4X codes when based on Java.

I guess, it must be documented in some B4J place (to mention), to avoid magics, @Erel.
 
Last edited:
Top