更新MINI的固件,包括(绘制指针,网络SSL,DS18X20,知心,BLE-NOT)

This commit is contained in:
dahanzimin
2024-09-27 21:45:58 +08:00
committed by 王立帮
parent d28ec53f56
commit 443c901d74
9 changed files with 390 additions and 59 deletions

View File

@@ -5,7 +5,7 @@ Micropython library for the MINI_WCH(TOUCH*2, MIC*1, Buzzer*1, PWM*2, Matrix8x12
=======================================================
@dahanzimin From the Mixly Team
"""
import time
import time, math
from esp import flash_read
from micropython import const
from framebuf import FrameBuffer, MONO_VLSB
@@ -215,6 +215,12 @@ class BOT035(FrameBuffer):
self.show()
time.sleep_ms(speed)
def pointern(self, x=_LEDS_W // 2, y=_LEDS_H // 2, l=_LEDS_H // 2, angle=0):
radian = math.radians(angle)
self.fill(0)
self.line(x, y, round(x + l * math.sin(radian)), round(y - l * math.cos(radian)), 1)
self.show()
def _wreg(self, reg, val):
'''Write memory address'''
self._i2c.writeto_mem(_BOT035_ADDRESS, reg, val.to_bytes(1, 'little'))