李昂 b463e812bf !42 Support PikaCV, can read data from Jpeg and convert to rgb888/rgb565
* add pikaCV-test.cpp
* read(Image) and convert to RGB565 is tested ok
* transfer can return res, but not assert
* format tjpgd
* add test for PikaCV
* add assert for newContent
* restore assets
* restore PikaCV.pyi
* restore PikaCV
* restore uint16_t
* add jpeg_test.py
* move ADC, GPIO, RGB ... to Device
* add jd_decomp
* convert_JPEGtoREG888 is not ok
* connecting tjpegdec
* Converter.toRGB565() .toRGB888() .toGRay() eachother is ok
* support Gray
* add PikaCV_Image, PikaCV_ImageFormat
* add classes for PikaCV
* add PikaCV
2022-07-08 09:33:53 +00:00

40 lines
693 B
Python

import PikaStdLib
import machine
lcd = machine.LCD()
lcd.init()
lcd.clear('white')
mem = PikaStdLib.MemChecker()
key = machine.KEY()
key.init()
time = machine.Time()
h = 10
w = 10
x = 10
y = 10
x_last = x
y_last = y
is_update = 0
print('mem used max:')
mem.max()
lcd.fill(x, y, w, h, 'blue')
while True:
key_val = key.get()
if key_val != -1:
x_last = x
y_last = y
is_update = 1
if key_val == 0:
x = x + 5
if key_val == 1:
y = y - 5
if key_val == 2:
y = y + 5
if key_val == 3:
x = x - 5
if is_update:
is_update = 0
lcd.fill(x_last, y_last, w, h, 'white')
lcd.fill(x, y, w, h, 'blue')