Display
Smart HomeThe house’s screen: 128 x 64 dots, x from 0 (left) to 127, y from 0 (top) to 63.
How you reach it
Section titled “How you reach it”The Display class is reached through this attribute of home.
home.display
Section titled “home.display”Can be None.
All the attributes of home are in its table. Read Attributes that can be None to see when a part is None.
Methods
Section titled “Methods”show_text(text, x, y)
Section titled “show_text(text, x, y)”Writes text with its top-left corner at dot (x, y); each letter is 8 x 8 dots and a new line starts 8 dots lower.
show_text(text, x, y)Used in examples: Hello, house, Web dashboard, Smart house, Doorbell
clear()
Section titled “clear()”Clears the whole screen.
clear()Used in examples: Hello, house, Web dashboard, Smart house, Doorbell
draw_line(x1, y1, x2, y2)
Section titled “draw_line(x1, y1, x2, y2)”Draws a straight line from dot (x1, y1) to dot (x2, y2).
draw_line(x1, y1, x2, y2)Used in examples: Hello, house
draw_rectangle(x, y, width, height, filled)
Section titled “draw_rectangle(x, y, width, height, filled)”Draws a rectangle with its top-left corner at (x, y), width x height dots, filled in when filled=True.
draw_rectangle(x, y, width, height, filled: bool)You can leave out filled.
Used in examples: Hello, house
draw_circle(x0, y0, radius, filled)
Section titled “draw_circle(x0, y0, radius, filled)”Draws a circle around dot (x0, y0), radius dots wide, filled in when filled=True.
draw_circle(x0, y0, radius, filled: bool)You can leave out filled.
Used in examples: Hello, house
draw_triangle(x0, y0, x1, y1, x2, y2, filled)
Section titled “draw_triangle(x0, y0, x1, y1, x2, y2, filled)”Draws a triangle between the dots (x0, y0), (x1, y1) and (x2, y2), filled in when filled=True.
draw_triangle(x0, y0, x1, y1, x2, y2, filled: bool)You can leave out filled.
Used in examples: Hello, house
show_emoji(name, scale, x, y, clear)
Section titled “show_emoji(name, scale, x, y, clear)”Draws one of the built-in faces by name ("happy", …), scale times its 16 x 16 dots, in the middle unless x and y are given.
show_emoji(name: str, scale: int, x=None, y=None, clear: bool)You can leave out name, scale and clear.
Used in examples: Hello, house, OLED picture
show_logo(x, y, clear)
Section titled “show_logo(x, y, clear)”Draws the MoBot logo, in the middle unless x and y are given.
show_logo(x=None, y=None, clear: bool)You can leave out clear.
Used in examples: Hello, house
show_frame(buffer)
Section titled “show_frame(buffer)”Draws a whole screen at once from 1024 bytes, one bit per dot, row by row (MONO_HLSB).
show_frame(buffer)Used in examples: OLED picture