Merge branch 'master' of https://gitee.com/bnu_mixly/mixly3
This commit is contained in:
@@ -25,9 +25,8 @@ class Camera(Camera):
|
|||||||
onboard_bot.cam_en(1, 150)
|
onboard_bot.cam_en(1, 150)
|
||||||
super().__init__(frame_size=frame_size, pixel_format=pixel_format, **kwargs)
|
super().__init__(frame_size=frame_size, pixel_format=pixel_format, **kwargs)
|
||||||
self.set_hmirror(not hmirror)
|
self.set_hmirror(not hmirror)
|
||||||
time.sleep_ms(50)
|
time.sleep_ms(150)
|
||||||
self.set_vflip(not vflip)
|
self.set_vflip(not vflip)
|
||||||
time.sleep_ms(50)
|
|
||||||
SoftI2C(scl=Pin(47), sda=Pin(48), freq=400000) # 恢复I2C
|
SoftI2C(scl=Pin(47), sda=Pin(48), freq=400000) # 恢复I2C
|
||||||
for _ in range(skip_frame):
|
for _ in range(skip_frame):
|
||||||
super().capture()
|
super().capture()
|
||||||
|
|||||||
@@ -37,11 +37,15 @@ class ST7789(uframebuf.FrameBuffer_Uincode):
|
|||||||
def display(self, data=None, x=None, y=None, rotation=0, sync=True):
|
def display(self, data=None, x=None, y=None, rotation=0, sync=True):
|
||||||
if type(data) is str:
|
if type(data) is str:
|
||||||
data = Image.open(data, rotation)
|
data = Image.open(data, rotation)
|
||||||
|
if sync: self.fill(0x0, sync=False)
|
||||||
self.blit_rgb565(data.image, data.width, data.height, x, y)
|
self.blit_rgb565(data.image, data.width, data.height, x, y)
|
||||||
if sync: self.show()
|
if sync: self.show()
|
||||||
|
|
||||||
def screenshot(self):
|
def screenshot(self, x=0, y=0, w=None, h=None):
|
||||||
return IMG(memoryview(self._buffer), self.width, self.height)
|
if (w is None and h is None):
|
||||||
|
return IMG(memoryview(self._buffer), self.width, self.height)
|
||||||
|
else:
|
||||||
|
return IMG(memoryview(self.crop_rgb565(x,y,w,h)), w, h)
|
||||||
|
|
||||||
def _write(self, cmd, dat=None):
|
def _write(self, cmd, dat=None):
|
||||||
self.dc.off()
|
self.dc.off()
|
||||||
|
|||||||
Reference in New Issue
Block a user