This is the documentation for the latest development branch of MicroPython and may refer to features that are not available in released versions.

If you are looking for the documentation for a specific release, use the drop-down menu on the left and select the desired version.

pyb.LCD

Classes

LCD

Construct an LCD object in the given skin position. skin_position can be 'X' or 'Y', and

Module Contents

class pyb.LCD.LCD(skin_position)

Construct an LCD object in the given skin position. skin_position can be ‘X’ or ‘Y’, and should match the position where the LCD pyskin is plugged in.

command(instr_data, buf) None

Send an arbitrary command to the LCD. Pass 0 for instr_data to send an instruction, otherwise pass 1 to send data. buf is a buffer with the instructions/data to send.

contrast(value) None

Set the contrast of the LCD. Valid values are between 0 and 47.

fill(colour) None

Fill the screen with the given colour (0 or 1 for white or black).

This method writes to the hidden buffer. Use show() to show the buffer.

get(x, y) int

Get the pixel at the position (x, y). Returns 0 or 1.

This method reads from the visible buffer.

light(value) None

Turn the backlight on/off. True or 1 turns it on, False or 0 turns it off.

pixel(x, y, colour) None

Set the pixel at (x, y) to the given colour (0 or 1).

This method writes to the hidden buffer. Use show() to show the buffer.

show() None

Show the hidden buffer on the screen.

text(str, x, y, colour) None

Draw the given text to the position (x, y) using the given colour (0 or 1).

This method writes to the hidden buffer. Use show() to show the buffer.

write(str) None

Write the string str to the screen. It will appear immediately.