错误1:ValueError: invalid literal for int() with base 10
- int(str)函数将符合整数的规定的字符串转换成int型的
- float(str)函数将符合浮点型的规定的字符串转换成float型的
- str(num)将整数、浮点型转换成字符串型的
错误2:持续更新......
函数方法:
object <Display object at 3ffe7bb0> is of type Display
RGB -- True
PURPLE -- 4224
_setwindowloc -- <function _setwindowloc at 0x3ffe5b90>
draw_filledRectangle -- <function draw_filledRectangle at 0x3ffe6130>
DARKGREEN -- 4
draw_image -- <function draw_image at 0x3ffe5c90>
show -- <function show at 0x3ffe5e90>
display_on -- <function display_on at 0x3ffe5d70>
__qualname__ -- Display
letter -- <function letter at 0x3ffe61d0>
is_off_grid -- <function is_off_grid at 0x3ffe5be0>
INDIGO -- 6159
circle -- <function circle at 0x3ffe60d0>
BGR -- False
load_sprite -- <function load_sprite at 0x3ffe5cf0>
draw_filledCircle -- <function draw_filledCircle at 0x3ffe60f0>
fill_ellipse -- <function fill_ellipse at 0x3ffe6120>
lines -- <function lines at 0x3ffe5de0>
draw_hline -- <function draw_hline at 0x3ffe5da0>
__module__ -- ST7735
BLUE -- 7936
write_cmd -- <function write_cmd at 0x3ffe5bb0>
draw_filledPolygon -- <function draw_filledPolygon at 0x3ffe6150>
draw_pixel -- <function draw_pixel at 0x3ffe5d90>
FUCHSIA -- 8184
LIGHT_CORAL -- 4348
RED -- 4088
_draw -- <function _draw at 0x3ffe5b70>
_copy -- <function _copy at 0x3ffe5b60>
OLIVE -- 132
YELLOW -- 57599
cleanup -- <function cleanup at 0x3ffe5d80>
GREEN -- 57351
write_data -- <function write_data at 0x3ffe5bc0>
CYAN -- 65415
MAROON -- 128
DODGER_BLUE -- 7940
draw_vline -- <function draw_vline at 0x3ffe5db0>
__init__ -- <closure>
draw_filledEllipse -- <function draw_filledEllipse at 0x3ffe6110>
rotation -- <function rotation at 0x3ffe5d50>
draw_text -- <function draw_text at 0x3ffe5e20>
clear -- <function clear at 0x3ffe5c50>
BLACK -- 0
text -- <function text at 0x3ffe5e60>
polygon -- <function polygon at 0x3ffe6090>
MADCTL -- 54
DEEP_PINK -- 4344
setMADCTL -- <function setMADCTL at 0x3ffe5d40>
draw_sprite -- <function draw_sprite at 0x3ffe5d00>
display_off -- <function display_off at 0x3ffe5d60>
NAVY -- 4096
WHITE -- 65535
set_rgb -- <function set_rgb at 0x3ffe5d20>
CHARTREUSE -- 57479
draw_circle -- <function draw_circle at 0x3ffe60c0>
_pushcolor -- <function _pushcolor at 0x3ffe5ba0>
draw_lines -- <function draw_lines at 0x3ffe5dd0>
draw_letter -- <function draw_letter at 0x3ffe6190>
_setColor -- <function _setColor at 0x3ffe5b50>
LIGHT_YELLOW -- 61695
size -- <function size at 0x3ffe5bd0>
PINK -- 8188
AQUA -- 65287
TEAL -- 4100
draw_polygon -- <function draw_polygon at 0x3ffe6060>
draw_rectangle -- <function draw_rectangle at 0x3ffe5df0>
_setwindowpoint -- <function _setwindowpoint at 0x3ffe5b80>
draw_line -- <function draw_line at 0x3ffe5dc0>
LIGHT_SLATE_BLUE -- 8068
SPRING_GREEN -- 61447
ORANGE -- 252
LIGHT_GREEN -- 61575
draw_ellipse -- <function draw_ellipse at 0x3ffe60e0>
fill_circle -- <function fill_circle at 0x3ffe6100>
image -- <function image at 0x3ffe5cd0>
_getletter -- <function _getletter at 0x3ffe6170>
block -- <function block at 0x3ffe5c30>
>>>
test:
def test():
"""Test code."""
display=Display(spi,SPI_CS,SPI_DC)
print('display started')
display.clear(color565(64, 0, 255))
sleep(1)
display.clear()
display.draw_hline(10, 127, 63, color565(255, 0, 255))
sleep(1)
display.draw_vline(10, 0, 127, color565(0, 255, 255))
sleep(1)
display.draw_filledRectangle(23, 50, 30, 75, color565(255, 255, 255))
sleep(1)
display.draw_hline(0, 0, 127, color565(255, 0, 0))
sleep(1)
display.draw_line(127, 0, 64, 127, color565(255, 255, 0))
sleep(2)
display.clear()
coords = [[0, 63], [78, 80], [122, 92], [50, 50], [78, 15], [0, 63]]
display.draw_lines(coords, color565(0, 255, 255))
sleep(1)
display.clear()
display.draw_filledPolygon(7, 63, 63, 50, color565(0, 255, 0))
sleep(1)
display.draw_filledRectangle(0, 0, 15, 127, color565(255, 0, 0))
sleep(1)
display.clear()
display.draw_filledRectangle(0, 0, 63, 63, color565(128, 128, 255))
sleep(1)
display.draw_rectangle(0, 64, 63, 63, color565(255, 0, 255))
sleep(1)
display.draw_filledRectangle(64, 0, 63, 63, color565(128, 0, 255))
sleep(1)
display.draw_polygon(3, 96, 96, 30, color565(0, 64, 255),
rotate=15)
sleep(3)
display.clear()
display.draw_filledCircle(32, 32, 30, color565(0, 255, 0))
sleep(1)
display.draw_circle(32, 96, 30, color565(0, 0, 255))
sleep(1)
display.draw_filledEllipse(96, 32, 30, 16, color565(255, 0, 0))
sleep(1)
display.draw_ellipse(96, 96, 16, 30, color565(255, 255, 0))
sleep(5)
display.cleanup()