Help language development. Donate to The Perl Foundation

RPi::Device::ST7036 zef:patrickb last updated on 2021-04-09

RPi::Device::ST7036 - Support for the ST7036 dot matrix display.


    use RPi::Wiring::Pi;
    use RPi::Wiring::SPI;
    use RPi::Device::ST7036;

    wiringPiSPISetup 0, 1_000_000;

    my RPi::Device::ST7036 $lcd .= new(
        setup       => RPi::Device::ST7036::Setup.DOGM081_3_3V,
        rs-pin      => 25,
        spi-channel => 0


    $lcd.write: 'Shiny!';


Display driver for ST7036 based matrix displays.



Takes the following parameters:

  * rs-pin

RPi pin number connected to the register select pin of the display. This library uses the Wiring Pi pin numbering.

  * spi-channel

The SPI channel the display is connected to. Either 0 or 1.

  * setup

An RPi::Device::ST7036::Setup object. Instances of this class contain all configuration options that are always the same for a specific display.

If you have a display for which there is not yet an entry in the Setup class ready to use, please write one and create a pull request!

  * cursor

Whether to display a cursor.

  * cursor-blink

Whether the cursor should blink.

  * contrast

A contrast value between 0 and 63.

  * double-height

Whether a double hight line should be used (irrelevant for single line displays).

  * display-on

Whether the display should be turned on initially.


Initialize the display. Must be called before anything else works.


Write some text on the display.


Return the cursor to position 0.


Clear the display.