grove.display

Submodules

Classes

  • JHD1802: Grove - 16 x 2 LCD, using chip JHD1802.

  • SH1107G: OLED Display 1.12”(v2) use chip SH1107G.

class grove.display.JHD1802(address=62)[source]
Grove - 16 x 2 LCD, using chip JHD1802.
  • Grove - 16 x 2 LCD (Black on Yellow)

  • Grove - 16 x 2 LCD (Black on Red)

  • Grove - 16 x 2 LCD (White on Blue)

Also, it’s our class name, which could drive the above three LCDs.

Parameters:

address (int) – I2C device address, default to 0x3E.

Inheritance

digraph inheritance0cd27edabe { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "Display" [URL="grove.display.base.html#grove.display.base.Display",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="All display devices should inherit this virtual class,"]; "JHD1802" [URL="grove.display.jhd1802.html#grove.display.jhd1802.JHD1802",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="Grove - 16 x 2 LCD, using chip JHD1802."]; "Display" -> "JHD1802" [arrowsize=0.5,style="setlinewidth(0.5)"]; }
clear()[source]

Clears the screen and positions the cursor in the upper-left corner.

draw(data, bytes)[source]

Not implement for char type display device.

home()[source]

Positions the cursor in the upper-left of the LCD. That is, use that location in outputting subsequent text to the display.

property name

Get device name

Returns:

JHD1802

Return type:

string

setCursor(row, column)[source]

Position the LCD cursor; that is, set the location at which subsequent text written to the LCD will be displayed.

Parameters:
  • row (int) – the row at which to position cursor, with 0 being the first row

  • column (int) – the column at which to position cursor, with 0 being the first column

Returns:

None

size()[source]

Get display size

Returns:

the display size, in characters.

Return type:

(Rows, Columns)

type()[source]

Get device type

Returns:

TYPE_CHAR

Return type:

int

write(msg)[source]

Write character(s) to the LCD.

Parameters:

msg (string) – the character(s) to write to the display

Returns:

None

class grove.display.SH1107G(address=60)[source]

OLED Display 1.12”(v2) use chip SH1107G.

Parameters:

address (int) – I2C device address, default to 0x3E.

Inheritance

digraph inheritance74a48944a1 { bgcolor=transparent; rankdir=LR; size="8.0, 12.0"; "Display" [URL="grove.display.base.html#grove.display.base.Display",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="All display devices should inherit this virtual class,"]; "SH1107G" [URL="grove.display.sh1107g.html#grove.display.sh1107g.SH1107G",fillcolor=white,fontname="Vera Sans, DejaVu Sans, Liberation Sans, Arial, Helvetica, sans",fontsize=10,height=0.25,shape=box,style="setlinewidth(0.5),filled",target="_top",tooltip="OLED Display 1.12\"(v2) use chip SH1107G."]; "Display" -> "SH1107G" [arrowsize=0.5,style="setlinewidth(0.5)"]; }
clear()[source]

Clears the screen and positions the cursor in the upper-left corner.

draw(data, bytes)[source]

Quickly transfer/draw bulk data (specified by data) to OLED, transfer size specified by bytes.

Parameters:
  • data (list of int) – the data to transfer/draw

  • bytes (int) – data size

home()[source]

Positions the cursor in the upper-left of the OLED. That is, use that location in outputting subsequent text to the display.

property name

Get device name

Returns:

SH1107G/SSD1307 depends your device plugin.

Return type:

string

setCursor(row, column)[source]

Position the OLED cursor; that is, set the location at which subsequent text written to the OLED will be displayed.

Parameters:
  • row (int) – the row at which to position cursor, with 0 being the first row

  • column (int) – the column at which to position cursor, with 0 being the first column

Returns:

None

size()[source]

Get display size

Returns:

the display size, in characters.

Return type:

(Rows, Columns)

type()[source]

Get device type

Returns:

TYPE_GRAY

Return type:

int

write(msg)[source]

Write character(s) to the OLED.

Parameters:

msg (string) – the character(s) to write to the display

Returns:

None