-
Notifications
You must be signed in to change notification settings - Fork 0
Sequent Microsystems LCD Adapter HAT command line Documentation
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 a list of the avilable command options:
Show the version number of the smlcd command, usage:
$ smlcd -vShow 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 numberDispaly this command warranty.
Tells you if a LCD Adapter Hat is connected or not:
$ smlcd -list
Display board detectedDisplay board firmware version:
$ smlcd board
Firmware ver 02.00Send a command byte to the display, for example if you need to clear display you send the command 1:
$ smlcd cmdwr 1This option is useful for initialize the display also. The initialization procedure is specific to each display type. Please refer to your LCD display datasheet for initialization list of commands and timing. Below an example of 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 folowing line with your greetings message
smlcd txtwr Sequent LCD AdapterSend a data byte to the display. Example writing uppercase A at the cursor position:
$ smlcd dtwr 65Write a text at the cursor position. This command does not check if you overflow the line size. Example:
smlcd txtwr LCD DisplayWrite 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 DisplaySet cursor position, format smlcd crs <line> <column>. Example of setting the cursor at column 3 of line 1:
$ smlcd crs 1 3Set backlight intensity, format smlcd blwr <intensity> for monochrome backlight or smlcd blwr <red> <green> <blue> for RGB backlight. All intensity value are from 0 to 100. Example of setting a monochrome backlight to 50% :
$ smlcd blwr 50Read pushbutton state, format smlcd swrd <switch> read single push button state or smlcd swrd read all 6 pushbuttons as a bitmap. Example of rading the state of the pushbutton number 1:
$ smlcd swrd 1The card generate an interrupt on Raspberry GPIO26 if a pushbutton is pressed or 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 represents pushbuttons and bit 7 represent 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 will clear all interrupt sources.
Read the encoder accumulated value as an 16 bits signed integer.
$ smlcd rotrdReset the encoder accumulated value.
$ smlcd rotrst