My experience with Adafruit USB + Serial LCD Backpack

USB and serial backpack PIC_LCD_backpack for HD44780 character LCD screens.

My experience with Adafruit USB + Serial LCD Backpack

Postby vivitern » Thu Jan 04, 2018 2:29 am

I would like to share my experience with the Adafruit USB + Serial LCD Backpack in this short article. I use the variant with a 16 × 2 RGB LCD display in combination with a Raspberry Pi. Of course, controlling the LCD via GPIOs would also be possible, but USB is both more flexible and easy to control. So we are already at the sticking point of this article arrived: the control.

Under Linux and thus also in our Raspberry we find any connected devices in the "folder" / dev /. It is therefore relatively easy to send an output or a string to a device. The Adafruit USB + Serial Backpack appears in / dev / under the name ttyACM0 . On a Mac or other Unix system, the label may differ.

All commands / commands to be sent can be echoed via the command line / Console. However, the commands must be sent as a hexadecimal value.

For this we choose the parameters -n for the suppression of the newline and -e for the interpretation of the backslachs:

Code: Select all
echo -n -e 'WERTE' > /dev/ttyACM0

All commands may need to be executed as root.
As a command reference we use the documentation from Adafruit .
All setting values ​​of the USB LCD Backpack are given in hexadecimal values ​​between 0 and 255. For example, if you are unfamiliar with this notation, you can use this conversion table.

In the example above, the string "VALUES" appears directly on the display. Simple strings can be displayed directly. If you want to change the value of the settings, it will compose the string to be transmitted from the following parts:

Special Command: 0xFE (always the same)
which setting should be changed
and what value this setting has
I have listed some examples below:


Code: Select all
### Hintergrundbeleuchtung einschalten
echo -n -e '\xFE\x42' > /dev/ttyACM0

### Hintergrundbeleuchtung ausschalten
echo -n -e '\xFE\x46' > /dev/ttyACM0

### Displayhelligkeit festlegen
echo -n -e '\xFE\x99\x0' > /dev/ttyACM0
  bis
echo -n -e '\xFE\x99\xFF' > /dev/ttyACM0

### Kontrast einstellen
echo -n -e '\xFE\x91\x0' > /dev/ttyACM0
  bis
echo -n -e '\xFE\x91\xFF' > /dev/ttyACM0

### Display leeren
echo -n -e '\xFE\x58' > /dev/ttyACM0

### RGB Farbe der Hintergrundbeleuchtung
Rot: echo -n -e '\xFE\xD0\xFF\x0\x0' > /dev/ttyACM0
Grün: echo -n -e '\xFE\xD0\x0\xFF\x0' > /dev/ttyACM0
Blau: echo -n -e '\xFE\xD0\x0\x0\xFF' > /dev/ttyACM0

### Hintergrundbeleuchtung einschalten
echo -n -e '\xFE\x42' > /dev/ttyACM0

### Hintergrundbeleuchtung ausschalten
echo -n -e '\xFE\x46' > /dev/ttyACM0

### Displayhelligkeit festlegen
echo -n -e '\xFE\x99\x0' > /dev/ttyACM0
  bis
echo -n -e '\xFE\x99\xFF' > /dev/ttyACM0

### Kontrast einstellen
echo -n -e '\xFE\x91\x0' > /dev/ttyACM0
  bis
echo -n -e '\xFE\x91\xFF' > /dev/ttyACM0

### Display leeren
echo -n -e '\xFE\x58' > /dev/ttyACM0

### RGB Farbe der Hintergrundbeleuchtung
Rot: echo -n -e '\xFE\xD0\xFF\x0\x0' > /dev/ttyACM0
Grün: echo -n -e '\xFE\xD0\x0\xFF\x0' > /dev/ttyACM0
Blau: echo -n -e '\xFE\xD0\x0\x0\xFF' > /dev/ttyACM0


All other settings can be found in the documentation.
In Germany there is the backpack complete with LCD at Exp-Tech to buy. In 24/7 operation, I was able to test the system for half a year without problems and can recommend it to anyone.

The kit consists of the LCD, 16 × 1 pin header and the backpack. Rudimentary soldering skills should be present, as Backpack and LCD still need to be soldered with 16 Löstellen.
vivitern
Newbie
Newbie
 
Posts: 1
Joined: Wed Jan 03, 2018 9:39 pm

Return to USB serial LCD backpack