Skip to content

Sequent Microsystems LCD Adapter HAT command line Documentation

Alexandru Burcea edited this page Aug 11, 2025 · 8 revisions

smlcd

The smlcd command line interface is created to access all the features of the Sequent Microsystems LCD Adapter HAT. A complete help of the command is shown by running the -h option. Below is a list of the available command options:

-v

Show the version number of the smlcd command, usage:

$ smlcd -v

-h

Show the list of all available command options, and can take a command option as a parameter and display the help for that option. Example:

$ smlcd -h -v
        -v              Display the smlcd command version number
        Usage:          smlcd -v
        Example:        smlcd -v  Display the version number

-warranty

Display this command warranty.

-list

Tells you if an LCD Adapter Hat is connected or not:

 $ smlcd -list
Display board detected

board

Display board firmware version:

$ smlcd board
Firmware ver 02.00

cmdwr

Send a command byte to the display. For example, if you need to clear the display, you send the command 1:

$ smlcd cmdwr 1

This option is useful for initializing the display, also. The initialization procedure is specific to each display type. Please refer to your LCD display datasheet for the initialization list of commands and timing. Below is an example of a shell script file for initialization of a 4-line display, no cursor, normal writing direction:

#!/bin/bash

#init display commands
smlcd cmdwr 60
sleep 0.01
smlcd cmdwr 12
sleep 0.01
smlcd cmdwr 6
sleep 0.01

#clear display
smlcd cmdwr 1

#set backlight to 50%
smlcd blwr 50

#replace the following line with your greeting message
smlcd txtwr Sequent LCD Adapter

dtwr

Send a data byte to the display. Example writing uppercase A at the cursor position:

 $ smlcd dtwr 65

txtwr

Write a text at the cursor position. This command does not check if you overflow the line size. Example:

smlcd txtwr LCD Display

txtwrat

Write a text at specified position, format smlcd txtwrat <line> <column> <text>. Example of writing "LCD Display" text starting from first column second line:

$ smlcd txtwrat 2 1 LCD Display

crs

Set cursor position, format smlcd crs <line> <column>. Example of setting the cursor at column 3 of line 1:

$ smlcd crs 1 3

blwr

Set backlight intensity, format smlcd blwr <intensity> for monochrome backlight or smlcd blwr <red> <green> <blue> for RGB backlight. All intensity values are from 0 to 100. Example of setting a monochrome backlight to 50% :

$ smlcd blwr 50

swrd

Read pushbutton state, format smlcd swrd <switch> read single push button state or smlcd swrd read all 6 pushbuttons as a bitmap. Example of reading the state of the pushbutton number 1:

$ smlcd swrd 1

swird

The card generates an interrupt on Raspberry GPIO26 if a pushbutton is pressed or the rotary encoder has been moved. This command reads the source or sources of the interrupt that has been generated. Once you read the interrupt sources, they are automatically cleared. Run smlcd swird if you wish to read all interrupt sources as a bitmap, bits 0 to 5 represent pushbuttons, and bit 7 represents the encoder. Run smlcd swird <channel> if you wish to check if one pushbutton has generated the interrupt. This last usage option has the disadvantage that it will clear all interrupt sources.

rotrd

Read the encoder accumulated value as a 16-bit signed integer.

$ smlcd rotrd

rotrst

Reset the encoder accumulated value.

$ smlcd rotrst

Clone this wiki locally