Jump to content
View in the app

A better way to browse. Learn more.

Tinkerunity

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Suggestion small change Bricklet 20x4 Custom Character Documentation Java

Featured Replies

Geschrieben

Just a suggestion for a small change regarding writing a custom character with Java.

Test Java Snippet

// Custom Char battery assigned to index 0 (from max 7)
short[] battery = new short[]{14,27,17,17,17,17,17,31};
lcd.setCustomCharacter((short)0, battery);
// Display the custom char with some text
lcd.writeLine((short)0, (short)0, "Battery: " + (char)0x08);

Suggestion Java documentation:
For section

void BrickletLCD20x4.setCustomCharacter(short index, short[] character) 

change the line:

The characters can later be written with writeLine() by using the characters with the byte representation 8 ("x08") to 15 ("x0F").

to

The characters can later be written with writeLine() by using the characters with the byte representation 8 ( (char)0x08 ) to 15 ( (char)0x0F ).

 

Geschrieben

The documentation should actually have said "\x08" for the \x escape sequence, but due to incomplete escaping the documentation on the website was missing the backslash. Thank you for reporting this bug.

The documentation text cannot be programming language specific, that's why it used the common \x escape sequence. Unfortunately, Java doesn't support the \x escape sequence.

I've added the missing backslash for the \x escape sequence and also added the \u escape sequence for programming languages that lack support for \x.

Geschrieben
  • Autor

OK = thanks for the update.

Tested successfully:

lcd.writeLine((short)0, (short)0, "Battery: " + "\u0008");

 

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Gast
Reply to this topic...

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.