更新SANT图像支持base64编码

This commit is contained in:
dahanzimin
2025-06-12 11:33:12 +08:00
parent c0d1c70d4f
commit a5fbde5a0a
3 changed files with 505 additions and 0 deletions

View File

@@ -7,6 +7,7 @@ MicroPython library for the GC032A(Inherit C module)
"""
import time
import base64
from sensor import *
from machine import SoftI2C, Pin
from mixgo_sant import onboard_bot
@@ -32,3 +33,10 @@ class GC032A(Camera):
super().display()
else:
super().display_stop()
def snapshot(self, path=None, formats=0, quality=50):
_data = super().snapshot(path, formats=formats, quality=quality)
if formats >= 2:
return b'data:image/jpg;base64,' + base64.b64encode(bytes(_data))
else:
return _data