Skip to content

Commit

Permalink
* Compatible with maixpy ​​v1 sensor and lcd
Browse files Browse the repository at this point in the history
  • Loading branch information
lxowalle committed Apr 12, 2024
1 parent 5976a93 commit 9bfa0c3
Show file tree
Hide file tree
Showing 9 changed files with 1,085 additions and 32 deletions.
18 changes: 18 additions & 0 deletions examples/maixpy_v1/test_image.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
#!/usr/bin/env python

from maix.v1 import lcd, image
from maix import time

lcd.init()
print('lcd width:', lcd.width())
print('lcd height:', lcd.height())

img = image.Image("test.jpg")
print('img width:', img.width())
print('img height:', img.height())
print('img format:', img.format())
print('img data size:', img.size())
lcd.display(img)

while True:
time.sleep(1)
15 changes: 15 additions & 0 deletions examples/maixpy_v1/test_lcd.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/usr/bin/env python

from maix.v1 import lcd, image
from maix import time

img = image.Image("test.jpg")

lcd.init()
lcd.display(img)
# lcd.clear()
print('lcd width:', lcd.width())
print('lcd height:', lcd.height())

while True:
time.sleep(1)
20 changes: 20 additions & 0 deletions examples/maixpy_v1/test_sensor.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
#!/usr/bin/env python

from maix.v1 import lcd, sensor
from maix import time

lcd.init()
sensor.reset()
# sensor.set_pixformat(sensor.RGB565)
sensor.set_framesize(sensor.VGA)
sensor.run(1)
sensor.skip_frames(1)
# sensor.set_colorbar(1)

print('sensor width:', sensor.width())
print('sensor height:', sensor.height())

while True:
img = sensor.snapshot()
lcd.display(img)
time.sleep_ms(30)
3 changes: 1 addition & 2 deletions maix/v1/__init__.py
Original file line number Diff line number Diff line change
@@ -1,2 +1 @@

__all__ = ["image", "machine", "lcd", "sensor", "video"]
__all__ = ["image", "machine", "lcd", "sensor", "video", "audio"]
15 changes: 15 additions & 0 deletions maix/v1/audio.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
class Audio():
def __init__(array=None, path=None, points=1024):
pass

def to_bytes():
pass

def play_process():
pass

def play():
pass

def finish():
pass
Loading

0 comments on commit 9bfa0c3

Please sign in to comment.