初始化提交
This commit is contained in:
BIN
boards/default/micropython/build/HZK12.bin
Normal file
BIN
boards/default/micropython/build/HZK12.bin
Normal file
Binary file not shown.
BIN
boards/default/micropython/build/HZK16.bin
Normal file
BIN
boards/default/micropython/build/HZK16.bin
Normal file
Binary file not shown.
56
boards/default/micropython/build/lib/adxl345.py
Normal file
56
boards/default/micropython/build/lib/adxl345.py
Normal file
@@ -0,0 +1,56 @@
|
||||
#ADXL345
|
||||
import time
|
||||
import ustruct
|
||||
from micropython import const
|
||||
|
||||
DATA_FORMAT = const(0x31)
|
||||
BW_RATE = const(0x2c)
|
||||
POWER_CTL = const(0x2d)
|
||||
INT_ENABLE = const(0x2E)
|
||||
OFSX = const(0x1e)
|
||||
OFSY = const(0x1f)
|
||||
OFSZ = const(0x20)
|
||||
|
||||
class ADXL345:
|
||||
def __init__(self, i2c, address=0X53):
|
||||
self._device = i2c
|
||||
self._address = address
|
||||
for addr in self._device.scan():
|
||||
if self._device.readfrom_mem(addr, 0, 1)[0] == 0xe5:
|
||||
self._address = addr
|
||||
break
|
||||
else:
|
||||
raise AttributeError("Cannot find a ADXL345")
|
||||
|
||||
self._wreg(DATA_FORMAT,0x2B) #16g量程
|
||||
self._wreg(BW_RATE,0x0A) #数据输出速度为100Hz
|
||||
self._wreg(INT_ENABLE,0x00) #不使用中断
|
||||
|
||||
self._wreg(OFSX,0x00)
|
||||
self._wreg(OFSY,0x00)
|
||||
self._wreg(OFSZ,0x00)
|
||||
self._wreg(POWER_CTL,0x08) #链接使能,测量模式
|
||||
time.sleep(0.5)
|
||||
|
||||
def readXYZ(self):
|
||||
x, = ustruct.unpack('<h', self._rreg(0x32,2))
|
||||
y, = ustruct.unpack('<h', self._rreg(0x34,2))
|
||||
z, = ustruct.unpack('<h', self._rreg(0x36,2))
|
||||
return (x/256,y/256,z/256)
|
||||
|
||||
def readX(self):
|
||||
return self.readXYZ()[0]
|
||||
|
||||
def readY(self):
|
||||
return self.readXYZ()[1]
|
||||
|
||||
def readZ(self):
|
||||
return self.readXYZ()[2]
|
||||
|
||||
def _wreg(self, reg, val):
|
||||
'''Write memory address'''
|
||||
self._device.writeto_mem(self._address,reg,val.to_bytes(1, 'little'))
|
||||
|
||||
def _rreg(self, reg,nbytes=1):
|
||||
'''Read memory address'''
|
||||
return self._device.readfrom_mem(self._address, reg, nbytes)[0] if nbytes<=1 else self._device.readfrom_mem(self._address, reg, nbytes)[0:nbytes]
|
||||
88
boards/default/micropython/build/lib/ahtx0.py
Normal file
88
boards/default/micropython/build/lib/ahtx0.py
Normal file
@@ -0,0 +1,88 @@
|
||||
"""
|
||||
AHT21
|
||||
|
||||
Micropython library for the AHT21(temperature,humidity)
|
||||
=======================================================
|
||||
|
||||
#Changed from circuitpython to micropython 20220211
|
||||
#Format unified 20220623
|
||||
|
||||
dahanzimin From the Mixly Team
|
||||
"""
|
||||
import utime
|
||||
from micropython import const
|
||||
|
||||
AHTX0_I2CADDR_DEFAULT = const(0x38) # Default I2C address
|
||||
AHTX0_CMD_INITIALIZE = const(0xE1) # Initialization command
|
||||
AHTX0_CMD_TRIGGER = const(0xAC) # Trigger reading command
|
||||
AHTX0_CMD_SOFTRESET = const(0xBA) # Soft reset command
|
||||
AHTX0_STATUS_BUSY = const(0x80) # Status bit for busy
|
||||
AHTX0_STATUS_CALIBRATED = const(0x08) # Status bit for calibrated
|
||||
|
||||
class AHTx0:
|
||||
"""Interface library for AHT10/AHT20 temperature+humidity sensors"""
|
||||
def __init__(self, i2c, address=AHTX0_I2CADDR_DEFAULT):
|
||||
utime.sleep_ms(20) # 20ms delay to wake up
|
||||
self._i2c = i2c
|
||||
self._address = address
|
||||
self._buf = bytearray(6)
|
||||
self.reset()
|
||||
if not self.initialize():
|
||||
raise AttributeError("Cannot find a AHTx0")
|
||||
self._temp = None
|
||||
self._humidity = None
|
||||
|
||||
def reset(self):
|
||||
"""Perform a soft-reset of the AHT"""
|
||||
self._buf[0] = AHTX0_CMD_SOFTRESET
|
||||
self._i2c.writeto(self._address, self._buf[0:1])
|
||||
utime.sleep_ms(20) # 20ms delay to wake up
|
||||
|
||||
def initialize(self):
|
||||
"""Ask the sensor to self-initialize. Returns True on success, False otherwise"""
|
||||
self._buf[0] = AHTX0_CMD_INITIALIZE
|
||||
self._buf[1] = 0x08
|
||||
self._buf[2] = 0x00
|
||||
self._i2c.writeto(self._address, self._buf[0:3])
|
||||
self._wait_for_idle()
|
||||
if not self.status() & AHTX0_STATUS_CALIBRATED:
|
||||
return False
|
||||
return True
|
||||
|
||||
def status(self):
|
||||
"""The status byte initially returned from the sensor, see datasheet for details"""
|
||||
self._read_to_buffer()
|
||||
return self._buf[0]
|
||||
|
||||
def _read_to_buffer(self):
|
||||
self._i2c.readfrom_into(self._address, self._buf)
|
||||
|
||||
def _trigger_measurement(self):
|
||||
"""Internal function for triggering the AHT to read temp/humidity"""
|
||||
self._buf[0] = AHTX0_CMD_TRIGGER
|
||||
self._buf[1] = 0x33
|
||||
self._buf[2] = 0x00
|
||||
self._i2c.writeto(self._address, self._buf[0:3])
|
||||
|
||||
def _wait_for_idle(self):
|
||||
while self.status() & AHTX0_STATUS_BUSY:
|
||||
utime.sleep_ms(5)
|
||||
|
||||
def _perform_measurement(self):
|
||||
self._trigger_measurement()
|
||||
self._wait_for_idle()
|
||||
self._read_to_buffer()
|
||||
|
||||
def humidity(self):
|
||||
"""The measured relative humidity in percent."""
|
||||
self._perform_measurement()
|
||||
self._humidity = (self._buf[1] << 12) | (self._buf[2] << 4) | (self._buf[3] >> 4)
|
||||
self._humidity = (self._humidity * 100) / 0x100000
|
||||
return self._humidity
|
||||
|
||||
def temperature(self):
|
||||
"""The measured temperature in degrees Celcius."""
|
||||
self._perform_measurement()
|
||||
self._temp = ((self._buf[3] & 0xF) << 16) | (self._buf[4] << 8) | self._buf[5]
|
||||
self._temp = ((self._temp * 200.0) / 0x100000) - 50
|
||||
return self._temp
|
||||
59
boards/default/micropython/build/lib/ap3216c.py
Normal file
59
boards/default/micropython/build/lib/ap3216c.py
Normal file
@@ -0,0 +1,59 @@
|
||||
"""
|
||||
AP3216C
|
||||
|
||||
MicroPython library for the AP3216C(ALS,PS,IRS)
|
||||
=======================================================
|
||||
#Preliminary composition 20240630
|
||||
|
||||
@dahanzimin From the Mixly Team
|
||||
"""
|
||||
import time
|
||||
from micropython import const
|
||||
|
||||
AP3216_ADD = const(0x1E)
|
||||
AP_SYS_CMD = const(0x00)
|
||||
AP_DAT = const(0x0A)
|
||||
AP_ALS_CMD = const(0x10)
|
||||
AP_PS_CMD = const(0x20)
|
||||
AP_PS_LED = const(0x21)
|
||||
Resolution = 0.35
|
||||
|
||||
class AP3216C:
|
||||
def __init__(self, i2c_bus, addr=AP3216_ADD):
|
||||
self._device = i2c_bus
|
||||
self._address = addr
|
||||
self._wreg(AP_SYS_CMD, 0x04) # SW reset
|
||||
time.sleep_ms(100)
|
||||
self._wreg(AP_SYS_CMD, 0x03) # 011: ALS and PS+IR functions active
|
||||
self._wreg(AP_ALS_CMD, 0x00) # Range 1: 0 ~ 20661 Lux. Resolution = 0.35 lux/count.
|
||||
self._wreg(AP_PS_CMD, 0x09) # PS gain:10
|
||||
self._wreg(AP_PS_LED, 0x23) # PS LED pulse:10
|
||||
|
||||
def _wreg(self, reg, val):
|
||||
'''Write memory address'''
|
||||
self._device.writeto_mem(self._address,reg,val.to_bytes(1, 'little'))
|
||||
|
||||
def _rreg(self, reg, nbytes=1):
|
||||
'''Read memory address'''
|
||||
return self._device.readfrom_mem(self._address, reg, nbytes)[0] if nbytes<=1 else self._device.readfrom_mem(self._address, reg, nbytes)[0:nbytes]
|
||||
|
||||
@property
|
||||
def getdata(self):
|
||||
'''处理获取数据'''
|
||||
#buf = self._rreg(AP_DAT, 6)
|
||||
ir = (self._rreg(AP_DAT + 0) & 0x03) | self._rreg(AP_DAT + 1) << 2
|
||||
als= (self._rreg(AP_DAT + 2) | self._rreg(AP_DAT + 3) << 8) * Resolution
|
||||
ps = (self._rreg(AP_DAT + 4) & 0x0F) | (self._rreg(AP_DAT + 5) & 0x3F) << 4
|
||||
return round(als, 2), ir, ps
|
||||
|
||||
def als_vis(self):
|
||||
'''可见光Lux'''
|
||||
return self.getdata[0]
|
||||
|
||||
def als_ir(self):
|
||||
'''红外Lux'''
|
||||
return self.getdata[1]
|
||||
|
||||
def ps_nl(self):
|
||||
'''接近距离'''
|
||||
return self.getdata[2]
|
||||
294
boards/default/micropython/build/lib/apds9960.py
Normal file
294
boards/default/micropython/build/lib/apds9960.py
Normal file
@@ -0,0 +1,294 @@
|
||||
"""
|
||||
APDS9960`
|
||||
|
||||
MicroPython library for the APDS9960(Supports gesture, proximity, and color detection)
|
||||
=======================================================
|
||||
|
||||
#Preliminary composition 20220224
|
||||
#base on https://github.com/adafruit/Adafruit_CircuitPython_BusDevice 20220623
|
||||
|
||||
dahanzimin From the Mixly Team
|
||||
"""
|
||||
|
||||
import time
|
||||
from micropython import const
|
||||
|
||||
_DEVICE_ID = const(0xAB)
|
||||
_APDS9960_ENABLE = const(0x80)
|
||||
_APDS9960_ATIME = const(0x81)
|
||||
_APDS9960_PILT = const(0x89)
|
||||
_APDS9960_PIHT = const(0x8B)
|
||||
_APDS9960_PERS = const(0x8C)
|
||||
_APDS9960_CONTROL = const(0x8F)
|
||||
_APDS9960_ID = const(0x92)
|
||||
_APDS9960_STATUS = const(0x93)
|
||||
_APDS9960_CDATAL = const(0x94)
|
||||
_APDS9960_PDATA = const(0x9C)
|
||||
_APDS9960_GPENTH = const(0xA0)
|
||||
_APDS9960_GEXTH = const(0xA1)
|
||||
_APDS9960_GCONF1 = const(0xA2)
|
||||
_APDS9960_GCONF2 = const(0xA3)
|
||||
_APDS9960_GPULSE = const(0xA6)
|
||||
_APDS9960_GCONF4 = const(0xAB)
|
||||
_APDS9960_GFLVL = const(0xAE)
|
||||
_APDS9960_GSTATUS = const(0xAF)
|
||||
_APDS9960_AICLEAR = const(0xE7)
|
||||
_APDS9960_GFIFO_U = const(0xFC)
|
||||
_BIT_MASK_ENABLE_EN = const(0x01)
|
||||
_BIT_MASK_ENABLE_COLOR = const(0x02)
|
||||
_BIT_MASK_ENABLE_PROX = const(0x04)
|
||||
_BIT_MASK_ENABLE_PROX_INT = const(0x20)
|
||||
_BIT_MASK_ENABLE_GESTURE = const(0x40)
|
||||
_BIT_MASK_STATUS_AVALID = const(0x01)
|
||||
_BIT_MASK_STATUS_GINT = const(0x04)
|
||||
_BIT_MASK_GSTATUS_GFOV = const(0x02)
|
||||
_BIT_MASK_GCONF4_GFIFO_CLR = const(0x04)
|
||||
_BIT_POS_PERS_PPERS = const(4)
|
||||
_BIT_MASK_PERS_PPERS = const(0xF0)
|
||||
_BIT_POS_CONTROL_AGAIN = const(0)
|
||||
_BIT_MASK_CONTROL_AGAIN = const(3)
|
||||
_BIT_POS_CONTROL_PGAIN = const(2)
|
||||
_BIT_MASK_CONTROL_PGAIN = const(0x0C)
|
||||
_BIT_POS_GCONF2_GGAIN = const(5)
|
||||
_BIT_MASK_GCONF2_GGAIN = const(0x60)
|
||||
|
||||
class APDS9960:
|
||||
def __init__(self, i2c, address=0x39):
|
||||
self._device = i2c
|
||||
self._address = address
|
||||
self._select = [True,True,True]
|
||||
|
||||
if self._rreg(_APDS9960_ID) != _DEVICE_ID:
|
||||
raise AttributeError("Cannot find a APDS9960")
|
||||
|
||||
self.enable(True) # Re-enable sensor and wait 10ms for the power on delay to finish
|
||||
time.sleep(0.010)
|
||||
self._wreg(_APDS9960_GPENTH, 0x05) # Enter gesture engine at >= 5 proximity counts
|
||||
self._wreg(_APDS9960_GEXTH, 0x1E) # Exit gesture engine if all counts drop below 30
|
||||
self._wreg(_APDS9960_GCONF1, 0x82) # GEXPERS: 2 (4 cycles), GEXMSK: 0 (default) GFIFOTH: 2 (8 datasets)
|
||||
self._wreg(_APDS9960_GCONF2, 0x41) # GGAIN: 2 (4x), GLDRIVE: 100 mA (default), GWTIME: 1 (2.8ms)
|
||||
self._wreg(_APDS9960_GPULSE, 0x85) # GPULSE: 5 (6 pulses), GPLEN: 2 (16 us)
|
||||
self.color_integration_time(256) # ATIME: 256 (712ms color integration time, max count of 65535)
|
||||
|
||||
# method for reading and writing to I2C
|
||||
def _wreg(self, reg, val):
|
||||
'''Write memory address'''
|
||||
self._device.writeto_mem(self._address,reg,val.to_bytes(1, 'little'))
|
||||
|
||||
def _writecmdonly(self, val):
|
||||
"""Writes a command and 0 bytes of data to the I2C device"""
|
||||
self._device.writeto(self._address,val.to_bytes(1, 'little'))
|
||||
|
||||
def _rreg(self, reg,nbytes=1):
|
||||
'''Read memory address'''
|
||||
return self._device.readfrom_mem(self._address, reg, nbytes)[0] if nbytes<=1 else self._device.readfrom_mem(self._address, reg, nbytes)[0:nbytes]
|
||||
|
||||
def _get_bit(self, reg, mask):
|
||||
"""Gets a single bit value from the I2C device's register"""
|
||||
return bool(self._rreg(reg) & mask)
|
||||
|
||||
def _set_bit(self, reg, mask, value):
|
||||
"""Sets a single bit value in the I2C device's register"""
|
||||
buf=self._rreg(reg)
|
||||
buf= buf | mask if value else buf & ~mask
|
||||
self._wreg(reg,buf)
|
||||
|
||||
def _set_bits(self, reg, pos, mask, value):
|
||||
"""Sets a multi-bit value in the I2C device's register"""
|
||||
buf=self._rreg(reg)
|
||||
buf = (buf & ~mask) | (value << pos)
|
||||
self._wreg(reg,buf)
|
||||
|
||||
def _color_data16(self, reg):
|
||||
"""Sends a command and reads 2 bytes of data from the I2C device"""
|
||||
buf = self._rreg(reg,2)
|
||||
return buf[1] << 8 | buf[0]
|
||||
|
||||
def enable(self, value):
|
||||
"""sensor is enabled"""
|
||||
self._set_bit(_APDS9960_ENABLE, _BIT_MASK_ENABLE_EN, value)
|
||||
|
||||
def enable_proximity(self, value):
|
||||
"""sensor's proximity engine is enabled."""
|
||||
self._set_bit(_APDS9960_ENABLE, _BIT_MASK_ENABLE_PROX, value)
|
||||
|
||||
def proximity_gain(self, value):
|
||||
"""""Proximity sensor gain value"""
|
||||
# proximity_gain" "Gain Multiplier" "Note"
|
||||
# 0, "1x", "Power-on Default"
|
||||
# 1, "2x", ""
|
||||
# 2, "4x", ""
|
||||
# 3, "8x", ""
|
||||
self._set_bits(_APDS9960_CONTROL, _BIT_POS_CONTROL_PGAIN, _BIT_MASK_CONTROL_PGAIN, value)
|
||||
|
||||
def enable_gesture(self, value):
|
||||
"""sensor's gesture engine is enabled"""
|
||||
self._set_bit(_APDS9960_ENABLE, _BIT_MASK_ENABLE_GESTURE, value)
|
||||
|
||||
def gesture_gain(self, value):
|
||||
"""Gesture mode gain value"""
|
||||
# "gesture_gain" "Gain Multiplier" "Note"
|
||||
# 0, "1x", "Power-on Default"
|
||||
# 1, "2x", ""
|
||||
# 2, "4x", "Driver Default"
|
||||
# 3, "8x", ""
|
||||
self._set_bits(_APDS9960_GCONF2, _BIT_POS_GCONF2_GGAIN, _BIT_MASK_GCONF2_GGAIN, value)
|
||||
|
||||
def enable_color(self, value):
|
||||
"""sensor's color/light engine is enabled"""
|
||||
self._set_bit(_APDS9960_ENABLE, _BIT_MASK_ENABLE_COLOR, value)
|
||||
|
||||
def color_gain(self, value):
|
||||
"""Color/light sensor gain value"""
|
||||
# "color_gain" "Gain Multiplier" "Note"
|
||||
# 0, "1x", "Power-on Default"
|
||||
# 1, "4x", "Driver Default"
|
||||
# 2, "16x", ""
|
||||
# 3, "64x", ""
|
||||
self._set_bits(_APDS9960_CONTROL, _BIT_POS_CONTROL_AGAIN, _BIT_MASK_CONTROL_AGAIN, value)
|
||||
|
||||
def color_integration_time(self, value):
|
||||
"""Color/light sensor gain"""
|
||||
# "color_integration_time" "Time" "Max Count" "Note"
|
||||
# 1, "2.78 ms", 1025, "Power-on Default"
|
||||
# 10, "27.8 ms", 10241, ""
|
||||
# 37, "103 ms", 37889, ""
|
||||
# 72, "200 ms", 65535, ""
|
||||
# 256, "712 ms", 65535, "Driver Default"
|
||||
self._wreg(_APDS9960_ATIME, 256 - value)
|
||||
|
||||
## PROXIMITY
|
||||
def proximity(self,gain=2):
|
||||
"""Proximity sensor data"""
|
||||
if self._select[0]:
|
||||
self._select=[False,True,True]
|
||||
self.enable_proximity(True)
|
||||
self.enable_gesture(False)
|
||||
self.enable_color(False)
|
||||
self.proximity_gain(gain)
|
||||
|
||||
return self._rreg(_APDS9960_PDATA)
|
||||
|
||||
## GESTURE
|
||||
def gesture(self,gain=3):
|
||||
"""Gesture sensor data"""
|
||||
# If FIFOs have overflowed we're already way too late, so clear those FIFOs and wait
|
||||
if self._select[1]:
|
||||
self._select=[True,False,True]
|
||||
self.enable_proximity(True)
|
||||
self.enable_gesture(True)
|
||||
self.enable_color(False)
|
||||
self.gesture_gain(gain)
|
||||
|
||||
if self._get_bit(_APDS9960_GSTATUS, _BIT_MASK_GSTATUS_GFOV):
|
||||
self._set_bit(_APDS9960_GCONF4, _BIT_MASK_GCONF4_GFIFO_CLR, True)
|
||||
wait_cycles = 0
|
||||
while ( not self._get_bit(_APDS9960_STATUS, _BIT_MASK_STATUS_GINT) and wait_cycles <= 30 ):
|
||||
time.sleep(0.003)
|
||||
wait_cycles += 1
|
||||
|
||||
frame = []
|
||||
datasets_available = self._rreg(_APDS9960_GFLVL)
|
||||
if (self._get_bit(_APDS9960_STATUS, _BIT_MASK_STATUS_GINT) and datasets_available > 0 ):
|
||||
|
||||
buffer = bytearray(128)
|
||||
buffer_dataset = bytearray(4)
|
||||
while True:
|
||||
dataset_count = self._rreg(_APDS9960_GFLVL)
|
||||
if dataset_count == 0:
|
||||
break
|
||||
buffer=self._rreg(_APDS9960_GFIFO_U,min(128, 1 + (dataset_count * 4)))
|
||||
# Unpack data stream into more usable U/D/L/R datasets for analysis
|
||||
idx = 0
|
||||
for i in range(dataset_count):
|
||||
idx = i * 4
|
||||
buffer_dataset[0] = buffer[idx]
|
||||
buffer_dataset[1] = buffer[idx + 1]
|
||||
buffer_dataset[2] = buffer[idx + 2]
|
||||
buffer_dataset[3] = buffer[idx + 3]
|
||||
|
||||
if ((not all(val == 255 for val in buffer_dataset))
|
||||
and (not all(val == 0 for val in buffer_dataset))
|
||||
and (all(val >= 30 for val in buffer_dataset))
|
||||
):
|
||||
if len(frame) < 2:
|
||||
frame.append(tuple(buffer_dataset))
|
||||
else:
|
||||
frame[1] = tuple(buffer_dataset)
|
||||
time.sleep(0.03)
|
||||
if len(frame) < 2:
|
||||
return None
|
||||
# Determine our up/down and left/right ratios along with our first/last deltas
|
||||
f_r_ud = ((frame[0][0] - frame[0][1]) * 100) // (frame[0][0] + frame[0][1])
|
||||
f_r_lr = ((frame[0][2] - frame[0][3]) * 100) // (frame[0][2] + frame[0][3])
|
||||
l_r_ud = ((frame[1][0] - frame[1][1]) * 100) // (frame[1][0] + frame[1][1])
|
||||
l_r_lr = ((frame[1][2] - frame[1][3]) * 100) // (frame[1][2] + frame[1][3])
|
||||
delta_ud = l_r_ud - f_r_ud
|
||||
delta_lr = l_r_lr - f_r_lr
|
||||
# Make our first guess at what gesture we saw, if any
|
||||
state_ud = 0
|
||||
state_lr = 0
|
||||
if delta_ud >= 30:
|
||||
state_ud = 1
|
||||
elif delta_ud <= -30:
|
||||
state_ud = -1
|
||||
|
||||
if delta_lr >= 30:
|
||||
state_lr = 1
|
||||
elif delta_lr <= -30:
|
||||
state_lr = -1
|
||||
# Make our final decision based on our first guess and, if required, the delta data
|
||||
gesture_found = 0
|
||||
# Easy cases
|
||||
if state_ud == -1 and state_lr == 0:
|
||||
gesture_found = 1
|
||||
elif state_ud == 1 and state_lr == 0:
|
||||
gesture_found = 2
|
||||
elif state_ud == 0 and state_lr == -1:
|
||||
gesture_found = 3
|
||||
elif state_ud == 0 and state_lr == 1:
|
||||
gesture_found = 4
|
||||
# Not so easy cases
|
||||
if gesture_found == 0:
|
||||
if state_ud == -1 and state_lr == 1:
|
||||
if abs(delta_ud) > abs(delta_lr):
|
||||
gesture_found = 1
|
||||
else:
|
||||
gesture_found = 4
|
||||
elif state_ud == 1 and state_lr == -1:
|
||||
if abs(delta_ud) > abs(delta_lr):
|
||||
gesture_found = 2
|
||||
else:
|
||||
gesture_found = 3
|
||||
elif state_ud == -1 and state_lr == -1:
|
||||
if abs(delta_ud) > abs(delta_lr):
|
||||
gesture_found = 1
|
||||
else:
|
||||
gesture_found = 3
|
||||
elif state_ud == 1 and state_lr == 1:
|
||||
if abs(delta_ud) > abs(delta_lr):
|
||||
gesture_found = 2
|
||||
else:
|
||||
gesture_found = 3
|
||||
|
||||
dir_lookup = [None,"left", "right", "down", "up"]
|
||||
return dir_lookup[gesture_found]
|
||||
|
||||
## COLOR
|
||||
def color(self,gain=1):
|
||||
"""Tuple containing red, green, blue, and clear light intensity values"""
|
||||
if self._select[2]:
|
||||
self._select=[True,True,False]
|
||||
self.enable_proximity(False)
|
||||
self.enable_gesture(False)
|
||||
self.enable_color(True)
|
||||
self.color_gain(gain)
|
||||
|
||||
while not self._get_bit(_APDS9960_STATUS, _BIT_MASK_STATUS_AVALID):
|
||||
time.sleep(0.005) #"""Color data ready flag"""
|
||||
return (
|
||||
self._color_data16(_APDS9960_CDATAL + 2),
|
||||
self._color_data16(_APDS9960_CDATAL + 4),
|
||||
self._color_data16(_APDS9960_CDATAL + 6),
|
||||
self._color_data16(_APDS9960_CDATAL),
|
||||
)
|
||||
114
boards/default/micropython/build/lib/baidu_speech.py
Normal file
114
boards/default/micropython/build/lib/baidu_speech.py
Normal file
@@ -0,0 +1,114 @@
|
||||
"""
|
||||
Baidu ASR API
|
||||
|
||||
MicroPython library for Baidu ASR API
|
||||
=======================================================
|
||||
|
||||
#Preliminary composition 20230223
|
||||
#https://ai.baidu.com/ai-doc/SPEECH/Ek39uxgre
|
||||
#https://ai.baidu.com/unit/home#/home
|
||||
|
||||
@dahanzimin From the Mixly Team
|
||||
"""
|
||||
|
||||
import json,gc
|
||||
import urequests,array
|
||||
from ubinascii import hexlify
|
||||
from machine import Timer,unique_id
|
||||
|
||||
'''Set constant'''
|
||||
_framerate=8000
|
||||
_unique_id=hexlify(unique_id()).decode()
|
||||
|
||||
def urequests_api(method, url, **kw):
|
||||
'''Request data'''
|
||||
try:
|
||||
return json.loads(urequests.request(method, url, **kw).text)
|
||||
except Exception as e:
|
||||
raise RuntimeError("API request failed or WiFi is not connected",e)
|
||||
|
||||
def fetch_token(API_Key,Secret_Key):
|
||||
"""Get access_token"""
|
||||
url='http://aip.baidubce.com/oauth/2.0/token?grant_type=client_credentials&client_id={}&client_secret={}'.format(API_Key,Secret_Key)
|
||||
results=urequests_api("GET",url)
|
||||
if "error_description" in results.keys():
|
||||
raise ValueError(results["error_description"])
|
||||
if "access_token" in results.keys():
|
||||
return results["access_token"]
|
||||
|
||||
class Recorder:
|
||||
def __init__(self, adc,timer=2):
|
||||
self._timer=Timer(timer)
|
||||
self._mic=adc
|
||||
|
||||
def _timer_callback(self,timer):
|
||||
'''Timer callback read microphone'''
|
||||
try:
|
||||
_mic=self._mic.read_u16()-32768
|
||||
self._pcm_buffer.append(_mic &0xFF)
|
||||
self._pcm_buffer.append(_mic >>8)
|
||||
self._record_time-=1
|
||||
except:
|
||||
print("Warning: MemoryError!")
|
||||
self._pcm_buffer=bytearray()
|
||||
gc.collect()
|
||||
self._record_time=0
|
||||
|
||||
def record(self,record_time=1):
|
||||
"""Call timer to record audio"""
|
||||
self._pcm_buffer=bytearray()
|
||||
gc.collect()
|
||||
self._record_time=record_time*_framerate
|
||||
self._timer.init(freq =_framerate, mode = Timer.PERIODIC, callback = self._timer_callback)
|
||||
while True:
|
||||
if self._record_time <= 0:
|
||||
self._timer.deinit()
|
||||
gc.collect()
|
||||
return self._pcm_buffer
|
||||
|
||||
class ASR(Recorder):
|
||||
def __init__(self, adc, API_Key, Secret_Key, timer=2):
|
||||
self._token=fetch_token(API_Key,Secret_Key)
|
||||
super().__init__(adc,timer)
|
||||
|
||||
def recognize(self,record_time=1,dev_pid=1537):
|
||||
"""Access API to get voice results"""
|
||||
pcm_buffer=self.record(record_time)
|
||||
if max(pcm_buffer)>=250:
|
||||
url='http://vop.baidu.com/server_api?dev_pid={}&cuid={}&token={}'.format(dev_pid,_unique_id,self._token)
|
||||
headers = {'Content-Type': 'audio/pcm; rate={}'.format(_framerate)}
|
||||
results=urequests_api("POST",url,data=pcm_buffer,headers=headers)
|
||||
if results["err_no"] != 0:
|
||||
raise ValueError(results["err_msg"],results["err_no"])
|
||||
elif results["err_msg"] == "success.":
|
||||
gc.collect()
|
||||
return results["result"][0]
|
||||
else:
|
||||
return ''
|
||||
|
||||
class UNIT:
|
||||
def __init__(self, API_Key, Secret_Key):
|
||||
self._token=fetch_token(API_Key,Secret_Key)
|
||||
self._session_id=""
|
||||
|
||||
def chatbot(self,chatbot_id,query):
|
||||
"""Access API to intelligent dialog"""
|
||||
if len(query) > 0:
|
||||
url='https://aip.baidubce.com/rpc/2.0/unit/service/v3/chat?access_token={}'.format(self._token)
|
||||
data={"log_id":"log"+_unique_id,
|
||||
"version":"3.0",
|
||||
"service_id":chatbot_id,
|
||||
"session_id":self._session_id,
|
||||
"request":{"query":query,"terminal_id":_unique_id}}
|
||||
headers = {"content-type": "application/json"}
|
||||
results=urequests_api("POST",url,data=json.dumps(data).encode(),headers=headers)
|
||||
if results["error_code"] != 0:
|
||||
raise ValueError(results["error_msg"],results["error_code"])
|
||||
elif results["error_msg"] == "success":
|
||||
self._session_id=results["result"]['session_id']
|
||||
gc.collect()
|
||||
return results["result"]['responses'][0]['actions'][0]['say']
|
||||
else:
|
||||
return ''
|
||||
|
||||
gc.collect()
|
||||
79
boards/default/micropython/build/lib/ble_advertising.py
Normal file
79
boards/default/micropython/build/lib/ble_advertising.py
Normal file
@@ -0,0 +1,79 @@
|
||||
# Helpers for generating BLE advertising payloads.
|
||||
|
||||
from micropython import const
|
||||
import struct
|
||||
import bluetooth
|
||||
|
||||
# Advertising payloads are repeated packets of the following form:
|
||||
# 1 byte data length (N + 1)
|
||||
# 1 byte type (see constants below)
|
||||
# N bytes type-specific data
|
||||
|
||||
_ADV_TYPE_FLAGS = const(0x01)
|
||||
_ADV_TYPE_NAME = const(0x09)
|
||||
_ADV_TYPE_UUID16_COMPLETE = const(0x3)
|
||||
_ADV_TYPE_UUID32_COMPLETE = const(0x5)
|
||||
_ADV_TYPE_UUID128_COMPLETE = const(0x7)
|
||||
_ADV_TYPE_UUID16_MORE = const(0x2)
|
||||
_ADV_TYPE_UUID32_MORE = const(0x4)
|
||||
_ADV_TYPE_UUID128_MORE = const(0x6)
|
||||
_ADV_TYPE_APPEARANCE = const(0x19)
|
||||
|
||||
|
||||
# Generate a payload to be passed to gap_advertise(adv_data=...).
|
||||
def advertising_payload(limited_disc=False, br_edr=False, name=None, services=None, appearance=0):
|
||||
payload = bytearray()
|
||||
|
||||
def _append(adv_type, value):
|
||||
nonlocal payload
|
||||
payload += struct.pack("BB", len(value) + 1, adv_type) + value
|
||||
|
||||
_append(
|
||||
_ADV_TYPE_FLAGS,
|
||||
struct.pack("B", (0x01 if limited_disc else 0x02) + (0x18 if br_edr else 0x04)),
|
||||
)
|
||||
|
||||
if name:
|
||||
_append(_ADV_TYPE_NAME, name.encode())
|
||||
|
||||
if services:
|
||||
for uuid in services:
|
||||
b = bytes(uuid)
|
||||
if len(b) == 2:
|
||||
_append(_ADV_TYPE_UUID16_COMPLETE, b)
|
||||
elif len(b) == 4:
|
||||
_append(_ADV_TYPE_UUID32_COMPLETE, b)
|
||||
elif len(b) == 16:
|
||||
_append(_ADV_TYPE_UUID128_COMPLETE, b)
|
||||
|
||||
# See org.bluetooth.characteristic.gap.appearance.xml
|
||||
if appearance:
|
||||
_append(_ADV_TYPE_APPEARANCE, struct.pack("<h", appearance))
|
||||
|
||||
return payload
|
||||
|
||||
|
||||
def decode_field(payload, adv_type):
|
||||
i = 0
|
||||
result = []
|
||||
while i + 1 < len(payload):
|
||||
if payload[i + 1] == adv_type:
|
||||
result.append(payload[i + 2 : i + payload[i] + 1])
|
||||
i += 1 + payload[i]
|
||||
return result
|
||||
|
||||
|
||||
def decode_name(payload):
|
||||
n = decode_field(payload, _ADV_TYPE_NAME)
|
||||
return str(n[0], "utf-8") if n else ""
|
||||
|
||||
|
||||
def decode_services(payload):
|
||||
services = []
|
||||
for u in decode_field(payload, _ADV_TYPE_UUID16_COMPLETE):
|
||||
services.append(bluetooth.UUID(struct.unpack("<h", u)[0]))
|
||||
for u in decode_field(payload, _ADV_TYPE_UUID32_COMPLETE):
|
||||
services.append(bluetooth.UUID(struct.unpack("<d", u)[0]))
|
||||
for u in decode_field(payload, _ADV_TYPE_UUID128_COMPLETE):
|
||||
services.append(bluetooth.UUID(u))
|
||||
return services
|
||||
217
boards/default/micropython/build/lib/ble_central.py
Normal file
217
boards/default/micropython/build/lib/ble_central.py
Normal file
@@ -0,0 +1,217 @@
|
||||
"""
|
||||
Bluetooth-Central
|
||||
|
||||
Micropython library for the Bluetooth-Central
|
||||
=======================================================
|
||||
#Preliminary composition 20221018
|
||||
#https://github.com/micropython/micropython/tree/master/examples/bluetooth
|
||||
|
||||
dahanzimin From the Mixly Team
|
||||
"""
|
||||
import time,gc
|
||||
import bluetooth
|
||||
from micropython import const
|
||||
from ubinascii import hexlify,unhexlify
|
||||
from ble_advertising import decode_services, decode_name
|
||||
|
||||
_IRQ_CENTRAL_CONNECT = const(1)
|
||||
_IRQ_CENTRAL_DISCONNECT = const(2)
|
||||
_IRQ_GATTS_WRITE = const(3)
|
||||
_IRQ_GATTS_READ_REQUEST = const(4)
|
||||
_IRQ_SCAN_RESULT = const(5)
|
||||
_IRQ_SCAN_DONE = const(6)
|
||||
_IRQ_PERIPHERAL_CONNECT = const(7)
|
||||
_IRQ_PERIPHERAL_DISCONNECT = const(8)
|
||||
_IRQ_GATTC_SERVICE_RESULT = const(9)
|
||||
_IRQ_GATTC_SERVICE_DONE = const(10)
|
||||
_IRQ_GATTC_CHARACTERISTIC_RESULT = const(11)
|
||||
_IRQ_GATTC_CHARACTERISTIC_DONE = const(12)
|
||||
_IRQ_GATTC_DESCRIPTOR_RESULT = const(13)
|
||||
_IRQ_GATTC_DESCRIPTOR_DONE = const(14)
|
||||
_IRQ_GATTC_READ_RESULT = const(15)
|
||||
_IRQ_GATTC_READ_DONE = const(16)
|
||||
_IRQ_GATTC_WRITE_DONE = const(17)
|
||||
_IRQ_GATTC_NOTIFY = const(18)
|
||||
_IRQ_GATTC_INDICATE = const(19)
|
||||
|
||||
_ADV_IND = const(0x00)
|
||||
_ADV_DIRECT_IND = const(0x01)
|
||||
_ADV_SCAN_IND = const(0x02)
|
||||
_ADV_NONCONN_IND = const(0x03)
|
||||
|
||||
_UART_SERVICE_UUID = bluetooth.UUID(0x1101)
|
||||
_UART_RX_CHAR_UUID = bluetooth.UUID("6E400002-B5A3-F393-E0A9-E50E24DCCA9E")
|
||||
_UART_TX_CHAR_UUID = bluetooth.UUID("6E400003-B5A3-F393-E0A9-E50E24DCCA9E")
|
||||
|
||||
|
||||
class BLESimpleCentral:
|
||||
def __init__(self):
|
||||
self._ble = bluetooth.BLE()
|
||||
self._scan_flg = True
|
||||
self._ble.active(True)
|
||||
self._ble.irq(self._irq)
|
||||
self._reset()
|
||||
self.scan()
|
||||
|
||||
def _reset(self):
|
||||
# Cached name and address from a successful scan.
|
||||
self._name = None
|
||||
self._addr_type = None
|
||||
self._addr = None
|
||||
|
||||
# Callbacks for completion of various operations.
|
||||
# These reset back to None after being invoked.
|
||||
self._conn_callback = None
|
||||
self._read_callback = None
|
||||
|
||||
# Persistent callback for when new data is notified from the device.
|
||||
self._notify_callback = None
|
||||
self._write_data=None
|
||||
|
||||
# Connected device.
|
||||
self._conn_handle = None
|
||||
self._start_handle = None
|
||||
self._end_handle = None
|
||||
self._tx_handle = None
|
||||
self._rx_handle = None
|
||||
|
||||
def _irq(self, event, data):
|
||||
if event == _IRQ_SCAN_RESULT:
|
||||
addr_type, addr, adv_type, rssi, adv_data = data
|
||||
|
||||
if adv_type in (_ADV_IND, _ADV_DIRECT_IND) and _UART_SERVICE_UUID in decode_services(adv_data):
|
||||
# Found a potential device, remember it and stop scanning.
|
||||
self._addr_type = addr_type
|
||||
self._addr = bytes(addr) # Note: addr buffer is owned by caller so need to copy it.
|
||||
self._name = decode_name(adv_data) or "?"
|
||||
if self._addr in self._info[2]:
|
||||
self._ble.gap_scan(None)
|
||||
else:
|
||||
self._info[0].append(self._name)
|
||||
self._info[1].append(self._addr_type)
|
||||
self._info[2].append(self._addr)
|
||||
self._info[3].append(rssi)
|
||||
|
||||
elif event == _IRQ_SCAN_DONE:
|
||||
self._scan_flg = False
|
||||
|
||||
elif event == _IRQ_PERIPHERAL_CONNECT:
|
||||
# Connect successful.
|
||||
conn_handle, addr_type, addr = data
|
||||
if addr_type == self._addr_type and addr == self._addr:
|
||||
self._conn_handle = conn_handle
|
||||
self._ble.gattc_discover_services(self._conn_handle)
|
||||
|
||||
elif event == _IRQ_PERIPHERAL_DISCONNECT:
|
||||
# Disconnect (either initiated by us or the remote end).
|
||||
conn_handle, _, _ = data
|
||||
if conn_handle == self._conn_handle:
|
||||
# If it was initiated by us, it'll already be reset.
|
||||
self._reset()
|
||||
|
||||
elif event == _IRQ_GATTC_SERVICE_RESULT:
|
||||
# Connected device returned a service.
|
||||
conn_handle, start_handle, end_handle, uuid = data
|
||||
print("service", data)
|
||||
if conn_handle == self._conn_handle and uuid == _UART_SERVICE_UUID:
|
||||
self._start_handle, self._end_handle = start_handle, end_handle
|
||||
|
||||
elif event == _IRQ_GATTC_SERVICE_DONE:
|
||||
# Service query complete.
|
||||
if self._start_handle and self._end_handle:
|
||||
self._ble.gattc_discover_characteristics(
|
||||
self._conn_handle, self._start_handle, self._end_handle
|
||||
)
|
||||
else:
|
||||
print("Failed to find uart service.")
|
||||
|
||||
elif event == _IRQ_GATTC_CHARACTERISTIC_RESULT:
|
||||
# Connected device returned a characteristic.
|
||||
conn_handle, def_handle, value_handle, properties, uuid = data
|
||||
if conn_handle == self._conn_handle and uuid == _UART_RX_CHAR_UUID:
|
||||
self._rx_handle = value_handle
|
||||
if conn_handle == self._conn_handle and uuid == _UART_TX_CHAR_UUID:
|
||||
self._tx_handle = value_handle
|
||||
|
||||
elif event == _IRQ_GATTC_CHARACTERISTIC_DONE:
|
||||
# Characteristic query complete.
|
||||
if self._tx_handle is not None and self._rx_handle is not None:
|
||||
# We've finished connecting and discovering device, fire the connect callback.
|
||||
if self._conn_callback:
|
||||
self._conn_callback()
|
||||
else:
|
||||
print("Failed to find uart rx characteristic.")
|
||||
|
||||
elif event == _IRQ_GATTC_WRITE_DONE:
|
||||
conn_handle, value_handle, status = data
|
||||
print("TX complete")
|
||||
|
||||
elif event == _IRQ_GATTC_NOTIFY:
|
||||
conn_handle, value_handle, notify_data = data
|
||||
if conn_handle == self._conn_handle and value_handle == self._tx_handle:
|
||||
try:
|
||||
self._write_data=bytes(notify_data).decode().strip()
|
||||
except:
|
||||
self._write_data=bytes(notify_data)
|
||||
if self._notify_callback:
|
||||
self._notify_callback(self._write_data)
|
||||
|
||||
# Returns true if we've successfully connected and discovered characteristics.
|
||||
def is_connected(self):
|
||||
return (self._conn_handle is not None and self._tx_handle is not None and self._rx_handle is not None)
|
||||
|
||||
# Find a device advertising the environmental sensor service.
|
||||
def scan(self):
|
||||
self._info = [[],[],[],[]]
|
||||
self._ble.gap_scan(10000, 30000, 30000)
|
||||
while self._scan_flg:
|
||||
time.sleep_ms(10)
|
||||
self._scan_flg = True
|
||||
info=[]
|
||||
for i in range(len(self._info[0])):
|
||||
info.append([self._info[0][i],self._info[1][i],hexlify(self._info[2][i]).decode(),self._info[3][i]])
|
||||
return info
|
||||
|
||||
# Connect to the specified device (otherwise use cached address from a scan).
|
||||
def connect(self, name=None,mac=None, callback=None):
|
||||
if mac and unhexlify(mac) in self._info[2]:
|
||||
index=self._info[2].index(unhexlify(mac))
|
||||
self._addr_type=self._info[1][index]
|
||||
self._addr=unhexlify(mac)
|
||||
elif name and name in self._info[0]:
|
||||
index=self._info[0].index(name)
|
||||
self._addr_type=self._info[1][index]
|
||||
self._addr=self._info[2][index]
|
||||
else:
|
||||
raise ValueError("Bluetooth was not found")
|
||||
self._conn_callback = callback
|
||||
self._ble.gap_connect(self._addr_type, self._addr)
|
||||
return True
|
||||
|
||||
# Disconnect from current device.
|
||||
def disconnect(self):
|
||||
if not self._conn_handle:
|
||||
return
|
||||
self._ble.gap_disconnect(self._conn_handle)
|
||||
self._reset()
|
||||
gc.collect()
|
||||
|
||||
# Send data over the UART
|
||||
def send(self, v, response=False):
|
||||
if not self.is_connected():
|
||||
return
|
||||
self._ble.gattc_write(self._conn_handle, self._rx_handle, v, 1 if response else 0)
|
||||
|
||||
# Set handler for when data is received over the UART.
|
||||
def recv(self, callback= None):
|
||||
if callback:
|
||||
self._notify_callback = callback
|
||||
else:
|
||||
write_data=self._write_data
|
||||
self._write_data=None
|
||||
return write_data
|
||||
|
||||
@property
|
||||
def mac(self):
|
||||
'''Get mac address'''
|
||||
return hexlify(self._ble.config('mac')[1]).decode()
|
||||
37
boards/default/micropython/build/lib/ble_handle.py
Normal file
37
boards/default/micropython/build/lib/ble_handle.py
Normal file
@@ -0,0 +1,37 @@
|
||||
"""
|
||||
Bluetooth remote control handle
|
||||
|
||||
Micropython library for the Bluetooth remote control handle
|
||||
=======================================================
|
||||
#Preliminary composition 202200704
|
||||
|
||||
dahanzimin From the Mixly Team
|
||||
"""
|
||||
|
||||
from ble_peripheral import BLESimplePeripheral
|
||||
|
||||
class Handle(BLESimplePeripheral):
|
||||
def __init__(self):
|
||||
super().__init__(name="TUDAO_MASTER")
|
||||
self._buffer=bytearray(14)
|
||||
|
||||
def _receive_cb(self, data):
|
||||
if self._on_receive:
|
||||
if data !=self._buffer:
|
||||
self._buffer=data
|
||||
key=self._deal(self._buffer)
|
||||
self._on_receive(key[0],key[1],key[2],key[3])
|
||||
|
||||
def recv(self,callback):
|
||||
self._on_receive = callback
|
||||
if callback:
|
||||
super().recv(self._receive_cb)
|
||||
|
||||
def _u2s(self,n):
|
||||
return n if n < (1 << 7) else n - (1 << 8)
|
||||
|
||||
def _deal(self,data):
|
||||
if data[0]== 0xff and data[1]== 0xfe and data[12]== 0xfd and data[13]== 0xfc:
|
||||
return self._u2s(data[5]),self._u2s(data[6]),self._u2s(data[7]),self._u2s(data[8])
|
||||
else:
|
||||
return None,None,None,None
|
||||
91
boards/default/micropython/build/lib/ble_peripheral.py
Normal file
91
boards/default/micropython/build/lib/ble_peripheral.py
Normal file
@@ -0,0 +1,91 @@
|
||||
"""
|
||||
Bluetooth-Peripheral
|
||||
|
||||
Micropython library for the Bluetooth-Peripheral
|
||||
=======================================================
|
||||
#Preliminary composition 20221018
|
||||
#https://github.com/micropython/micropython/tree/master/examples/bluetooth
|
||||
|
||||
dahanzimin From the Mixly Team
|
||||
"""
|
||||
|
||||
import bluetooth
|
||||
from micropython import const
|
||||
from ubinascii import hexlify
|
||||
from ble_advertising import advertising_payload
|
||||
|
||||
_IRQ_CENTRAL_CONNECT = const(1)
|
||||
_IRQ_CENTRAL_DISCONNECT = const(2)
|
||||
_IRQ_GATTS_WRITE = const(3)
|
||||
|
||||
_FLAG_READ = const(0x0002)
|
||||
_FLAG_WRITE_NO_RESPONSE = const(0x0004)
|
||||
_FLAG_WRITE = const(0x0008)
|
||||
_FLAG_NOTIFY = const(0x0010)
|
||||
|
||||
_UART_UUID = bluetooth.UUID(0x1101)
|
||||
_UART_TX = (bluetooth.UUID("6E400003-B5A3-F393-E0A9-E50E24DCCA9E"),_FLAG_READ | _FLAG_NOTIFY,)
|
||||
_UART_RX = (bluetooth.UUID("6E400002-B5A3-F393-E0A9-E50E24DCCA9E"),_FLAG_WRITE | _FLAG_WRITE_NO_RESPONSE,)
|
||||
_UART_SERVICE = (_UART_UUID,(_UART_TX, _UART_RX),)
|
||||
|
||||
class BLESimplePeripheral:
|
||||
def __init__(self, name=None):
|
||||
self._ble = bluetooth.BLE()
|
||||
self._ble.active(True)
|
||||
self._ble.irq(self._irq)
|
||||
((self._handle_tx, self._handle_rx),) = self._ble.gatts_register_services((_UART_SERVICE,))
|
||||
self._connections = set()
|
||||
self._write_callback = None
|
||||
self._write_data = None
|
||||
if (name is '') or (name is None):
|
||||
name = "Mixgo_" + self.mac[-6:].upper()
|
||||
print("Bluetooth name:", name)
|
||||
self._payload = advertising_payload(name=name, services=[_UART_UUID])
|
||||
self._advertise()
|
||||
|
||||
def _irq(self, event, data):
|
||||
# Track connections so we can send notifications.
|
||||
if event == _IRQ_CENTRAL_CONNECT:
|
||||
conn_handle, _, _ = data
|
||||
print("New connection", conn_handle)
|
||||
self._connections.add(conn_handle)
|
||||
elif event == _IRQ_CENTRAL_DISCONNECT:
|
||||
conn_handle, _, _ = data
|
||||
print("Disconnected", conn_handle)
|
||||
self._connections.remove(conn_handle)
|
||||
# Start advertising again to allow a new connection.
|
||||
self._advertise()
|
||||
elif event == _IRQ_GATTS_WRITE:
|
||||
conn_handle, value_handle = data
|
||||
value = self._ble.gatts_read(value_handle)
|
||||
if value_handle == self._handle_rx:
|
||||
try:
|
||||
self._write_data=value.decode().strip()
|
||||
except:
|
||||
self._write_data=value
|
||||
if self._write_callback:
|
||||
self._write_callback(self._write_data)
|
||||
|
||||
def send(self, data):
|
||||
for conn_handle in self._connections:
|
||||
self._ble.gatts_notify(conn_handle, self._handle_tx, data)
|
||||
|
||||
def is_connected(self):
|
||||
return len(self._connections) > 0
|
||||
|
||||
def _advertise(self, interval_us=500000):
|
||||
print("Starting advertising")
|
||||
self._ble.gap_advertise(interval_us, adv_data=self._payload)
|
||||
|
||||
def recv(self, callback= None):
|
||||
if callback:
|
||||
self._write_callback = callback
|
||||
else:
|
||||
write_data=self._write_data
|
||||
self._write_data=None
|
||||
return write_data
|
||||
|
||||
@property
|
||||
def mac(self):
|
||||
'''Get mac address'''
|
||||
return hexlify(self._ble.config('mac')[1]).decode()
|
||||
86
boards/default/micropython/build/lib/ble_uart_peripheral.py
Normal file
86
boards/default/micropython/build/lib/ble_uart_peripheral.py
Normal file
@@ -0,0 +1,86 @@
|
||||
"""
|
||||
Bluetooth-uart-Peripheral
|
||||
|
||||
Micropython library for the Bluetooth-uart-Peripheral
|
||||
=======================================================
|
||||
#Preliminary composition 202200628
|
||||
#https://github.com/micropython/micropython/tree/master/examples/bluetooth
|
||||
|
||||
dahanzimin From the Mixly Team
|
||||
"""
|
||||
|
||||
import bluetooth
|
||||
from ble_advertising import advertising_payload
|
||||
from micropython import const
|
||||
|
||||
_IRQ_CENTRAL_CONNECT = const(1)
|
||||
_IRQ_CENTRAL_DISCONNECT = const(2)
|
||||
_IRQ_GATTS_WRITE = const(3)
|
||||
|
||||
_FLAG_READ = const(0x0002)
|
||||
_FLAG_WRITE_NO_RESPONSE = const(0x0004)
|
||||
_FLAG_WRITE = const(0x0008)
|
||||
_FLAG_NOTIFY = const(0x0010)
|
||||
|
||||
_UART_UUID = bluetooth.UUID("0000fff0-0000-1000-8000-00805f9b34fb")
|
||||
_UART_TX = (bluetooth.UUID("0000fff1-0000-1000-8000-00805f9b34fb"),_FLAG_READ | _FLAG_NOTIFY,)
|
||||
_UART_RX = (bluetooth.UUID("0000fff2-0000-1000-8000-00805f9b34fb"),_FLAG_WRITE | _FLAG_WRITE_NO_RESPONSE,)
|
||||
_UART_SERVICE = (_UART_UUID,(_UART_TX, _UART_RX),)
|
||||
|
||||
class BLEUART:
|
||||
def __init__(self, name="mpy-uart", rxbuf=100):
|
||||
self._ble = bluetooth.BLE()
|
||||
self._ble.active(True)
|
||||
self._ble.irq(self._irq)
|
||||
((self._tx_handle, self._rx_handle),) = self._ble.gatts_register_services((_UART_SERVICE,))
|
||||
self._ble.gatts_set_buffer(self._rx_handle, rxbuf, True)
|
||||
self._connections = set()
|
||||
self._rx_buffer = bytearray()
|
||||
self._handler = None
|
||||
self._payload = advertising_payload(name=name, services=[_UART_UUID])
|
||||
self._advertise()
|
||||
|
||||
def irq(self, handler):
|
||||
self._handler = handler
|
||||
|
||||
def _irq(self, event, data):
|
||||
# Track connections so we can send notifications.
|
||||
if event == _IRQ_CENTRAL_CONNECT:
|
||||
conn_handle, _, _ = data
|
||||
print("Bluetooth connected")
|
||||
self._connections.add(conn_handle)
|
||||
elif event == _IRQ_CENTRAL_DISCONNECT:
|
||||
conn_handle, _, _ = data
|
||||
print("Bluetooth disconnected")
|
||||
if conn_handle in self._connections:
|
||||
self._connections.remove(conn_handle)
|
||||
# Start advertising again to allow a new connection.
|
||||
self._advertise()
|
||||
elif event == _IRQ_GATTS_WRITE:
|
||||
conn_handle, value_handle = data
|
||||
if conn_handle in self._connections and value_handle == self._rx_handle:
|
||||
self._rx_buffer += self._ble.gatts_read(self._rx_handle)
|
||||
if self._handler:
|
||||
self._handler()
|
||||
|
||||
def any(self):
|
||||
return len(self._rx_buffer)
|
||||
|
||||
def read(self, sz=None):
|
||||
if not sz:
|
||||
sz = len(self._rx_buffer)
|
||||
result = self._rx_buffer[0:sz]
|
||||
self._rx_buffer = self._rx_buffer[sz:]
|
||||
return result
|
||||
|
||||
def write(self, data):
|
||||
for conn_handle in self._connections:
|
||||
self._ble.gatts_notify(conn_handle, self._tx_handle, data)
|
||||
|
||||
def close(self):
|
||||
for conn_handle in self._connections:
|
||||
self._ble.gap_disconnect(conn_handle)
|
||||
self._connections.clear()
|
||||
|
||||
def _advertise(self, interval_us=500000):
|
||||
self._ble.gap_advertise(interval_us, adv_data=self._payload)
|
||||
67
boards/default/micropython/build/lib/ble_uart_repl.py
Normal file
67
boards/default/micropython/build/lib/ble_uart_repl.py
Normal file
@@ -0,0 +1,67 @@
|
||||
# Proof-of-concept of a REPL over BLE UART.
|
||||
# Set the EoL characters to \r\n.
|
||||
|
||||
import io
|
||||
import os
|
||||
from machine import Timer
|
||||
from micropython import schedule
|
||||
from ble_uart_peripheral import BLEUART
|
||||
|
||||
_MP_STREAM_POLL = const(3)
|
||||
_MP_STREAM_POLL_RD = const(0x0001)
|
||||
|
||||
# Batch writes into 50ms intervals.
|
||||
Define_timer = Timer(2)
|
||||
|
||||
def schedule_in(handler, delay_ms):
|
||||
def _wrap(_arg):
|
||||
handler()
|
||||
if Define_timer:
|
||||
Define_timer.init(mode=Timer.ONE_SHOT, period=delay_ms, callback=_wrap)
|
||||
else:
|
||||
schedule(_wrap, None)
|
||||
|
||||
# Simple buffering stream to support the dupterm requirements.
|
||||
class BLEUARTStream(io.IOBase):
|
||||
def __init__(self, name="mpy-repl"):
|
||||
self._uart = BLEUART(name)
|
||||
self._tx_buf = bytearray()
|
||||
self._uart.irq(self._on_rx)
|
||||
|
||||
def _on_rx(self):
|
||||
if hasattr(os, "dupterm_notify"):
|
||||
os.dupterm_notify(None)
|
||||
|
||||
def read(self, sz=None):
|
||||
return self._uart.read(sz)
|
||||
|
||||
def readinto(self, buf):
|
||||
avail = self._uart.read(len(buf))
|
||||
if not avail:
|
||||
return None
|
||||
for i in range(len(avail)):
|
||||
buf[i] = avail[i]
|
||||
return len(avail)
|
||||
|
||||
def ioctl(self, op, arg):
|
||||
if op == _MP_STREAM_POLL:
|
||||
if self._uart.any():
|
||||
return _MP_STREAM_POLL_RD
|
||||
return 0
|
||||
|
||||
def _flush(self):
|
||||
data = self._tx_buf[0:100]
|
||||
self._tx_buf = self._tx_buf[100:]
|
||||
self._uart.write(data)
|
||||
if self._tx_buf:
|
||||
schedule_in(self._flush, 50)
|
||||
|
||||
def write(self, buf):
|
||||
empty = not self._tx_buf
|
||||
self._tx_buf += buf
|
||||
if empty:
|
||||
schedule_in(self._flush, 50)
|
||||
|
||||
def start(ble_name="mpy-repl"):
|
||||
stream = BLEUARTStream(name=ble_name)
|
||||
os.dupterm(stream)
|
||||
377
boards/default/micropython/build/lib/blynklib.py
Normal file
377
boards/default/micropython/build/lib/blynklib.py
Normal file
@@ -0,0 +1,377 @@
|
||||
# Copyright (c) 2019-2020 Anton Morozenko
|
||||
# Copyright (c) 2015-2019 Volodymyr Shymanskyy.
|
||||
# See the file LICENSE for copying permission.
|
||||
|
||||
__version__ = '0.2.6'
|
||||
|
||||
import usocket as socket
|
||||
import utime as time
|
||||
import ustruct as struct
|
||||
import uselect as select
|
||||
from micropython import const
|
||||
|
||||
ticks_ms = time.ticks_ms
|
||||
sleep_ms = time.sleep_ms
|
||||
|
||||
IOError = OSError
|
||||
|
||||
LOGO = """
|
||||
___ __ __
|
||||
/ _ )/ /_ _____ / /__
|
||||
/ _ / / // / _ \\/ '_/
|
||||
/____/_/\\_, /_//_/_/\\_\\
|
||||
/___/ for Python v{}\n""".format(__version__)
|
||||
|
||||
|
||||
def stub_log(*args):
|
||||
pass
|
||||
|
||||
|
||||
class BlynkError(Exception):
|
||||
pass
|
||||
|
||||
|
||||
class RedirectError(Exception):
|
||||
def __init__(self, server, port):
|
||||
self.server = server
|
||||
self.port = port
|
||||
|
||||
|
||||
class Protocol(object):
|
||||
MSG_RSP = const(0)
|
||||
MSG_LOGIN = const(2)
|
||||
MSG_PING = const(6)
|
||||
MSG_TWEET = const(12)
|
||||
MSG_EMAIL = const(13)
|
||||
MSG_NOTIFY = const(14)
|
||||
MSG_BRIDGE = const(15)
|
||||
MSG_HW_SYNC = const(16)
|
||||
MSG_INTERNAL = const(17)
|
||||
MSG_PROPERTY = const(19)
|
||||
MSG_HW = const(20)
|
||||
MSG_REDIRECT = const(41)
|
||||
MSG_HEAD_LEN = const(5)
|
||||
|
||||
STATUS_INVALID_TOKEN = const(9)
|
||||
STATUS_OK = const(200)
|
||||
VPIN_MAX_NUM = const(32)
|
||||
|
||||
_msg_id = 1
|
||||
|
||||
def _get_msg_id(self, **kwargs):
|
||||
if 'msg_id' in kwargs:
|
||||
return kwargs['msg_id']
|
||||
self._msg_id += const(1)
|
||||
return self._msg_id if self._msg_id <= const(0xFFFF) else const(1)
|
||||
|
||||
def _pack_msg(self, msg_type, *args, **kwargs):
|
||||
data = ('\0'.join([str(curr_arg) for curr_arg in args])).encode('utf-8')
|
||||
return struct.pack('!BHH', msg_type, self._get_msg_id(**kwargs), len(data)) + data
|
||||
|
||||
def parse_response(self, rsp_data, msg_buffer):
|
||||
msg_args = []
|
||||
msg_len = 0
|
||||
try:
|
||||
msg_type, msg_id, h_data = struct.unpack('!BHH', rsp_data[:self.MSG_HEAD_LEN])
|
||||
msg_len = self.MSG_HEAD_LEN + h_data
|
||||
except Exception as p_err:
|
||||
raise BlynkError('Message parse error: {}'.format(p_err))
|
||||
if msg_id == 0:
|
||||
raise BlynkError('invalid msg_id == 0')
|
||||
elif h_data >= msg_buffer:
|
||||
raise BlynkError('Command too long. Length = {}'.format(h_data))
|
||||
elif msg_type in (self.MSG_RSP, self.MSG_PING):
|
||||
pass
|
||||
elif msg_type in (self.MSG_HW, self.MSG_BRIDGE, self.MSG_INTERNAL, self.MSG_REDIRECT):
|
||||
msg_body = rsp_data[self.MSG_HEAD_LEN: msg_len]
|
||||
msg_args = [itm.decode('utf-8') for itm in msg_body.split(b'\0')]
|
||||
else:
|
||||
raise BlynkError("Unknown message type: '{}'".format(msg_type))
|
||||
return msg_type, msg_id, h_data, msg_args, msg_len
|
||||
|
||||
def heartbeat_msg(self, heartbeat, rcv_buffer):
|
||||
return self._pack_msg(self.MSG_INTERNAL, 'ver', __version__, 'buff-in', rcv_buffer, 'h-beat', heartbeat,
|
||||
'dev', 'mpython')
|
||||
|
||||
def login_msg(self, token):
|
||||
return self._pack_msg(self.MSG_LOGIN, token)
|
||||
|
||||
def ping_msg(self):
|
||||
return self._pack_msg(self.MSG_PING)
|
||||
|
||||
def response_msg(self, *args, **kwargs):
|
||||
return self._pack_msg(self.MSG_RSP, *args, **kwargs)
|
||||
|
||||
def virtual_write_msg(self, v_pin, *val):
|
||||
return self._pack_msg(self.MSG_HW, 'vw', v_pin, *val)
|
||||
|
||||
def virtual_sync_msg(self, *pins):
|
||||
return self._pack_msg(self.MSG_HW_SYNC, 'vr', *pins)
|
||||
|
||||
def email_msg(self, to, subject, body):
|
||||
return self._pack_msg(self.MSG_EMAIL, to, subject, body)
|
||||
|
||||
def tweet_msg(self, msg):
|
||||
return self._pack_msg(self.MSG_TWEET, msg)
|
||||
|
||||
def notify_msg(self, msg):
|
||||
return self._pack_msg(self.MSG_NOTIFY, msg)
|
||||
|
||||
def set_property_msg(self, pin, prop, *val):
|
||||
return self._pack_msg(self.MSG_PROPERTY, pin, prop, *val)
|
||||
|
||||
def internal_msg(self, *args):
|
||||
return self._pack_msg(self.MSG_INTERNAL, *args)
|
||||
|
||||
|
||||
class Connection(Protocol):
|
||||
SOCK_MAX_TIMEOUT = const(5)
|
||||
SOCK_TIMEOUT = 0.05
|
||||
EAGAIN = const(11)
|
||||
ETIMEDOUT = const(60)
|
||||
RETRIES_TX_DELAY = const(2)
|
||||
RETRIES_TX_MAX_NUM = const(3)
|
||||
RECONNECT_SLEEP = const(1)
|
||||
TASK_PERIOD_RES = const(50)
|
||||
DISCONNECTED = const(0)
|
||||
CONNECTING = const(1)
|
||||
AUTHENTICATING = const(2)
|
||||
AUTHENTICATED = const(3)
|
||||
|
||||
_state = None
|
||||
_socket = None
|
||||
_last_rcv_time = 0
|
||||
_last_ping_time = 0
|
||||
_last_send_time = 0
|
||||
|
||||
def __init__(self, token, server='blynk-cloud.com', port=80, heartbeat=10, rcv_buffer=1024, log=stub_log):
|
||||
self.token = token
|
||||
self.server = server
|
||||
self.port = port
|
||||
self.heartbeat = heartbeat
|
||||
self.rcv_buffer = rcv_buffer
|
||||
self.log = log
|
||||
|
||||
def _set_socket_timeout(self, timeout):
|
||||
if getattr(self._socket, 'settimeout', None):
|
||||
self._socket.settimeout(timeout)
|
||||
else:
|
||||
p = select.poll()
|
||||
p.register(self._socket)
|
||||
p.poll(int(timeout * const(1000)))
|
||||
|
||||
def send(self, data):
|
||||
retries = self.RETRIES_TX_MAX_NUM
|
||||
while retries > 0:
|
||||
try:
|
||||
retries -= 1
|
||||
self._last_send_time = ticks_ms()
|
||||
return self._socket.send(data)
|
||||
except (IOError, OSError):
|
||||
sleep_ms(self.RETRIES_TX_DELAY)
|
||||
|
||||
def receive(self, length, timeout):
|
||||
d_buff = b''
|
||||
try:
|
||||
self._set_socket_timeout(timeout)
|
||||
d_buff += self._socket.recv(length)
|
||||
if len(d_buff) >= length:
|
||||
d_buff = d_buff[:length]
|
||||
return d_buff
|
||||
except (IOError, OSError) as err:
|
||||
if str(err) == 'timed out':
|
||||
return b''
|
||||
if str(self.EAGAIN) in str(err) or str(self.ETIMEDOUT) in str(err):
|
||||
return b''
|
||||
raise
|
||||
|
||||
def is_server_alive(self):
|
||||
now = ticks_ms()
|
||||
h_beat_ms = self.heartbeat * const(1000)
|
||||
rcv_delta = time.ticks_diff(now, self._last_rcv_time)
|
||||
ping_delta = time.ticks_diff(now, self._last_ping_time)
|
||||
send_delta = time.ticks_diff(now, self._last_send_time)
|
||||
if rcv_delta > h_beat_ms + (h_beat_ms // const(2)):
|
||||
return False
|
||||
if (ping_delta > h_beat_ms // const(10)) and (send_delta > h_beat_ms or rcv_delta > h_beat_ms):
|
||||
self.send(self.ping_msg())
|
||||
self.log('Heartbeat time: {}'.format(now))
|
||||
self._last_ping_time = now
|
||||
return True
|
||||
|
||||
def _get_socket(self):
|
||||
try:
|
||||
self._state = self.CONNECTING
|
||||
self._socket = socket.socket()
|
||||
self._socket.connect(socket.getaddrinfo(self.server, self.port)[0][-1])
|
||||
self._set_socket_timeout(self.SOCK_TIMEOUT)
|
||||
self.log('Connected to server')
|
||||
except Exception as g_exc:
|
||||
raise BlynkError('Server connection failed: {}'.format(g_exc))
|
||||
|
||||
def _authenticate(self):
|
||||
self.log('Authenticating device...')
|
||||
self._state = self.AUTHENTICATING
|
||||
self.send(self.login_msg(self.token))
|
||||
rsp_data = self.receive(self.rcv_buffer, self.SOCK_MAX_TIMEOUT)
|
||||
if not rsp_data:
|
||||
raise BlynkError('Auth stage timeout')
|
||||
msg_type, _, status, args, _ = self.parse_response(rsp_data, self.rcv_buffer)
|
||||
if status != self.STATUS_OK:
|
||||
if status == self.STATUS_INVALID_TOKEN:
|
||||
raise BlynkError('Invalid Auth Token')
|
||||
if msg_type == self.MSG_REDIRECT:
|
||||
raise RedirectError(*args)
|
||||
raise BlynkError('Auth stage failed. Status={}'.format(status))
|
||||
self._state = self.AUTHENTICATED
|
||||
self.log('Access granted')
|
||||
|
||||
def _set_heartbeat(self):
|
||||
self.send(self.heartbeat_msg(self.heartbeat, self.rcv_buffer))
|
||||
rcv_data = self.receive(self.rcv_buffer, self.SOCK_MAX_TIMEOUT)
|
||||
if not rcv_data:
|
||||
raise BlynkError('Heartbeat stage timeout')
|
||||
_, _, status, _, _ = self.parse_response(rcv_data, self.rcv_buffer)
|
||||
if status != self.STATUS_OK:
|
||||
raise BlynkError('Set heartbeat returned code={}'.format(status))
|
||||
self.log('Heartbeat = {} sec. MaxCmdBuffer = {} bytes'.format(self.heartbeat, self.rcv_buffer))
|
||||
|
||||
def connected(self):
|
||||
return True if self._state == self.AUTHENTICATED else False
|
||||
|
||||
|
||||
class Blynk(Connection):
|
||||
_CONNECT_TIMEOUT = const(30) # 30sec
|
||||
_VPIN_WILDCARD = '*'
|
||||
_VPIN_READ = 'read v'
|
||||
_VPIN_WRITE = 'write v'
|
||||
_INTERNAL = 'internal_'
|
||||
_CONNECT = 'connect'
|
||||
_DISCONNECT = 'disconnect'
|
||||
_VPIN_READ_ALL = '{}{}'.format(_VPIN_READ, _VPIN_WILDCARD)
|
||||
_VPIN_WRITE_ALL = '{}{}'.format(_VPIN_WRITE, _VPIN_WILDCARD)
|
||||
_events = {}
|
||||
|
||||
def __init__(self, token, **kwargs):
|
||||
Connection.__init__(self, token, **kwargs)
|
||||
self._start_time = ticks_ms()
|
||||
self._last_rcv_time = ticks_ms()
|
||||
self._last_send_time = ticks_ms()
|
||||
self._last_ping_time = ticks_ms()
|
||||
self._state = self.DISCONNECTED
|
||||
print(LOGO)
|
||||
|
||||
def connect(self, timeout=_CONNECT_TIMEOUT):
|
||||
end_time = time.time() + timeout
|
||||
while not self.connected():
|
||||
if self._state == self.DISCONNECTED:
|
||||
try:
|
||||
self._get_socket()
|
||||
self._authenticate()
|
||||
self._set_heartbeat()
|
||||
self._last_rcv_time = ticks_ms()
|
||||
self.log('Registered events: {}\n'.format(list(self._events.keys())))
|
||||
self.call_handler(self._CONNECT)
|
||||
return True
|
||||
except BlynkError as b_err:
|
||||
self.disconnect(b_err)
|
||||
sleep_ms(self.TASK_PERIOD_RES)
|
||||
except RedirectError as r_err:
|
||||
self.disconnect()
|
||||
self.server = r_err.server
|
||||
self.port = r_err.port
|
||||
sleep_ms(self.TASK_PERIOD_RES)
|
||||
if time.time() >= end_time:
|
||||
return False
|
||||
|
||||
def disconnect(self, err_msg=None):
|
||||
self.call_handler(self._DISCONNECT)
|
||||
if self._socket:
|
||||
self._socket.close()
|
||||
self._state = self.DISCONNECTED
|
||||
if err_msg:
|
||||
self.log('[ERROR]: {}\nConnection closed'.format(err_msg))
|
||||
time.sleep(self.RECONNECT_SLEEP)
|
||||
|
||||
def virtual_write(self, v_pin, *val):
|
||||
return self.send(self.virtual_write_msg(v_pin, *val))
|
||||
|
||||
def virtual_sync(self, *v_pin):
|
||||
return self.send(self.virtual_sync_msg(*v_pin))
|
||||
|
||||
def email(self, to, subject, body):
|
||||
return self.send(self.email_msg(to, subject, body))
|
||||
|
||||
def tweet(self, msg):
|
||||
return self.send(self.tweet_msg(msg))
|
||||
|
||||
def notify(self, msg):
|
||||
return self.send(self.notify_msg(msg))
|
||||
|
||||
def set_property(self, v_pin, property_name, *val):
|
||||
return self.send(self.set_property_msg(v_pin, property_name, *val))
|
||||
|
||||
def internal(self, *args):
|
||||
return self.send(self.internal_msg(*args))
|
||||
|
||||
def handle_event(blynk, event_name):
|
||||
class Deco(object):
|
||||
def __init__(self, func):
|
||||
self.func = func
|
||||
# wildcard 'read V*' and 'write V*' events handling
|
||||
if str(event_name).lower() in (blynk._VPIN_READ_ALL, blynk._VPIN_WRITE_ALL):
|
||||
event_base_name = str(event_name).split(blynk._VPIN_WILDCARD)[0]
|
||||
for i in range(blynk.VPIN_MAX_NUM + 1):
|
||||
blynk._events['{}{}'.format(event_base_name.lower(), i)] = func
|
||||
else:
|
||||
blynk._events[str(event_name).lower()] = func
|
||||
|
||||
def __call__(self):
|
||||
return self.func()
|
||||
|
||||
return Deco
|
||||
|
||||
def call_handler(self, event, *args, **kwargs):
|
||||
if event in self._events.keys():
|
||||
self.log("Event: ['{}'] -> {}".format(event, args))
|
||||
self._events[event](*args, **kwargs)
|
||||
|
||||
def process(self, msg_type, msg_id, msg_len, msg_args):
|
||||
if msg_type == self.MSG_RSP:
|
||||
self.log('Response status: {}'.format(msg_len))
|
||||
elif msg_type == self.MSG_PING:
|
||||
self.send(self.response_msg(self.STATUS_OK, msg_id=msg_id))
|
||||
elif msg_type in (self.MSG_HW, self.MSG_BRIDGE, self.MSG_INTERNAL):
|
||||
if msg_type == self.MSG_INTERNAL:
|
||||
self.call_handler("{}{}".format(self._INTERNAL, msg_args[0]), msg_args[1:])
|
||||
elif len(msg_args) >= const(3) and msg_args[0] == 'vw':
|
||||
self.call_handler("{}{}".format(self._VPIN_WRITE, msg_args[1]), int(msg_args[1]), msg_args[2:])
|
||||
elif len(msg_args) == const(2) and msg_args[0] == 'vr':
|
||||
self.call_handler("{}{}".format(self._VPIN_READ, msg_args[1]), int(msg_args[1]))
|
||||
|
||||
def read_response(self, timeout=0.5):
|
||||
end_time = time.ticks_ms() + int(timeout * const(1000))
|
||||
while time.ticks_diff(end_time, time.ticks_ms()) > 0:
|
||||
rsp_data = self.receive(self.rcv_buffer, self.SOCK_TIMEOUT)
|
||||
if rsp_data:
|
||||
self._last_rcv_time = ticks_ms()
|
||||
while rsp_data:
|
||||
msg_type, msg_id, h_data, msg_args, msg_len = self.parse_response(rsp_data, self.rcv_buffer)
|
||||
self.process(msg_type, msg_id, h_data, msg_args)
|
||||
rsp_data = rsp_data[msg_len:]
|
||||
|
||||
def run(self):
|
||||
if not self.connected():
|
||||
self.connect()
|
||||
else:
|
||||
try:
|
||||
self.read_response(timeout=self.SOCK_TIMEOUT)
|
||||
if not self.is_server_alive():
|
||||
self.disconnect('Server is offline')
|
||||
except KeyboardInterrupt:
|
||||
raise
|
||||
except BlynkError as b_err:
|
||||
self.log(b_err)
|
||||
self.disconnect()
|
||||
except Exception as g_exc:
|
||||
self.log(g_exc)
|
||||
133
boards/default/micropython/build/lib/blynktimer.py
Normal file
133
boards/default/micropython/build/lib/blynktimer.py
Normal file
@@ -0,0 +1,133 @@
|
||||
# Copyright (c) 2019-2020 Anton Morozenko
|
||||
"""
|
||||
Polling timers for functions.
|
||||
Registers timers and performs run once or periodical function execution after defined time intervals.
|
||||
"""
|
||||
# select.select call used as polling waiter where it is possible
|
||||
# cause time.sleep sometimes may load CPU up to 100% with small polling wait interval
|
||||
try:
|
||||
# cpython
|
||||
import time
|
||||
import select
|
||||
|
||||
polling_wait = lambda x: select.select([], [], [], x)
|
||||
polling_wait(0.01)
|
||||
except OSError:
|
||||
# windows case where select.select call fails
|
||||
polling_wait = lambda x: time.sleep(x)
|
||||
|
||||
except ImportError:
|
||||
# micropython
|
||||
import utime as time
|
||||
|
||||
try:
|
||||
from uselect import select as s_select
|
||||
|
||||
polling_wait = lambda x: s_select([], [], [], x)
|
||||
except ImportError:
|
||||
# case when micropython port does not support select.select
|
||||
polling_wait = lambda x: time.sleep(x)
|
||||
|
||||
WAIT_SEC = 0.05
|
||||
MAX_TIMERS = 16
|
||||
DEFAULT_INTERVAL = 10
|
||||
|
||||
|
||||
class TimerError(Exception):
|
||||
pass
|
||||
|
||||
|
||||
class Timer(object):
|
||||
timers = {}
|
||||
|
||||
def __init__(self, no_timers_err=True):
|
||||
self.no_timers_err = no_timers_err
|
||||
|
||||
def _get_func_name(self, obj):
|
||||
"""retrieves a suitable name for a function"""
|
||||
if hasattr(obj, 'func'):
|
||||
# handles nested decorators
|
||||
return self._get_func_name(obj.func)
|
||||
# simply returns 'timer' if on port without function attrs
|
||||
return getattr(obj, '__name__', 'timer')
|
||||
|
||||
def register(blynk, *args, **kwargs):
|
||||
# kwargs with defaults are used cause PEP 3102 no supported by Python2
|
||||
interval = kwargs.pop('interval', DEFAULT_INTERVAL)
|
||||
run_once = kwargs.pop('run_once', False)
|
||||
stopped = kwargs.pop('stopped', False)
|
||||
|
||||
class Deco(object):
|
||||
def __init__(self, func):
|
||||
self.func = func
|
||||
if len(list(Timer.timers.keys())) >= MAX_TIMERS:
|
||||
raise TimerError('Max allowed timers num={}'.format(MAX_TIMERS))
|
||||
_timer = _Timer(interval, func, run_once, stopped, *args, **kwargs)
|
||||
Timer.timers['{}_{}'.format(len(list(Timer.timers.keys())), blynk._get_func_name(func))] = _timer
|
||||
|
||||
def __call__(self, *f_args, **f_kwargs):
|
||||
return self.func(*f_args, **f_kwargs)
|
||||
|
||||
return Deco
|
||||
|
||||
@staticmethod
|
||||
def stop(t_id):
|
||||
timer = Timer.timers.get(t_id, None)
|
||||
if timer is None:
|
||||
raise TimerError('Timer id={} not found'.format(t_id))
|
||||
Timer.timers[t_id].stopped = True
|
||||
|
||||
@staticmethod
|
||||
def start(t_id):
|
||||
timer = Timer.timers.get(t_id, None)
|
||||
if timer is None:
|
||||
raise TimerError('Timer id={} not found'.format(t_id))
|
||||
Timer.timers[t_id].stopped = False
|
||||
Timer.timers[t_id].fire_time = None
|
||||
Timer.timers[t_id].fire_time_prev = None
|
||||
|
||||
@staticmethod
|
||||
def is_stopped(t_id):
|
||||
timer = Timer.timers.get(t_id, None)
|
||||
if timer is None:
|
||||
raise TimerError('Timer id={} not found'.format(t_id))
|
||||
return timer.stopped
|
||||
|
||||
def get_timers(self):
|
||||
states = {True: 'Stopped', False: 'Running'}
|
||||
return {k: states[v.stopped] for k, v in self.timers.items()}
|
||||
|
||||
def run(self):
|
||||
polling_wait(WAIT_SEC)
|
||||
timers_intervals = [curr_timer.run() for curr_timer in Timer.timers.values() if not curr_timer.stopped]
|
||||
if not timers_intervals and self.no_timers_err:
|
||||
raise TimerError('Running timers not found')
|
||||
return timers_intervals
|
||||
|
||||
|
||||
class _Timer(object):
|
||||
def __init__(self, interval, deco, run_once, stopped, *args, **kwargs):
|
||||
self.interval = interval
|
||||
self.deco = deco
|
||||
self.args = args
|
||||
self.run_once = run_once
|
||||
self.kwargs = kwargs
|
||||
self.fire_time = None
|
||||
self.fire_time_prev = None
|
||||
self.stopped = stopped
|
||||
|
||||
def run(self):
|
||||
timer_real_interval = 0
|
||||
if self.fire_time is None:
|
||||
self.fire_time = time.time() + self.interval
|
||||
if self.fire_time_prev is None:
|
||||
self.fire_time_prev = time.time()
|
||||
curr_time = time.time()
|
||||
if curr_time >= self.fire_time:
|
||||
self.deco(*self.args, **self.kwargs)
|
||||
if self.run_once:
|
||||
self.stopped = True
|
||||
timer_real_interval = curr_time - self.fire_time_prev
|
||||
self.fire_time_prev = self.fire_time
|
||||
self.fire_time = curr_time + self.interval
|
||||
return timer_real_interval
|
||||
162
boards/default/micropython/build/lib/bmp280.py
Normal file
162
boards/default/micropython/build/lib/bmp280.py
Normal file
@@ -0,0 +1,162 @@
|
||||
from ustruct import unpack as unp
|
||||
import utime
|
||||
|
||||
# Power Modes
|
||||
NORMAL = 0
|
||||
BMP280_TEMP_OS_SKIP = 0
|
||||
BMP280_TEMP_OS_1 = 1
|
||||
BMP280_TEMP_OS_2 = 2
|
||||
BMP280_TEMP_OS_4 = 3
|
||||
BMP280_TEMP_OS_8 = 4
|
||||
BMP280_TEMP_OS_16 = 5
|
||||
BMP280_PRES_OS_SKIP = 0
|
||||
BMP280_PRES_OS_1 = 1
|
||||
BMP280_PRES_OS_2 = 2
|
||||
BMP280_PRES_OS_4 = 3
|
||||
BMP280_PRES_OS_8 = 4
|
||||
BMP280_PRES_OS_16 = 5
|
||||
# BMP280 Temperature Registers
|
||||
BMP280_REGISTER_DIG_T1 = 0x88
|
||||
BMP280_REGISTER_DIG_T2 = 0x8A
|
||||
BMP280_REGISTER_DIG_T3 = 0x8C
|
||||
# BMP280 Pressure Registers
|
||||
BMP280_REGISTER_DIG_P1 = 0x8E
|
||||
BMP280_REGISTER_DIG_P2 = 0x90
|
||||
BMP280_REGISTER_DIG_P3 = 0x92
|
||||
BMP280_REGISTER_DIG_P4 = 0x94
|
||||
BMP280_REGISTER_DIG_P5 = 0x96
|
||||
BMP280_REGISTER_DIG_P6 = 0x98
|
||||
BMP280_REGISTER_DIG_P7 = 0x9A
|
||||
BMP280_REGISTER_DIG_P8 = 0x9C
|
||||
BMP280_REGISTER_DIG_P9 = 0x9E
|
||||
BMP280_REGISTER_ID = 0xD0
|
||||
BMP280_REGISTER_RESET = 0xE0
|
||||
BMP280_REGISTER_STATUS = 0xF3
|
||||
BMP280_REGISTER_CONTROL = 0xF4
|
||||
BMP280_REGISTER_CONFIG = 0xF5 # IIR filter config
|
||||
BMP280_REGISTER_DATA = 0xF7
|
||||
|
||||
class BMP280:
|
||||
def __init__(self, i2c_bus, addr=0x77):
|
||||
self._bmp_i2c = i2c_bus
|
||||
self._i2c_addr = addr
|
||||
self.chip_id = self._read(BMP280_REGISTER_ID, 2)
|
||||
|
||||
self._T1 = unp('<H', self._read(BMP280_REGISTER_DIG_T1, 2))[0]
|
||||
self._T2 = unp('<h', self._read(BMP280_REGISTER_DIG_T2, 2))[0]
|
||||
self._T3 = unp('<h', self._read(BMP280_REGISTER_DIG_T3, 2))[0]
|
||||
self._P1 = unp('<H', self._read(BMP280_REGISTER_DIG_P1, 2))[0]
|
||||
self._P2 = unp('<h', self._read(BMP280_REGISTER_DIG_P2, 2))[0]
|
||||
self._P3 = unp('<h', self._read(BMP280_REGISTER_DIG_P3, 2))[0]
|
||||
self._P4 = unp('<h', self._read(BMP280_REGISTER_DIG_P4, 2))[0]
|
||||
self._P5 = unp('<h', self._read(BMP280_REGISTER_DIG_P5, 2))[0]
|
||||
self._P6 = unp('<h', self._read(BMP280_REGISTER_DIG_P6, 2))[0]
|
||||
self._P7 = unp('<h', self._read(BMP280_REGISTER_DIG_P7, 2))[0]
|
||||
self._P8 = unp('<h', self._read(BMP280_REGISTER_DIG_P8, 2))[0]
|
||||
self._P9 = unp('<h', self._read(BMP280_REGISTER_DIG_P9, 2))[0]
|
||||
|
||||
self._t_os = BMP280_TEMP_OS_2 # temperature oversampling
|
||||
self._p_os = BMP280_PRES_OS_16 # pressure oversampling
|
||||
# output raw
|
||||
self._t_raw = 0
|
||||
self._t_fine = 0
|
||||
self._t = 0
|
||||
self._p_raw = 0
|
||||
self._p = 0
|
||||
self._read_wait_ms = 100 # interval between forced measure and readout
|
||||
self._new_read_ms = 200 # interval between
|
||||
self._last_read_ts = 0
|
||||
|
||||
def _read(self, addr, size=1):
|
||||
return self._bmp_i2c.readfrom_mem(self._i2c_addr, addr, size)
|
||||
|
||||
def _write(self, addr, b_arr):
|
||||
if not type(b_arr) is bytearray:
|
||||
b_arr = bytearray([b_arr])
|
||||
return self._bmp_i2c.writeto_mem(self._i2c_addr, addr, b_arr)
|
||||
|
||||
def _gauge(self):
|
||||
# TODO limit new reads
|
||||
now = utime.ticks_ms()
|
||||
if utime.ticks_diff(now, self._last_read_ts) > self._new_read_ms:
|
||||
self._last_read_ts = now
|
||||
r = self._t_os + (self._p_os << 3) + (1 << 6)
|
||||
self._write(BMP280_REGISTER_CONTROL, r)
|
||||
utime.sleep_ms(100) # TODO calc sleep
|
||||
d = self._read(BMP280_REGISTER_DATA, 6) # read all data at once (as by spec)
|
||||
self._p_raw = (d[0] << 12) + (d[1] << 4) + (d[2] >> 4)
|
||||
self._t_raw = (d[3] << 12) + (d[4] << 4) + (d[5] >> 4)
|
||||
self._t_fine = 0
|
||||
self._t = 0
|
||||
self._p = 0
|
||||
|
||||
def load_test_calibration(self):
|
||||
self._T1 = 27504
|
||||
self._T2 = 26435
|
||||
self._T3 = -1000
|
||||
self._P1 = 36477
|
||||
self._P2 = -10685
|
||||
self._P3 = 3024
|
||||
self._P4 = 2855
|
||||
self._P5 = 140
|
||||
self._P6 = -7
|
||||
self._P7 = 15500
|
||||
self._P8 = -14600
|
||||
self._P9 = 6000
|
||||
|
||||
def load_test_data(self):
|
||||
self._t_raw = 519888
|
||||
self._p_raw = 415148
|
||||
|
||||
def print_calibration(self):
|
||||
print("T1: {} {}".format(self._T1, type(self._T1)))
|
||||
print("T2: {} {}".format(self._T2, type(self._T2)))
|
||||
print("T3: {} {}".format(self._T3, type(self._T3)))
|
||||
print("P1: {} {}".format(self._P1, type(self._P1)))
|
||||
print("P2: {} {}".format(self._P2, type(self._P2)))
|
||||
print("P3: {} {}".format(self._P3, type(self._P3)))
|
||||
print("P4: {} {}".format(self._P4, type(self._P4)))
|
||||
print("P5: {} {}".format(self._P5, type(self._P5)))
|
||||
print("P6: {} {}".format(self._P6, type(self._P6)))
|
||||
print("P7: {} {}".format(self._P7, type(self._P7)))
|
||||
print("P8: {} {}".format(self._P8, type(self._P8)))
|
||||
print("P9: {} {}".format(self._P9, type(self._P9)))
|
||||
|
||||
def _calc_t_fine(self):
|
||||
# From datasheet page 22
|
||||
self._gauge()
|
||||
if self._t_fine == 0:
|
||||
var1 = (((self._t_raw >> 3) - (self._T1 << 1)) * self._T2) >> 11
|
||||
var2 = (((((self._t_raw >> 4) - self._T1) * ((self._t_raw >> 4) - self._T1)) >> 12) * self._T3) >> 14
|
||||
self._t_fine = var1 + var2
|
||||
|
||||
# @property
|
||||
def get_BMP_temperature(self):
|
||||
self._calc_t_fine()
|
||||
if self._t == 0:
|
||||
self._t = ((self._t_fine * 5 + 128) >> 8) / 100.
|
||||
return self._t
|
||||
|
||||
# @property
|
||||
def get_BMP_pressure(self):
|
||||
# From datasheet page 22
|
||||
self._calc_t_fine()
|
||||
if self._p == 0:
|
||||
var1 = self._t_fine - 128000
|
||||
var2 = var1 * var1 * self._P6
|
||||
var2 = var2 + ((var1 * self._P5) << 17)
|
||||
var2 = var2 + (self._P4 << 35)
|
||||
var1 = ((var1 * var1 * self._P3) >> 8) + ((var1 * self._P2) << 12)
|
||||
var1 = (((1 << 47) + var1) * self._P1) >> 33
|
||||
|
||||
if var1 == 0:
|
||||
return 0
|
||||
|
||||
p = 1048576 - self._p_raw
|
||||
p = int((((p << 31) - var2) * 3125) / var1)
|
||||
var1 = (self._P9 * (p >> 13) * (p >> 13)) >> 25
|
||||
var2 = (self._P8 * p) >> 19
|
||||
|
||||
p = ((p + var1 + var2) >> 8) + (self._P7 << 4)
|
||||
self._p = p / 256.0
|
||||
return self._p
|
||||
85
boards/default/micropython/build/lib/cc_g1.py
Normal file
85
boards/default/micropython/build/lib/cc_g1.py
Normal file
@@ -0,0 +1,85 @@
|
||||
"""
|
||||
CC_G1
|
||||
|
||||
Micropython library for the CC_G1(Remote control handle)
|
||||
=======================================================
|
||||
|
||||
#Preliminary composition 20231222
|
||||
|
||||
@dahanzimin From the Mixly Team
|
||||
"""
|
||||
from micropython import const
|
||||
from machine import Pin,SoftI2C
|
||||
|
||||
_CC_G1_ADDRESS = const(0x27)
|
||||
_CC_G1_ID = const(0x00)
|
||||
_CC_G1_VBAT = const(0x01)
|
||||
_CC_G1_ADC = const(0x03)
|
||||
_CC_G1_KEY = const(0x07)
|
||||
|
||||
class Handle:
|
||||
def __init__(self, i2c_bus, addr=_CC_G1_ADDRESS):
|
||||
self._i2c=i2c_bus
|
||||
self._addr = addr
|
||||
if self._rreg(_CC_G1_ID)!= 0x27:
|
||||
raise AttributeError("Cannot find a CC_G1")
|
||||
|
||||
def _wreg(self, reg, val):
|
||||
'''Write memory address'''
|
||||
try:
|
||||
self._i2c.writeto_mem(self._addr, reg, val.to_bytes(1, 'little'))
|
||||
except:
|
||||
return 0
|
||||
|
||||
def _rreg(self, reg, nbytes=1):
|
||||
'''Read memory address'''
|
||||
try:
|
||||
self._i2c.writeto(self._addr, reg.to_bytes(1, 'little'))
|
||||
return self._i2c.readfrom(self._addr, nbytes)[0] if nbytes<=1 else self._i2c.readfrom(self._addr, nbytes)[0:nbytes]
|
||||
except:
|
||||
return 0
|
||||
|
||||
def read_bat(self, ratio=5/1023):
|
||||
'''Read battery power'''
|
||||
vbat = self._rreg(_CC_G1_VBAT)<<2 | self._rreg(_CC_G1_VBAT+1)>>6
|
||||
return round(vbat*ratio, 2)
|
||||
|
||||
def read_joystick(self, ratio=100/1023):
|
||||
'''Read joystick'''
|
||||
y_axis = 1023 - (self._rreg(_CC_G1_ADC) << 2 | self._rreg(_CC_G1_ADC + 1) >> 6)
|
||||
x_axis = self._rreg(_CC_G1_ADC + 2 ) << 2 | self._rreg(_CC_G1_ADC + 3) >> 6
|
||||
return round(x_axis*ratio), round(y_axis*ratio)
|
||||
|
||||
def read_key(self, index):
|
||||
'''Read key1~6'''
|
||||
if not 0 <= index <= 5:
|
||||
raise ValueError("The key number must be a number in the range: 0~5")
|
||||
if index<=4:
|
||||
return bool(self._rreg(_CC_G1_KEY) >> index & 0x01)
|
||||
else:
|
||||
return bool(self._rreg(_CC_G1_KEY) >> 7 & 0x01)
|
||||
|
||||
def shutdown(self, flag=True):
|
||||
"""This function is only available on battery power"""
|
||||
if flag:
|
||||
self._wreg(_CC_G1_KEY, (self._rreg(_CC_G1_KEY)) & 0XBF)
|
||||
else:
|
||||
self._wreg(_CC_G1_KEY, (self._rreg(_CC_G1_KEY)) | 0X40)
|
||||
|
||||
'''Select instantiation objects'''
|
||||
try:
|
||||
#MixGo CC/ME
|
||||
ext_i2c = SoftI2C(scl=Pin(0), sda=Pin(1), freq=100000)
|
||||
handle = Handle(ext_i2c)
|
||||
except:
|
||||
try:
|
||||
#MixGo CE
|
||||
ext_i2c = SoftI2C(scl=Pin(17), sda=Pin(18), freq=100000)
|
||||
handle = Handle(ext_i2c)
|
||||
except:
|
||||
try:
|
||||
#MixGo Mini
|
||||
ext_i2c = SoftI2C(scl=Pin(8), sda=Pin(7), freq=100000)
|
||||
handle = Handle(ext_i2c)
|
||||
except:
|
||||
print("MixGo board cannot find a CC_G1")
|
||||
147
boards/default/micropython/build/lib/ch914x_at.py
Normal file
147
boards/default/micropython/build/lib/ch914x_at.py
Normal file
@@ -0,0 +1,147 @@
|
||||
"""
|
||||
Bluetooth AT
|
||||
|
||||
Micropython library for the Bluetooth AT(WCH)
|
||||
=======================================================
|
||||
|
||||
#Preliminary composition 20230106
|
||||
|
||||
dahanzimin From the Mixly Team
|
||||
"""
|
||||
from machine import Pin
|
||||
from time import sleep_ms
|
||||
|
||||
class AT:
|
||||
def __init__(self, pin,times=5):
|
||||
self.at_pin = Pin(pin, Pin.OUT)
|
||||
self.at_pin.value(1)
|
||||
self._times = times
|
||||
self._flag = [0,0,0,0,0,0,0,0] #mac0,1 name2,3 power4,5 power6,7
|
||||
self._power = [0,1,2,3,-3,-8,-14,-20]
|
||||
sleep_ms(100)
|
||||
|
||||
def _str_reverse(self,data):
|
||||
data=data.split(':')
|
||||
data.reverse()
|
||||
data=":".join(data)
|
||||
return data
|
||||
|
||||
def ble_mac(self, mac=None):
|
||||
sleep_ms(200)
|
||||
if mac is None:
|
||||
if not (self._flag[0] >= self._times and self._times != 0):
|
||||
self._flag[0]+=1
|
||||
self.at_pin.value(0)
|
||||
sleep_ms(10)
|
||||
data=input('AT+MAC?\r\n')
|
||||
input()
|
||||
self.at_pin.value(1)
|
||||
print('BLE_MAC:',self._str_reverse(data))
|
||||
sleep_ms(100)
|
||||
return self._str_reverse(data)
|
||||
else:
|
||||
print('Please delete this command and upload other programs again')
|
||||
else:
|
||||
if not (self._flag[1] >= self._times and self._times != 0):
|
||||
self._flag[1]+=1
|
||||
self.at_pin.value(0)
|
||||
sleep_ms(10)
|
||||
data=input('AT+MAC={}\r\n'.format(self._str_reverse(mac)))
|
||||
print('\r\n')
|
||||
self.at_pin.value(1)
|
||||
print('BLE_MAC:',mac,data)
|
||||
sleep_ms(100)
|
||||
return True if data is "OK" else False
|
||||
else:
|
||||
print('Please delete this command and upload other programs again')
|
||||
|
||||
def ble_name(self, name=None):
|
||||
sleep_ms(200)
|
||||
if name is None:
|
||||
if not (self._flag[2] >= self._times and self._times != 0):
|
||||
self._flag[2]+=1
|
||||
self.at_pin.value(0)
|
||||
sleep_ms(10)
|
||||
data=input('AT+NAME?\r\n')
|
||||
input()
|
||||
input()
|
||||
self.at_pin.value(1)
|
||||
print('BLE_NAME:',data)
|
||||
sleep_ms(100)
|
||||
return data
|
||||
else:
|
||||
print('Please delete this command and upload other programs again')
|
||||
else:
|
||||
if not (self._flag[3] >= self._times and self._times != 0):
|
||||
self._flag[3]+=1
|
||||
self.at_pin.value(0)
|
||||
sleep_ms(10)
|
||||
data=input('AT+NAME='+name+'\r\n')
|
||||
print('\r\n')
|
||||
self.at_pin.value(1)
|
||||
print('BLE_NAME:',name,data)
|
||||
sleep_ms(100)
|
||||
return True if data is "OK" else False
|
||||
else:
|
||||
print('Please delete this command and upload other programs again')
|
||||
|
||||
def ble_power(self, power=None):
|
||||
sleep_ms(200)
|
||||
if power is None:
|
||||
if not (self._flag[4] >= self._times and self._times != 0):
|
||||
self._flag[4]+=1
|
||||
self.at_pin.value(0)
|
||||
sleep_ms(10)
|
||||
data=input('AT+TPL?\r\n')
|
||||
input()
|
||||
print(' \r\n')
|
||||
self.at_pin.value(1)
|
||||
data=self._power[int(data[4:])]
|
||||
print('BLE_Power: {}DB'.format(data))
|
||||
sleep_ms(100)
|
||||
return data
|
||||
else:
|
||||
print('Please delete this command and upload other programs again')
|
||||
else:
|
||||
if not (self._flag[5] >= self._times and self._times != 0):
|
||||
self._flag[5]+=1
|
||||
self.at_pin.value(0)
|
||||
sleep_ms(10)
|
||||
data=input('AT+TPL={}\r\n'.format(self._power.index(power)))
|
||||
print('\r\n')
|
||||
self.at_pin.value(1)
|
||||
print('BLE_Power:',str(power)+'DB',data)
|
||||
sleep_ms(100)
|
||||
return True if data is "OK" else False
|
||||
else:
|
||||
print('Please delete this command and upload other programs again')
|
||||
|
||||
def ble_pname(self, name=None):
|
||||
sleep_ms(200)
|
||||
if name is None:
|
||||
if not (self._flag[6] >= self._times and self._times != 0):
|
||||
self._flag[6]+=1
|
||||
self.at_pin.value(0)
|
||||
sleep_ms(10)
|
||||
data=input('AT+PNAME?\r\n')
|
||||
input()
|
||||
input()
|
||||
self.at_pin.value(1)
|
||||
print('BLE_PNAME:',data)
|
||||
sleep_ms(100)
|
||||
return data
|
||||
else:
|
||||
print('Please delete this command and upload other programs again')
|
||||
else:
|
||||
if not (self._flag[7] >= self._times and self._times != 0):
|
||||
self._flag[7]+=1
|
||||
self.at_pin.value(0)
|
||||
sleep_ms(10)
|
||||
data=input('AT+PNAME='+name+'\r\n')
|
||||
print('\r\n')
|
||||
self.at_pin.value(1)
|
||||
print('BLE_PNAME:',name,data)
|
||||
sleep_ms(100)
|
||||
return True if data is "OK" else False
|
||||
else:
|
||||
print('Please delete this command and upload other programs again')
|
||||
166
boards/default/micropython/build/lib/debugnet.py
Normal file
166
boards/default/micropython/build/lib/debugnet.py
Normal file
@@ -0,0 +1,166 @@
|
||||
"""
|
||||
Debugnet(HTTP,MQTT)
|
||||
|
||||
MicroPython library for network request debugging
|
||||
=======================================================
|
||||
|
||||
#Preliminary composition 20230225
|
||||
|
||||
@dahanzimin From the Mixly Team
|
||||
"""
|
||||
import time
|
||||
from umqtt import MQTTClient
|
||||
from ubinascii import hexlify
|
||||
from machine import unique_id
|
||||
from urequests import Response
|
||||
from usocket import socket,getaddrinfo,SOCK_STREAM
|
||||
from mixiot import WILL_TOPIC,ADDITIONAL_TOPIC
|
||||
|
||||
class socket_d(socket):
|
||||
def __init__(self,*args,debug=False,**kw):
|
||||
super().__init__(*args,**kw)
|
||||
self._debug=debug
|
||||
self.client_len=0
|
||||
self.server_len=0
|
||||
|
||||
def write(self,*args):
|
||||
super().write(*args)
|
||||
self.client_len=min(self.client_len+len(args[0]),65535)
|
||||
if self._debug:
|
||||
print('client:',args[0])
|
||||
|
||||
def readline(self,*args):
|
||||
buf=super().readline(*args)
|
||||
self.server_len=min(self.server_len+len(buf),65535) if buf else self.server_len
|
||||
if self._debug:
|
||||
print('server:',buf)
|
||||
return buf
|
||||
|
||||
def read(self,*args):
|
||||
buf=super().read(*args)
|
||||
self.server_len=min(self.server_len+len(buf),65535) if buf else self.server_len
|
||||
if self._debug:
|
||||
print('server:',buf)
|
||||
return buf
|
||||
|
||||
#HTTP
|
||||
def request(method, url, data=None, json=None, headers={}, stream=None, parse_headers=True, debug=False):
|
||||
redir_cnt = 1
|
||||
while True:
|
||||
try:
|
||||
proto, dummy, host, path = url.split("/", 3)
|
||||
except ValueError:
|
||||
proto, dummy, host = url.split("/", 2)
|
||||
path = ""
|
||||
if proto == "http:":
|
||||
port = 80
|
||||
elif proto == "https:":
|
||||
import ussl
|
||||
port = 443
|
||||
else:
|
||||
raise ValueError("Unsupported protocol: " + proto)
|
||||
if ":" in host:
|
||||
host, port = host.split(":", 1)
|
||||
port = int(port)
|
||||
ai = getaddrinfo(host, port, 0, SOCK_STREAM)
|
||||
ai = ai[0]
|
||||
resp_d = None
|
||||
if parse_headers is not False:
|
||||
resp_d = {}
|
||||
s = socket_d(ai[0], ai[1], ai[2], debug=debug)
|
||||
try:
|
||||
s.connect(ai[-1])
|
||||
if proto == "https:":
|
||||
s = ussl.wrap_socket(s, server_hostname=host)
|
||||
s.write(b"%s /%s HTTP/1.0\r\n" % (method, path))
|
||||
if not "Host" in headers:
|
||||
s.write(b"Host: %s\r\n" % host)
|
||||
for k in headers:
|
||||
s.write(k)
|
||||
s.write(b": ")
|
||||
s.write(headers[k])
|
||||
s.write(b"\r\n")
|
||||
if json is not None:
|
||||
assert data is None
|
||||
import ujson
|
||||
data = ujson.dumps(json)
|
||||
s.write(b"Content-Type: application/json\r\n")
|
||||
if data:
|
||||
s.write(b"Content-Length: %d\r\n" % len(data))
|
||||
s.write(b"Connection: close\r\n\r\n")
|
||||
if data:
|
||||
s.write(data)
|
||||
l = s.readline()
|
||||
l = l.split(None, 2)
|
||||
status = int(l[1])
|
||||
reason = ""
|
||||
if len(l) > 2:
|
||||
reason = l[2].rstrip()
|
||||
while True:
|
||||
l = s.readline()
|
||||
if not l or l == b"\r\n":
|
||||
break
|
||||
if l.startswith(b"Transfer-Encoding:"):
|
||||
if b"chunked" in l:
|
||||
raise ValueError("Unsupported " + l)
|
||||
elif l.startswith(b"Location:") and 300 <= status <= 399:
|
||||
if not redir_cnt:
|
||||
raise ValueError("Too many redirects")
|
||||
redir_cnt -= 1
|
||||
url = l[9:].decode().strip()
|
||||
status = 300
|
||||
break
|
||||
if parse_headers is False:
|
||||
pass
|
||||
elif parse_headers is True:
|
||||
l = l.decode()
|
||||
k, v = l.split(":", 1)
|
||||
resp_d[k] = v.strip()
|
||||
else:
|
||||
parse_headers(l, resp_d)
|
||||
except OSError:
|
||||
s.close()
|
||||
raise
|
||||
if status != 300:
|
||||
break
|
||||
resp = Response(s)
|
||||
resp.status_code = status
|
||||
resp.reason = reason
|
||||
resp.client_len=s.client_len
|
||||
resp.server_len=s.server_len
|
||||
if resp_d is not None:
|
||||
resp.headers = resp_d
|
||||
return resp
|
||||
|
||||
class MQTT_Client(MQTTClient):
|
||||
def __init__(self,*args,debug=False,**kw):
|
||||
super().__init__(*args,**kw)
|
||||
self.sock = socket_d(debug=debug)
|
||||
|
||||
@property
|
||||
def client_len(self): #The length of client data obtained
|
||||
_len=self.sock.client_len
|
||||
self.sock.client_len=0
|
||||
return _len
|
||||
|
||||
@property
|
||||
def server_len(self): #The length of server data obtained
|
||||
_len=self.sock.server_len
|
||||
self.sock.server_len=0
|
||||
return _len
|
||||
|
||||
def time_msg(self,utc=28800): #Get server time information
|
||||
msg=self.wait_msg()
|
||||
if isinstance(msg, dict):
|
||||
if msg['topic'] =='$SYS/hello':
|
||||
val=time.gmtime(int(msg['msg'])//1000-946684800+utc)[0:7]
|
||||
return str(val).replace(' ','')[1:-1]
|
||||
|
||||
#MQTT
|
||||
def init_MQTT_client(address, username, password, MQTT_USR_PRJ, debug=False):
|
||||
client = MQTT_Client(hexlify(unique_id()), address, 1883, username, password, debug=debug)
|
||||
client.set_last_will(topic=MQTT_USR_PRJ+WILL_TOPIC, msg=client.client_id, qos=2)
|
||||
if client.connect()==0:
|
||||
client.publish(MQTT_USR_PRJ+ADDITIONAL_TOPIC, client.client_id, qos=0)
|
||||
time.sleep_ms(200)
|
||||
return client
|
||||
60
boards/default/micropython/build/lib/dhtx.py
Normal file
60
boards/default/micropython/build/lib/dhtx.py
Normal file
@@ -0,0 +1,60 @@
|
||||
# DHT11/DHT22 driver for MicroPython
|
||||
# MIT license; Copyright (c) 2016 Damien P. George
|
||||
|
||||
from time import sleep
|
||||
try:
|
||||
from esp import dht_readinto
|
||||
except:
|
||||
from machine import dht_readinto
|
||||
from machine import Pin
|
||||
|
||||
class DHTBase:
|
||||
__species = {}
|
||||
__first_init = True
|
||||
def __new__(cls, pin, *args, **kwargs):
|
||||
if pin not in cls.__species.keys():
|
||||
cls.__first_init = True
|
||||
cls.__species[pin] = object.__new__(cls)
|
||||
return cls.__species[pin]
|
||||
|
||||
def __init__(self, pin):
|
||||
if self.__first_init:
|
||||
self.__first_init = False
|
||||
self.pin = Pin(pin)
|
||||
self.buf = bytearray(5)
|
||||
self.err = 0
|
||||
|
||||
def measure(self):
|
||||
buf = bytearray(5)
|
||||
try:
|
||||
dht_readinto(self.pin, buf)
|
||||
if (buf[0] + buf[1] + buf[2] + buf[3]) & 0xFF == buf[4]:
|
||||
self.buf = buf
|
||||
self.err = 0
|
||||
except:
|
||||
if self.err > 10:
|
||||
raise AttributeError("DHTx operation error")
|
||||
self.err += 1
|
||||
sleep(0.5)
|
||||
return
|
||||
|
||||
class DHT11(DHTBase):
|
||||
def humidity(self):
|
||||
self.measure()
|
||||
return self.buf[0]
|
||||
|
||||
def temperature(self):
|
||||
self.measure()
|
||||
return self.buf[2]
|
||||
|
||||
class DHT22(DHTBase):
|
||||
def humidity(self):
|
||||
self.measure()
|
||||
return (self.buf[0] << 8 | self.buf[1]) * 0.1
|
||||
|
||||
def temperature(self):
|
||||
self.measure()
|
||||
t = ((self.buf[2] & 0x7F) << 8 | self.buf[3]) * 0.1
|
||||
if self.buf[2] & 0x80:
|
||||
t = -t
|
||||
return t
|
||||
21
boards/default/micropython/build/lib/expression_picture.py
Normal file
21
boards/default/micropython/build/lib/expression_picture.py
Normal file
@@ -0,0 +1,21 @@
|
||||
#Take the picture bytes in expression_picture.py
|
||||
#--dahanzimin From the Mixly Team
|
||||
|
||||
Angry=b'P4\n64\n64\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00?\xfc\x00\x00\x00\x00\x00\x03\xff\xff\xc0\x00\x00\x00\x00\x0f\xff\xff\xf0\x00\x00\x00\x00\x7f\xff\xff\xfc\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x03\xff\xfd\x7f\xff\xc0\x00\x00\x07\xff\x80\x01\xff\xe0\x00\x00\x0f\xfc\x00\x00\x7f\xf0\x00\x00\x1f\xf8\x00\x00\x1f\xf8\x00\x00?\xe0\x00\x01\x87\xfc\x00\x00\x7f\x80\x00\x01\xd9\xfe\x00\x00\xff\x00\x00\x07\xfc\xff\x00\x01\xfe\x00\x00\x07\xfe\x7f\x80\x01\xfc\x00\x00\x03\x1c?\x80\x03\xf8\x00\x00\x0f\x18\x1f\xc0\x03\xf0\x00\x00\x0e\xdc\x0f\xc0\x07\xf0\x00\x00\x07\xfc\x0f\xe0\x07\xe0\x00\x00\x07\xf8\x07\xe0\x0f\xc0\x00\x00\x02`\x03\xf0\x0f\xc0\x00\x00\x00 \x03\xf0\x1f\xc0\x00\x00\x00\x00\x03\xf8\x1f\x83\x00\x00\x00\x00\xc1\xf8\x1f\x83\xc0\x00\x00\x03\xc1\xf8\x1f\x03\xf0\x00\x00\x1f\xc1\xf8?\x07\xfe\x00\x00?\xe0\xfc?\x03\xff\x80\x01\xff\xc0\xfc?\x03\xff\xe0\x07\xff\xc0\xfc?\x03\xff\xe0\x03\xff\x80\xfc?\x01\xff\xc0\x03\xff\x80|?\x00\xff\x80\x01\xff\x00\xfc>\x00>\x00\x00|\x00|?\x00\x00\x00\x00\x00\x00\xfc?\x00\x00\x00\x00\x00\x00\xfc?\x00\x00\x00\x00\x00\x00\xfc?\x00\x00\x00\x00\x00\x00\xfc\x1f\x00\x00\x00\x00\x00\x00\xfc?\x00\x00\x00\x00\x00\x01\xf8\x1f\x80\x00\x00\x00\x00\x01\xf8\x1f\x80\x00\x00\x00\x00\x01\xf8\x0f\xc0\x00\x00\x00\x00\x01\xf8\x1f\xc0\x00\x00\x00\x00\x03\xf0\x0f\xc0\x00\x00\x00\x00\x07\xf0\x07\xe0\x00\x03\x80\x00\x07\xe0\x07\xf0\x00\x07\xc0\x00\x0f\xe0\x03\xf0\x00\x0f\xf0\x00\x0f\xc0\x03\xf8\x00\x1e\xf8\x00\x1f\xc0\x01\xfc\x00\x1c~\x00?\x80\x01\xfe\x00\x00\x1c\x00\x7f\x80\x00\xff\x00\x00\x04\x00\xff\x00\x00\x7f\xc0\x00\x00\x01\xfe\x00\x00?\xe0\x00\x00\x07\xfc\x00\x00\x1f\xf8\x00\x00\x1f\xf8\x00\x00\x0f\xfe\x00\x00\x7f\xf0\x00\x00\x07\xff\xc0\x05\xff\xe0\x00\x00\x01\xff\xff\xff\xff\x80\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00?\xff\xff\xfc\x00\x00\x00\x00\x0f\xff\xff\xf0\x00\x00\x00\x00\x03\xff\xff\xc0\x00\x00\x00\x00\x00?\xfc\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
|
||||
Bored=b'P4\n64\n64\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00?\xfc\x00\x00\x00\x00\x00\x03\xff\xff\xc0\x00\x00\x00\x00\x0f\xff\xff\xf0\x00\x00\x00\x00\x7f\xff\xff\xfc\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x03\xff\xfd\x7f\xff\xc0\x00\x00\x07\xff\x80\x01\xff\xe0\x00\x00\x0f\xfc\x00\x00\x7f\xf0\x00\x00\x1f\xf8\x00\x00\x1f\xf8\x00\x00?\xc0\x00\x00\x07\xfc\x00\x00\x7f\xc0\x00\x00\x01\xfe\x00\x00\xff\x00\x00\x00\x00\xff\x00\x01\xfe\x00\x00\x00\x00\x7f\x00\x01\xfc\x00\x00\x00\x00?\x80\x03\xf8\x00\x00\x00\x00\x1f\xc0\x03\xf0\x00\x00\x00\x00\x0f\xc0\x07\xf0\x00\x00\x00\x00\x0f\xe0\x07\xe0\x00\x00\x00\x00\x07\xf0\x0f\xe0\x00\x00\x00\x00\x07\xf0\x0f\xc0\x00\x00\x00\x00\x03\xf0\x1f\x80\x00\x00\x00\x00\x03\xf8\x1f\x80\x00\x00\x00\x00\x01\xf8\x1f\x83[\x00\x00\xdfA\xf8\x1f\x87\xff\x80\x01\xff\xe0\xf8?\x07\xff\x00\x01\xff\xe0\xfc?\x01}\x00\x00\x8e\x00\xfc?\x000\x00\x00\x0e\x00\xfc?\x00p\x00\x00\x1c\x00\xfc>\x05~\x80\x00_\xc0|?\x07\xff\x80\x01\xff\xe0\xfc?\x07\xff\x80\x01\xff\xe0\xfc>\x02D\x00\x00\xa4\x80|?\x00\x00\x00\x00\x00\x00\xfc?\x00\x00\x00\x00\x00\x00\xfc?\x00\x00\x00\x00\x00\x00\xfc\x1f\x00\x00\x00\x00\x00\x00\xfc?\x80\x00\x00\x00\x00\x01\xf8\x1f\x80\x00\x00\x00\x00\x01\xf8\x1f\x80\x00\x00\x00\x00\x01\xf8\x0f\xc0\x00\x00\x00\x00\x01\xf8\x0f\xc0\x00\x07\xf0\x00\x03\xf0\x0f\xe0\x00\x1f\xfc\x00\x07\xf0\x07\xe0\x00?\xfe\x00\x07\xe0\x07\xf0\x00|\x1f\x00\x07\xe0\x03\xf8\x00p\x07\x00\x1f\xc0\x03\xf8\x00\xe0\x07\x80\x1f\xc0\x01\xfc\x00s\xe3\x80?\x80\x00\xfe\x00c\xf3\x00\x7f\x00\x00\xff\x00\x03\xe0\x00\xff\x00\x00\x7f\xc0\x00\x00\x01\xfe\x00\x00?\xe0\x00\x00\x07\xfc\x00\x00\x1f\xf0\x00\x00\x1f\xf8\x00\x00\x0f\xfe\x00\x00\x7f\xf0\x00\x00\x07\xff\xc0\x01\xff\xe0\x00\x00\x03\xff\xfa\xbf\xff\x80\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00?\xff\xff\xfe\x00\x00\x00\x00\x0f\xff\xff\xf0\x00\x00\x00\x00\x01\xff\xff\xc0\x00\x00\x00\x00\x00_\xfc\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
|
||||
Confused=b'P4\n64\n64\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00?\xfc\x00\x00\x00\x00\x00\x03\xff\xff\xc0\x00\x00\x00\x00\x0f\xff\xff\xf0\x00\x00\x00\x00\x7f\xff\xff\xfc\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x03\xff\xfd\x7f\xff\xc0\x00\x00\x07\xff\x80\x01\xff\xe0\x00\x00\x0f\xfc\x00\x00\x7f\xf0\x00\x00\x1f\xf8\x00\x00\x1f\xf8\x00\x00?\xc0\x00\x00\x07\xfc\x00\x00\x7f\xc0\x00\x00\x01\xfe\x00\x00\xff\x00\x00\x00\x00\xff\x00\x01\xfe\x00\x00\x00\x00\x7f\x00\x01\xfc\x00\x00\x00\x00?\x80\x03\xf8\x06\x00\x00\x00\x1f\xc0\x03\xf0\x0f\x00\x01\xfc\x1f\xc0\x07\xf0\x1f\x00\x01\xff\x0f\xe0\x07\xe0?\x00\x01\xff\x87\xe0\x0f\xc0~\x00\x00\xff\xc7\xf0\x0f\xdf\xfc\x00\x00\x07\xe3\xf0\x1f\xdf\xf8\x00\x00\x01\xf3\xf8\x1f\x9f\xe0\x00\x00\x00\xf1\xf8\x1f\x8f(\x00\x00\x18\xe1\xf8\x1f\x00~\x00\x00~!\xf8?\x00\xff\x00\x00\xfe\x00\xfc?\x00\xff\x80\x00\xff\x00\xfc?\x00\xff\x80\x01\xff\x00\xfc?\x00\xff\x00\x01\xff\x00\xfc?\x00\xff\x80\x00\xff\x00\xfc?\x00~\x00\x00\xfe\x00\xfc>\x00>\x00\x00|\x00|?\x00\x00\x00\x00\x00\x00\xfc?\x00\x00\x00\x00\x00\x00\xfc?\x00\x00\x00\x00\x00\x00\xfc?\x00\x00\x00\x00\x00\x00\xfc\x1f\x00\x00\x00\x00\x00\x00\xf8?\x80\x00\x00\x00\x00\x01\xfc\x1f\x80\x00\x00\x00\x00\x01\xf8\x1f\x80\x00\x00\x00\x00\x01\xf8\x0f\xc0\x00\x00\x00\x00\x01\xf8\x0f\xc0\x00\x00\x00\x00\x03\xf0\x0f\xe0\x00\x00\x00\x00\x03\xf0\x07\xe0\x00\x00\x00\x00\x07\xe0\x07\xf0\x00\x1f\x80\x00\x0f\xe0\x03\xf0\x00?\xc0\x00\x0f\xc0\x03\xf8\x00?\xc7\x00\x1f\xc0\x01\xfc\x009\xe7\x00?\x80\x00\xfe\x001\xe7\x00\x7f\x80\x00\xff\x000\xfe\x00\xff\x00\x00\x7f\xc0\x00~\x03\xfe\x00\x00?\xe0\x00<\x07\xfc\x00\x00\x1f\xf8\x00\x00\x1f\xf8\x00\x00\x0f\xfe\x00\x00\x7f\xf0\x00\x00\x07\xff\xc0\x01\xff\xe0\x00\x00\x03\xff\xff\xff\xff\x80\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00?\xfe\xff\xfc\x00\x00\x00\x00\x0f\xff\xff\xf8\x00\x00\x00\x00\x01\xff\xff\x80\x00\x00\x00\x00\x00?\xfa\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
|
||||
Happy=b'P4\n64\n64\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00?\xfc\x00\x00\x00\x00\x00\x03\xff\xff\xc0\x00\x00\x00\x00\x0f\xff\xff\xf0\x00\x00\x00\x00?\xff\xff\xfc\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x03\xff\xff\x7f\xff\xc0\x00\x00\x07\xff\x80\x03\xff\xe0\x00\x00\x0f\xfc\x00\x00?\xf0\x00\x00\x1f\xf0\x00\x00\x1f\xf8\x00\x00?\xe0\x00\x00\x07\xfc\x00\x00\x7f\x80\x00\x00\x01\xfe\x00\x00\xff\x00\x00\x00\x00\xff\x00\x00\xfe\x00\x00\x00\x00\x7f\x00\x03\xfc\x00\x00\x00\x00?\x80\x03\xf8\x00\x00\x00\x00\x1f\xc0\x03\xf8\x00\x00\x00\x00\x0f\xc0\x07\xe0\x00\x00\x00\x00\x0f\xe0\x07\xe0\x00\x00\x00\x00\x07\xf0\x0f\xe0\x00\x00\x00\x00\x07\xf0\x0f\xc0\x00\x00\x00\x00\x03\xf0\x1f\xc0\x00\x00\x00\x00\x03\xf8\x1f\x80\x00\x00\x00\x00\x01\xf8\x1f\x80\x14\x00\x008\x01\xf8\x1f\x00~\x00\x00~\x00\xf8?\x00\xff\x00\x00\xff\x00\xfc?\x00\xff\x80\x01\xff\x00\xfc?\x00\xff\x00\x01\xff\x00\xfc?\x00\xff\x80\x00\xff\x00\xfc?\x00\xff\x00\x00\xff\x00\xfc?\x00\x7f\x00\x00\xfe\x00|>\x00<\x00\x00|\x00\xfc?\x00\x00\x00\x00\x00\x00|?\x00\x00\x00\x00\x00\x00\xfc?\x00\x00\x00\x00\x00\x00\xfc?\x00\x00\x00\x00\x00\x00\xfc\x1f\x00\x00\x00\x00\x00\x00\xf8?\x80\x00\x00\x00\x00\x01\xfc\x1f\x80\x00\x00\x00\x00\x01\xf8\x1f\x80\x00\x00\x00\x00\x01\xf8\x1f\xc0\x00\x00\x00\x00\x01\xf8\x0f\xc0\x00\x00\x00\x00\x03\xf0\x0f\xe0\x02\xfa\xd5\x80\x07\xf0\x07\xe0\x03\xff\xff\xc0\x07\xe0\x07\xf0\x07\xff\xff\xe0\x0f\xe0\x03\xf8\x03\xff\xff\xc0\x0f\xc0\x03\xf8\x03\xff\xff\xc0\x1f\xc0\x01\xfc\x01\xff\xff\x80?\x80\x01\xfe\x01\xff\xff\x80\x7f\x80\x00\xff\x00\xff\xff\x00\xff\x00\x00\x7f\x80\x7f\xfe\x03\xfe\x00\x00?\xe0?\xfc\x07\xfc\x00\x00\x1f\xf0\x07\xf0\x1f\xf8\x00\x00\x0f\xfe\x00\x00\x7f\xf0\x00\x00\x07\xff\xc0\x01\xff\xe0\x00\x00\x03\xff\xfe\xbf\xff\x80\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00?\xff\xff\xfc\x00\x00\x00\x00\x0f\xff\xff\xf0\x00\x00\x00\x00\x01\xff\xff\xc0\x00\x00\x00\x00\x00?\xf8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
|
||||
Heart=b'P4\n64\n64\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x03\xfe\x00\x00\x7f\xc0\x00\x00\x1f\xff\xc0\x03\xff\xf8\x00\x00\x7f\xff\xf0\x0f\xff\xfe\x00\x00\xff\xff\xf8\x1f\xff\xff\x00\x01\xff\xff\xfe\x7f\xff\xff\x80\x03\xff\xff\xff\x7f\xff\xff\xc0\x07\xff\xff\xff\xff\xff\xff\xe0\x0f\xff\xff\xff\xff\xff\xff\xf0\x0f\xff\xff\xff\xff\xff\xff\xf0\x1f\xff\xff\xff\xff\xff\xff\xf8\x1f\xff\xff\xff\xff\xff\xff\xf8\x1f\xff\xff\xff\xff\xff\xff\xf8?\xff\xff\xff\xff\xff\xff\xfc?\xff\xff\xff\xff\xff\xff\xfc?\xff\xff\xff\xff\xff\xff\xfc?\xff\xff\xff\xff\xff\xff\xfc?\xff\xff\xff\xff\xff\xff\xfc?\xff\xff\xff\xff\xff\xff\xfc?\xff\xff\xff\xff\xff\xff\xfc?\xff\xff\xff\xff\xff\xff\xfc?\xff\xff\xff\xff\xff\xff\xf8\x1f\xff\xff\xff\xff\xff\xff\xfc\x1f\xff\xff\xff\xff\xff\xff\xf8\x1f\xff\xff\xff\xff\xff\xff\xf8\x0f\xff\xff\xff\xff\xff\xff\xf0\x0f\xff\xff\xff\xff\xff\xff\xf0\x07\xff\xff\xff\xff\xff\xff\xe0\x07\xff\xff\xff\xff\xff\xff\xc0\x03\xff\xff\xff\xff\xff\xff\xc0\x01\xff\xff\xff\xff\xff\xff\x80\x00\xff\xff\xff\xff\xff\xff\x80\x00\xff\xff\xff\xff\xff\xff\x00\x00\x7f\xff\xff\xff\xff\xfe\x00\x00?\xff\xff\xff\xff\xfc\x00\x00\x1f\xff\xff\xff\xff\xf8\x00\x00\x0f\xff\xff\xff\xff\xf0\x00\x00\x07\xff\xff\xff\xff\xe0\x00\x00\x03\xff\xff\xff\xff\xc0\x00\x00\x01\xff\xff\xff\xff\xc0\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00\x7f\xff\xff\xfe\x00\x00\x00\x00?\xff\xff\xfc\x00\x00\x00\x00\x1f\xff\xff\xf8\x00\x00\x00\x00\x0f\xff\xff\xf0\x00\x00\x00\x00\x07\xff\xff\xe0\x00\x00\x00\x00\x03\xff\xff\xc0\x00\x00\x00\x00\x01\xff\xff\x80\x00\x00\x00\x00\x00\xff\xfe\x00\x00\x00\x00\x00\x00?\xfe\x00\x00\x00\x00\x00\x00\x1f\xf8\x00\x00\x00\x00\x00\x00\x0f\xf0\x00\x00\x00\x00\x00\x00\x07\xe0\x00\x00\x00\x00\x00\x00\x03\xc0\x00\x00\x00\x00\x00\x00\x01\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
|
||||
Paper=b'P4\n64\n64\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00|\x00\x00\x00\x00\x00\x00\x01\xff\x00`\x00\x00\x00\x00\x01\xff\x83\xfc\x00\x00\x00\x00\x07\xff\xc7\xff\x00\x00\x00\x00\x07\xe7\xcf\xff\x80\x00\x00\x00\x0f\x83\xff\xff\x80\x00\x00\x00\x0f\x03\xff\x07\x80\x00\x00\x00\x0f\x03\xfe\x07\xc0\x00\x00\x00\x1f\x01\xfc\x03\xc0\x00\x00\x00\x1e\x01\xf8\x03\xc0\x00\x00\x00\x1e\x01\xf8\x07\xcc\x00\x00\x00\x1e\x03\xf0\x07\xff\x00\x00\x00\x1e\x03\xe0\x0f\xff\x80\x00\xbc\x1e\x03\xe0\x0f\xff\xc0\x01\xff\x1e\x03\xc0\x1f\xff\xc0\x03\xff\xfe\x03\xc0?\xc3\xe0\x07\xff\xfe\x01\xc0?\x81\xe0\x07\xc7\xfe\x00\x00~\x01\xe0\x07\x81\xfe\x00\x00\xfc\x01\xe0\x0f\x80\xfe\x00\x01\xf8\x03\xe0\x0f\x80~\x00\x01\xf0\x07\xc0\x07\x80>\x00\x00\xe0\x0f\xc0\x07\x80\x1e\x00\x00@\x1f\x80\x07\xc0\x0e\x00\x00\x00?\x00\x03\xe0\x06\x00\x00\x00~\x00\x03\xe0\x06\x00\x00\x00\xfc\x00\x01\xf0\x02\x00\x00\x03\xff\x00\x00\xf8\x00\x00\x00\x07\xff\xc0\x00\xfc\x00\x00\x00\x07\xff\xe0\x00|\x00\x00\x00\x07\xff\xe0\x00>\x00\x00\x00\x03\x81\xf0\x00\x1e\x00\x00\x00\x00\x00\xf0\x00\x1e\x00\x00\x00\x00\x00\xf0\x00\x1e\x00\x00\x00\x00\x01\xf0\x00\x1e\x00\x00\x00\x00\x03\xf0\x00\x1e\x00\x00\x00\x00\x07\xe0\x00>\x00\x00\x00\x00\x7f\xc0\x00<\x00\x00\x00\xff\xff\x80\x00|\x00\x00\x01\xff\xff\x00\x00|\x00\x00\x03\xff\xfc\x00\x00<\x00\x00\x03\xff\xe0\x00\x00<\x00\x00\x07\xe0\x00\x00\x00>\x00\x00\x0f\x80\x00\x00\x00>\x00\x00\x1f\x80\x00\x00\x00\x1f\x00\x00?\x00\x00\x00\x00\x0f\x80\x00~\x00\x00\x00\x00\x0f\xc0\x00\xfc\x00\x00\x00\x00\x07\xf0\x03\xf8\x00\x00\x00\x00\x03\xf8\x07\xf0\x00\x00\x00\x00\x01\xff?\xc0\x00\x00\x00\x00\x00\x7f\xff\x80\x00\x00\x00\x00\x00?\xff\x00\x00\x00\x00\x00\x00\x0f\xfc\x00\x00\x00\x00\x00\x00\x03\xf0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
|
||||
Rock=b'P4\n64\n64\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00~\x00\x00\x00\x00\x00\x00\xc1\xff\xc0\x00\x00\x00\x00\x07\xff\xff\xe0\x00\x00\x00\x00\x1f\xff\xff\xf0\x00\x00\x00\x00?\xff\xc3\xf8\x00\x00\x00\x00?\xff\x00\xff\xf0\x00\x00\x00|\x0f\x00\x7f\xfc\x00\x00\x00x\x0e\x00\xff\xfe\x00\x00\x07\xf8\x1e\x03\xff\xff\x00\x00\x1f\xf8\x1c\x0f\xf0\x1f\x80\x00?\xf0\x1c\x1f\x80\x0f\xc0\x00\x7f\xf0\x1c\x1e\x00\x07\xe0\x00\xfe\xf0\x1e<\x00\x03\xe0\x00\xf8p\x1e8\x00\x01\xe0\x00\xf0p\x0e8\x00\x01\xf0\x01\xf0x\x0e8\x00\x00\xf0\x01\xe0x\x0f8\x00\x00\xf0\x01\xe0<\x078\x00\x00\xf0\x01\xe0<\x07\xfc\x0f\x00\xf0\x03\xe0\x1e\x03\xbf\xff\x00\xf0\x0f\xf0\x1f\x03\xff\xff\x00\xf8\x1f\xf0\x0f\x81\xef\xfc\x00\xf8\x1f\xf0\x07\xc0\xff\xe0\x00x>x\x03\xe0\xff\x80\x00\xf8><\x01\xf1\xfc\x00\x00\xf8<>\x00\xff\xf0\x00\x00\xf8<\x1f\x00\x7f\xc0\x00\x00\xf0<\x0f\x80?\x00\x00\x00\xf0>\x07\xc0~\x00\x00\x00\xf0\x1e\x03\xe1\xf8\x00\x00\x00\xf0\x1f\x01\xf3\xf0\x00\x00\x01\xf0\x1f\x00\xff\xc0\x00\x00\x01\xe0\x0f\x80\x7f\x80\x00\x00\x01\xe0\x0f\x80\x1f\x00\x00\x00\x03\xe0\x07\xc0\x1e\x00\x00\x00\x03\xe0\x03\xe0<\x00\x00\x00\x07\xc0\x03\xf8x\x00\x00\x00\x0f\xc0\x01\xfcx\x00\x00\x00\x1f\x80\x00\xff\xf0\x00\x00\x00\x7f\x00\x00?\xf0\x00\x00\x01\xfe\x00\x00\x1f\xf0\x00\x00\x07\xfc\x00\x00\x07\xf0\x00\x00\x1f\xf0\x00\x00\x00\xf8\x00\x00?\xc0\x00\x00\x00|\x00\x00\xff\x80\x00\x00\x00~\x00\x03\xfe\x00\x00\x00\x00?\x00\x0f\xf8\x00\x00\x00\x00\x1f\x80?\xe0\x00\x00\x00\x00\x1f\xe0\xff\x80\x00\x00\x00\x00\x07\xff\xfe\x00\x00\x00\x00\x00\x03\xff\xf8\x00\x00\x00\x00\x00\x01\xff\xe0\x00\x00\x00\x00\x00\x00\x7f\xc0\x00\x00\x00\x00\x00\x00\x06\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
|
||||
Sad=b'P4\n64\n64\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00?\xfc\x00\x00\x00\x00\x00\x03\xff\xff\xc0\x00\x00\x00\x00\x0f\xff\xff\xf0\x00\x00\x00\x00?\xff\xff\xfc\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x03\xff\xfe\xff\xff\xc0\x00\x00\x07\xff\x80\x03\xff\xe0\x00\x00\x0f\xfe\x00\x00\x7f\xf0\x00\x00\x1f\xf0\x00\x00\x1f\xf8\x00\x00?\xe0\x00\x00\x07\xfc\x00\x00\x7f\x80\x00\x00\x01\xfe\x00\x00\xff\x00\x00\x00\x00\xff\x00\x01\xfe\x00\x00\x00\x00\x7f\x00\x01\xfc\x00\x00\x00\x00?\x80\x03\xf8\x00\x00\x00\x00\x1f\xc0\x03\xf0\x00\x00\x00\x00\x1f\xc0\x07\xf0\x00\x00\x00\x00\x0f\xe0\x0f\xe0\x00\x00\x00\x00\x07\xe0\x07\xe0\x00\x00\x00\x00\x07\xf0\x0f\xc0\x00\x00\x00\x00\x03\xf0\x1f\xc0\x00\x00\x00\x00\x01\xf8\x1f\x80\x00\x00\x00\x00\x01\xf8\x1f\x80\x00\x00\x00\x00\x01\xf8?\x00\x00\x00\x00\x00\x01\xfc\x1f\x07\xff\xe0\x0f\xff\xc0\xf8?\x07\xff\xe0\x0f\xff\xe0\xfc?\x07\xff\xf0\x0f\xff\xc0\xfc?\x07\xff\xe0\x0f\xff\xc0\xfc?\x00\x7f\x00\x00\xfe\x00\xfc?\x00?\x00\x00\xfc\x00\xfc>\x00\x7f\x00\x00\xfe\x00|?\x00?\x00\x00~\x00\xfc?\x00~\x00\x00\xfe\x00\xfc?\x00?\x00\x00\xfe\x00\xfc?\x00\x7f\x00\x00\xfc\x00\xfc\x1f\x00\x7f\x00\x00\xfe\x00\xf8\x1f\x00?\x00\x00\xfe\x01\xfc\x1f\x80\x7f\x00\x00\xfe\x01\xf8\x1f\x80\x7f\x00\x00\xfe\x01\xf8\x1f\xc0?\x00\x00|\x01\xf8\x0f\xc0\x7f\x00\x00\xfe\x03\xf0\x0f\xe0\x7f\x0f\xe0\xfe\x03\xf0\x07\xe0?\x1f\xf8\xfe\x07\xe0\x07\xf0\x7f\x7f\xfe\xfc\x0f\xe0\x03\xf0\x7f|?~\x0f\xc0\x03\xf8?\xf0\x0f\xfe\x1f\xc0\x01\xfc\x7f\xe0\x07\xfe?\x80\x00\xfe\x7f\xc0\x03\xfe\x7f\x00\x00\xff?@\x02\xfe\xff\x00\x00\x7f\xff\x00\x00\xff\xfe\x00\x00?\xff\x00\x00\xff\xfc\x00\x00\x1f\xff\x00\x00\xff\xf8\x00\x00\x0f\xff\x00\x00\xff\xf0\x00\x00\x07\xff\xc0\x00\xff\xe0\x00\x00\x01\xff\xff\x7f\xff\x80\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00?\xff\xff\xfc\x00\x00\x00\x00\x0f\xff\xff\xf8\x00\x00\x00\x00\x03\xff\xff\x80\x00\x00\x00\x00\x00?\xfc\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
|
||||
Scissors=b'P4\n64\n64\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0f\x80\x00\x00\x00\x00\x00\x00?\xf0\x00\x00\x00\x00\x00\x00\xff\xfc\x00\x00\x00\x00\x00\x01\xff\xff\x00\x00\x00\x00\x00\x01\xf8\xff\x80\x00\x00\x00\x00\x03\xe0\x1f\xc0\x00\x00\x00\x00\x07\xc0\x07\xf0\x00\x00\x00\x00\x07\xc0\x03\xf8\x00\x00\x00\x00\x07\x80\x01\xfc\x00\x00\x00\x00\x07\x80\x00~\x00\x00\x00\x00\x07\x80\x00?\x00\x00\x00\x00\x07\x80\x00\x1f\xfc\x00\x00\x00\x07\xc0\x00\x0f\xff\x80\x00\x00\x03\xe0\x00\x07\xff\xe0\x00\x00\x03\xf0\x00\x03\xff\xf8\x00\x00\x01\xf8\x00\x00\xe7\xfc\x00\x00\x00\xfc\x00\x01\xe0\xfe\x00\x00\x00\x7f\x00\x01\xe0?\x00\x00\x03\xff\x80\x01\xc0\x1f\x80\x00\x7f\xff\xe0\x03\xc0\x1f\x80\x01\xff\xff\xf8\x03\x80\x1f\xc0\x03\xff\xff\xff\x03\x80\x1f\xe0\x07\xff\xff\xff\x07\x80\x1f\xe0\x0f\xc0\x01\xff\x07\x00\x1f\xe0\x0f\x80\x00\x1e\x07\x00=\xf0\x1f\x00\x00\x00\x07\x00<\xf0\x1e\x00\x00\x00\x07\x008\xf0\x1e\x00\x00\x00\x0f\x00x\xf0\x1e\x00\x00\x00\x7f\x00\xf0\xf0\x1f\x00\x00\x01\xff\x00\xf0\xf8\x0f\x00\x00\x07\xff\x01\xe0\xf8\x0f\x80\x00\x0f\xef\x03\xc0x\x0f\xe0\x00?\x07\x87\xc0\xf8\x07\xff\x7f\xfe\x03\xff\x80\xf8\x03\xff\xff\xfc\x03\xff\x00\xf8\x01\xff\xff\xf8\x01\xfe\x00\xf0\x00\x7f\xff\xf8\x07\xff\x00\xf0\x00\x01\xd0|\x7f\xff\xc0\xf0\x00\x00\x00\x7f\xff\xff\xe0\xf0\x00\x00\x00?\xfc\x01\xf1\xf0\x00\x00\x00\x1f\xe0\x00\xf1\xe0\x00\x00\x00\x0f\x00\x00s\xe0\x00\x00\x00\x0f\x00\x00s\xe0\x00\x00\x00\x0f\x00\x00\xff\xc0\x00\x00\x00\x0f\x00\x00\xff\x80\x00\x00\x00\x0f\x80\x03\xff\x00\x00\x00\x00\x07\xf0\xff\xfe\x00\x00\x00\x00\x07\xff\xff\xfc\x00\x00\x00\x00\x03\xff\xff\xc0\x00\x00\x00\x00\x01\xff\xfe\x00\x00\x00\x00\x00\x007@\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
|
||||
Silly=b'P4\n64\n64\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00?\xfc\x00\x00\x00\x00\x00\x03\xff\xff\xc0\x00\x00\x00\x00\x0f\xff\xff\xf0\x00\x00\x00\x00?\xff\xff\xfc\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x03\xff\xf4\x1f\xff\xc0\x00\x00\x07\xff\x00\x01\xff\xe0\x00\x00\x0f\xfc\x00\x00?\xf0\x00\x00\x1f\xf0\x00\x00\x0f\xf8\x00\x00?\xc0\x00\x00\x03\xfc\x00\x00\x7f\x80\x00\x00\x01\xfe\x00\x00\xff\x00\x00\x00\x00\xff\x00\x00\xfc\x00\x00\x00\x00?\x00\x01\xfc\x00\x00\x00\x00?\x80\x03\xf8\x00\x00\x00\x00\x1f\xc0\x07\xf0\x01\x00\x00\x00\x0f\xc0\x07\xe0\x03\x80\x01\xe0\x07\xe0\x07\xe0\x07\x80\x01\xe0\x07\xe0\x0f\xc0\x0f\x80\x01\xf0\x03\xf0\x0f\xc0?\x00\x00\xfc\x03\xf0\x1f\x87\xfe\x00\x00\x7f\xe1\xf8\x1f\x87\xfc\x00\x00?\xe1\xf8\x1f\x07\xf8\x00\x00\x0f\xf0\xf8\x1f\x07\xcc\x00\x00s\xe1\xf8?\x00\x1f\x00\x00\xf8\x00\xfc?\x00?\x80\x01\xfc\x00\xfc?\x00\x7f\xc0\x03\xfc\x00|>\x00\x7f\xc0\x01\xfe\x00\xfc>\x00?\x80\x03\xfe\x00|>\x00?\x80\x01\xfc\x00|?\x00?\x80\x00\xf8\x00|>\x00\x0e\x00\x00p\x00\xfc>\x00\x00\x00\x00\x00\x00|?\x00\x00\x00\x00\x00\x00\xfc?\x00\x00\x00\x00\x00\x00\xfc\x1f\x00\x00\x03\xc0\x00\x00\xf8?\x00\x00\x07\xe0\x00\x00\xfc\x1f\x00\x00\x0f\xe0\x00\x00\xf8\x1f\x80\x00\x07\xe0\x00\x01\xf8\x1f\x80\x00\x07\xf0\x00\x01\xf8\x0f\xc0\x00\x0f\xe0\x00\x03\xf0\x0f\xc0\x00\x0f\xe0\x00\x03\xf0\x07\xe0\x00\x07\xe0\x00\x07\xe0\x07\xe0\x00\x07\xf0\x00\x07\xe0\x07\xf0\x00\x0f\xe0\x00\x0f\xc0\x03\xf8\x00\x07\xe0\x00\x1f\xc0\x01\xfc\x00\x0f\xf0\x00?\x80\x00\xfc\x00\x07\xe0\x00?\x00\x00\xff\x00\x07\xe0\x00\xff\x00\x00\x7f\x80\x07\xc0\x01\xfe\x00\x00?\xc0\x00\x80\x03\xfc\x00\x00\x1f\xf0\x00\x00\x0f\xf8\x00\x00\x0f\xfc\x00\x00?\xf0\x00\x00\x07\xff\x00\x01\xff\xe0\x00\x00\x01\xff\xfa7\xff\x80\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00?\xff\xff\xfc\x00\x00\x00\x00\x0f\xff\xff\xf0\x00\x00\x00\x00\x03\xff\xff\xc0\x00\x00\x00\x00\x00?\xf8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
|
||||
Sleep=b'P4\n64\n64\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00?\xfc\x00\x00\x00\x00\x00\x03\xff\xff\xc0\x00\x00\x00\x00\x0f\xff\xff\xf0\x00\x00\x00\x00\x7f\xff\xff\xfc\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x03\xff\xfd\x7f\xff\xc0\x00\x00\x07\xff\x80\x01\xff\xe0\x00\x00\x0f\xfc\x00\x00\x7f\xf0\x00\x00\x1f\xf8\x00\x00\x1f\xf8\x00\x00?\xc0\x00\x00\x07\xfc\x00\x00\x7f\xc0\x00\x00\x01\xfe\x00\x00\xff\x00\x00\x00\x00\xff\x00\x01\xfe\x00\x00\x00\x00\x7f\x00\x01\xfc\x00\x00\x00\x00?\x80\x03\xf8\x00\x00\x00\x03\xff\xc0\x03\xf0\x00\x00\x00\x07\xef\xc0\x07\xf0\x00\x00\x00\x00\xef\xe0\x07\xe0\x00\x00\x00\x01\xc7\xe0\x0f\xe0\x00\x00\x00\x07\xa7\xf0\x0f\xc0\x00\x00\x00\x07\xe3\xf0\x1f\x80\x00\x00\x00\xf3C\xf8\x1f\x80\x00\x00\x01\xf8\x01\xf8\x1f\x80\x00\x00\x00p\x01\xf8\x1f\x80\x00\x00\x00\xe0\x00\xf8?\x00\x00\x00\x01\xf8\x00\xfc?\x00\x00\x00\x00\xf0\x00\xfc?\x00\x00\x00\x00\x00\x00\xfc?\x00\x00\x00\x00\x00\x00\xfc>\x03\xff\xe0\x07\xaf\xc0\xfc?\x03\xff\xe0\x07\xff\xc0\xfc?\x03\xff\xe0\x07\xff\xc0|?\x01\xff\x80\x03\xff\x80\xfc>\x00\x00\x00\x00\x10\x00\xfc?\x00\x00\x00\x00\x00\x00\xfc?\x00\x00\x00\x00\x00\x00\xfc\x1f\x00\x00\x00\x00\x00\x00\xfc?\x80\x00\x00\x00\x00\x00\xf8\x1f\x80\x00\x00\x00\x00\x01\xf8\x1f\x80\x00\x01@\x00\x01\xf8\x1f\xc0\x00\x1f\xf8\x00\x03\xf8\x0f\xc0\x00\x7f\xfe\x00\x03\xf0\x0f\xe0\x00\xff\xff\x00\x03\xf0\x07\xe0\x01\xff\xff\x80\x07\xe0\x07\xf0\x01\xff\xff\x80\x0f\xe0\x03\xf0\x03\xff\xff\xc0\x0f\xc0\x03\xf8\x03\xff\xff\xc0?\xc0\x01\xfc\x01\xff\xff\x80?\x80\x00\xfe\x01\xff\xff\x80\x7f\x80\x00\xff\x00|\x00\x00\xff\x00\x00\x7f\x80x\x00\x01\xfe\x00\x00?\xe0<\x00\x07\xfc\x00\x00\x1f\xf88\x00\x1f\xf8\x00\x00\x0f\xfe\x00\x00\x7f\xf0\x00\x00\x07\xff\x80\x03\xff\xe0\x00\x00\x03\xff\xfd\xff\xff\x80\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00?\xff\xff\xfc\x00\x00\x00\x00\x0f\xff\xff\xf8\x00\x00\x00\x00\x03\xff\xff\x80\x00\x00\x00\x00\x00?\xf8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
|
||||
Small_heart=b'P4\n64\n64\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1f\xe0\x07\xf8\x00\x00\x00\x00\x7f\xf8\x1f\xfe\x00\x00\x00\x00\xff\xfe?\xff\x00\x00\x00\x01\xff\xff\x7f\xff\x80\x00\x00\x03\xff\xff\xff\xff\xc0\x00\x00\x07\xff\xff\xff\xff\xe0\x00\x00\x07\xff\xff\xff\xff\xe0\x00\x00\x0f\xff\xff\xff\xff\xf0\x00\x00\x0f\xff\xff\xff\xff\xf0\x00\x00\x0f\xff\xff\xff\xff\xf0\x00\x00\x0f\xff\xff\xff\xff\xf0\x00\x00\x0f\xff\xff\xff\xff\xf0\x00\x00\x0f\xff\xff\xff\xff\xf0\x00\x00\x0f\xff\xff\xff\xff\xf0\x00\x00\x0f\xff\xff\xff\xff\xe0\x00\x00\x07\xff\xff\xff\xff\xe0\x00\x00\x07\xff\xff\xff\xff\xe0\x00\x00\x03\xff\xff\xff\xff\xc0\x00\x00\x03\xff\xff\xff\xff\xc0\x00\x00\x01\xff\xff\xff\xff\x80\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00\x7f\xff\xff\xff\x00\x00\x00\x00\x7f\xff\xff\xfc\x00\x00\x00\x00?\xff\xff\xfc\x00\x00\x00\x00\x1f\xff\xff\xf8\x00\x00\x00\x00\x0f\xff\xff\xe0\x00\x00\x00\x00\x07\xff\xff\xe0\x00\x00\x00\x00\x01\xff\xff\xc0\x00\x00\x00\x00\x01\xff\xff\x00\x00\x00\x00\x00\x00\x7f\xff\x00\x00\x00\x00\x00\x00\x7f\xfc\x00\x00\x00\x00\x00\x00\x1f\xf8\x00\x00\x00\x00\x00\x00\x0f\xf8\x00\x00\x00\x00\x00\x00\x07\xe0\x00\x00\x00\x00\x00\x00\x03\xc0\x00\x00\x00\x00\x00\x00\x01\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
|
||||
Small_paper=b'P4\n32\n32\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0e\x00\x00\x00\x1f\x1e\x00\x00;\xbf\x00\x001\xf3\x00\x00q\xe1\x80\x00a\xc3\xa0\x00a\x83\xf0\x1fa\x87\xf8?\xe1\x87\x181\xe0\x0e\x180\xe0\x1c80`\x08p\x18 \x00\xe0\x1c\x00\x01\xf0\x0e\x00\x03\xf8\x06\x00\x01\x1c\x06\x00\x00\x0c\x06\x00\x00\x1c\x06\x00\x00\xf8\x0e\x00\x1f\xf0\x06\x00\x1f\x80\x06\x000\x00\x07\x00p\x00\x03\x80\xe0\x00\x01\xc3\xc0\x00\x00\xff\x00\x00\x00>\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
|
||||
Small_rock=b'P4\n32\n32\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xe0\x00\x00?\xf8\x00\x00\x7f\x9c\x00\x00\xe3\x0f\xe0\x03\xc6\x1f\xf0\x07\xc6p8\x0e\xc6`\x18\x0c\xc2@\x1c\x18\xc3@\x0c\x18c\xe3\x0c<q\xff\x0c|8\xf8\x0cf\x1d\xe0\x0cg\x0f\x80\x0cc\x8e\x00\x0cq\xdc\x00\x1c0\xf0\x00\x188`\x00\x18\x1c\xc0\x008\x0f\xc0\x00\xf0\x07\xc0\x03\xe0\x00\xc0\x07\x80\x00\xe0\x1e\x00\x00px\x00\x00?\xe0\x00\x00\x1f\x80\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
|
||||
Small_scissors=b'P4\n32\n32\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00|\x00\x00\x01\xff\x00\x00\x01\x87\x80\x00\x03\x81\xc0\x00\x03\x00\xe0\x00\x03\x00~\x00\x01\x80?\x80\x01\xc0\x0b\xe0\x00\xf0\x18p\x0f\xf8\x18p\x1f\xff\x10x8\x1f0xp\x000l`\x000\xccp\x01\xf0\xcc0\x03\xb1\x8c?\xfe\x1f\x0c\x1f\xfc\x1e\x0c\x01\xce\xff\x8c\x00\x07\xe1\xdc\x00\x03\x00\xd8\x00\x03\x00\xf8\x00\x03\x01\xf0\x00\x03\xff\xe0\x00\x01\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
|
||||
Smile=b'P4\n64\n64\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00?\xfc\x00\x00\x00\x00\x00\x03\xff\xff\xc0\x00\x00\x00\x00\x0f\xff\xff\xf0\x00\x00\x00\x00?\xff\xff\xfc\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x03\xff\xff\x7f\xff\xc0\x00\x00\x07\xff\x80\x03\xff\xe0\x00\x00\x0f\xfc\x00\x00?\xf0\x00\x00\x1f\xf0\x00\x00\x1f\xf8\x00\x00?\xe0\x00\x00\x07\xfc\x00\x00\x7f\x80\x00\x00\x01\xfe\x00\x00\xff\x00\x00\x00\x00\xff\x00\x00\xfe\x00\x00\x00\x00\x7f\x00\x03\xfc\x00\x00\x00\x00?\x80\x03\xf8\x00\x00\x00\x00\x1f\xc0\x03\xf8\x00\x00\x00\x00\x0f\xc0\x07\xe0\x00\x00\x00\x00\x0f\xe0\x07\xe0\x00\x00\x00\x00\x07\xe0\x0f\xe0\x00\x00\x00\x00\x07\xf0\x0f\xc0\x00\x00\x00\x00\x03\xf0\x1f\xc0?\x00\x01\xfc\x03\xf8\x1f\x80\x7f\xc0\x03\xfe\x01\xf8\x1f\x80\xff\xe0\x07\xff\x01\xf8\x1f\x01\xff\xf0\x0f\xff\x81\xf8?\x03\xfb\xf0\x1f\xef\xc0\xfc?\x03\xe0\xf8\x1f\x07\xc0\xfc?\x03\xc0\xf8\x1f\x07\xc0\xfc?\x07\xc0\xf8\x1e\x03\xc0\xfc?\x03\xc0x\x1e\x03\xe0|?\x03\xc0x\x1e\x03\xc0\xfc?\x01\x80 \x0c\x00\x80\xfc>\x00\x00\x00\x00\x00\x00\xfc?\x00\x00\x00\x00\x00\x00|?\x00\x00\x00\x00\x00\x00\xfc?\x00\x00\x00\x00\x00\x00\xfc?\x00\x00\x00\x00\x00\x00\xf8\x1f\x80\x00\x00\x00\x00\x01\xfc\x1f\x80\x00\x00\x00\x00\x01\xf8\x1f\x80\x00\x00\x00\x00\x01\xf8\x0f\xc0\x00\x00\x00\x00\x01\xf0\x0f\xc0\x0e\x00\x000\x03\xf8\x0f\xe0\x0f\x00\x00x\x07\xe0\x07\xe0\x1f\x00\x00\xf0\x07\xf0\x07\xf0\x0f\x00\x00\xf0\x0f\xe0\x03\xf0\x07\x80\x01\xf0\x0f\xc0\x03\xf8\x07\xc0\x03\xe0\x1f\xc0\x01\xfc\x07\xe0\x07\xe0?\x80\x01\xfe\x03\xfc\x1f\xc0\x7f\x80\x00\xff\x01\xff\xff\x80\xff\x00\x00\x7f\xc0\xff\xfe\x03\xfe\x00\x00?\xe0?\xfc\x07\xfc\x00\x00\x1f\xf0\x0f\xf0\x1f\xf8\x00\x00\x0f\xfe\x00\x00?\xf0\x00\x00\x07\xff\xc0\x03\xff\xe0\x00\x00\x03\xff\xff\x7f\xff\x80\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00?\xff\xff\xfc\x00\x00\x00\x00\x0f\xff\xff\xf0\x00\x00\x00\x00\x03\xff\xff\x80\x00\x00\x00\x00\x00?\xfa\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
|
||||
Surprise=b'P4\n64\n64\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00?\xfc\x00\x00\x00\x00\x00\x03\xff\xff\xc0\x00\x00\x00\x00\x0f\xff\xff\xf0\x00\x00\x00\x00\x7f\xff\xff\xfc\x00\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x03\xff\xfd\x7f\xff\xc0\x00\x00\x07\xff\x80\x01\xff\xe0\x00\x00\x0f\xfc\x00\x00\x7f\xf0\x00\x00\x1f\xf8\x00\x00\x1f\xf8\x00\x00?\xc0\x00\x00\x07\xfc\x00\x00\x7f\xc0\x00\x00\x01\xfe\x00\x00\xff\x00\x00\x00\x00\xff\x00\x01\xfe\x00\x00\x00\x00\x7f\x00\x01\xfc\x00\x00\x00\x00?\x80\x03\xf8\x00\x00\x00\x00\x1f\xc0\x03\xf0\x00\x00\x00\x00\x1f\xc0\x07\xf0\x00\x00\x00\x00\x0f\xe0\x07\xe0\x00\x00\x00\x00\x07\xf0\x0f\xc0\x00\x00\x00\x00\x07\xf0\x0f\xc0\x10\x00\x00\x10\x03\xf0\x1f\xc0>\x00\x00|\x01\xf8\x1f\x80\x7f\x00\x00~\x01\xf8\x1f\x80\xff\x00\x00\xff\x01\xf8\x1f\x80\xff\x80\x01\xff\x00\xf8?\x00\xff\x00\x01\xff\x00\xfc?\x00\xff\x80\x01\xff\x00\xfc?\x00\xff\x00\x00\xff\x00\xfc?\x00\xff\x80\x01\xff\x00\xfc>\x00\x7f\x00\x00\xff\x00\xfc?\x00~\x00\x00~\x00|?\x00>\x00\x008\x00\xfc>\x00\x00\x00\x00\x00\x00\xfc?\x00\x00\x00\x00\x00\x00|?\x00\x00\x00\x00\x00\x00\xfc?\x00\x00\x00\x00\x00\x00\xfc?\x00\x00\x00\x00\x00\x00\xfc\x1f\x80\x00\x00\x00\x00\x01\xf8\x1f\x80\x00\x03\xc0\x00\x01\xf8\x1f\x80\x00\x07\xe0\x00\x01\xf8\x1f\xc0\x00\x0f\xf0\x00\x01\xf8\x0f\xc0\x00\x0f\xf0\x00\x03\xf0\x0f\xe0\x00\x0f\xf0\x00\x07\xf0\x07\xe0\x00\x0f\xf8\x00\x07\xe0\x07\xf0\x00\x1f\xf0\x00\x0f\xe0\x03\xf8\x00\x0f\xf8\x00\x0f\xc0\x03\xf8\x00\x0f\xf0\x00\x1f\xc0\x01\xfc\x00\x0f\xf0\x00?\x80\x00\xfe\x00\x0f\xe0\x00\x7f\x80\x00\xff\x00\x07\xe0\x00\xff\x00\x00\x7f\xc0\x03\xc0\x03\xfe\x00\x00?\xe0\x00\x00\x07\xfc\x00\x00\x1f\xf8\x00\x00\x1f\xf8\x00\x00\x0f\xfe\x00\x00\x7f\xf0\x00\x00\x07\xff\x80\x03\xff\xe0\x00\x00\x01\xff\xff\xff\xff\x80\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00?\xff\xff\xfc\x00\x00\x00\x00\x0f\xff\xff\xf0\x00\x00\x00\x00\x03\xff\xff\x80\x00\x00\x00\x00\x00/\xfa\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
|
||||
Wonderful=b'P4\n64\n64\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00?\xfc\x00\x00\x00\x00\x00\x03\xff\xff\xc0\x00\x00\x00\x00\x0f\xff\xff\xf0\x00\x00\x00\x00?\xff\xff\xfc\x00\x00\x02\x00\xff\xff\xff\xff\x00\x00\x07\x03\xff\xff\x7f\xff\xc0\x00\x07\x87\xff\x80\x03\xff\xe0\x00\x1f\xcf\xfc\x00\x00\x7f\xf0\x00\x1f\xdf\xf8\x00\x00\x1f\xf8\x00\x07?\xe0\x00\x00\x07\xfc\x00\x02\x7f\x80\x00\x00\x19\xfe\x00\x02\xff\x00\x00\x00\x1c\xff\x00\x00\xfe\x00\x00\x00>\x7f\x00\x01\xfc\x00\x00\x00\x7f?\x80\x03\xf8\x00\x00\x00\x1c\x1f\xc0\x03\xf0\x00\x00\x00\x18\x1f\xe0\x07\xf0\x00\x00\x00\x08\x0f\xe0\x07\xe0\x00\x00\x00\x00\x07\xe0\x0f\xe0\x00\x00\x00\x00\x07\xf0\x0f\xc0<\x00\x008\x03\xf0\x1f\x80\xff\x00\x00\xff\x01\xf8\x1f\x80\xff\x80\x01\xff\x01\xf8\x1f\x81\xff\x80\x01\xff\x81\xf8?\x83\xff\xc0\x01\xff\xc0\xfc\x1f\x01\xff\xc0\x03\xff\x80\xf8?\x03\xff\xc0\x03\xff\xc0\xfc?\x01\xff\xc0\x03\xff\x80\xfc?\x01\xff\x80\x01\xff\x80\xfc>\x00\xff\x80\x01\xff\x80|?\x00~\x00\x00\xfe\x00\xfc?\x00\x1c\x00\x008\x00\xfc>\x00\x00\x00\x00\x00\x00|?\x00\x00\x00\x00\x00\x00\xfc?\x00\x00\x00\x00\x00\x00\xfc?\x00\x00\x00\x00\x00\x00\xfc?\x00\x00\x00\x00\x00\x00\xf8\x1f\x80\x00\x00\x00\x00\x01\xfc\x1f\x80\x00\x00\x00\x00\x01\xf8\x1f\x80\x00\x00\x00\x00\x01\xf8\x1f\xc0\x00\x00\x00\x01\x03\xf0\x0f\xc0\x00\x00\x00\x01\x83\xf8\x0f\xe0\x00\xff\xff\x03\xc3\xf0\x07\xe0\x00\xff\xff\x0f\xe7\xe0\x07\xf0\x00\xff\xff\x07\xcf\xe0\x03\xf0\x00\x7f\xff\x01\x9f\xc0\x03\xf8\x00\x7f\xfe\x01\x9f\xc0\x01\xfc\x00?\xfc\x00?\x80\x00\xfe\x00\x1f\xf8\x00\x7f\x80\x00\xff\x00\x07\xe0\x00\xff\x00\x00\x7f\x80\x00\x00\x01\xfe\x00\x00?\xe0\x00\x00\x07\xfc\x00\x00\x1f\xf8\x00\x00\x1f\xf8\x00\x00\x0f\xfe\x00\x00\x7f\xf0\x00\x00\x07\xff\xc0\x01\xff\xe0\x00\x00\x03\xff\xff\xff\xff\x80\x00\x00\x00\xff\xff\xff\xff\x00\x00\x00\x00?\xff\xff\xfc\x00\x00\x00\x00\x0f\xff\xff\xf0\x00\x00\x00\x00\x03\xff\xff\x80\x00\x00\x00\x00\x00?\xfc\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
|
||||
31
boards/default/micropython/build/lib/eye_picture.py
Normal file
31
boards/default/micropython/build/lib/eye_picture.py
Normal file
@@ -0,0 +1,31 @@
|
||||
#Take the picture bytes in eye_picture.py
|
||||
#--dahanzimin From the Mixly Team
|
||||
|
||||
Eyes_Angry=b'P4\n89 64\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x1f\xff\xff\x00\x00\x00?\xff\xfc\x00\x7f\x00\x7f\xff\xff\xc0\x00\x01\xff\xff\xff\x80\x7f\x01\xff\xff\xff\xf0\x00\x03\xff\xff\xff\xc0\x7f\x03\xe0\x00\x00\xf8\x00\x07\xc0\x00\x03\xe0\x7f\x07\x80\x00\x00<\x00\x0f\x00\x00\x00\xf0\x7f\x07\x00\x00\x00\x1c\x00\x1e\x00\x00\x00x\x7f\x0e\x00\x00\x00\x0e\x00\x1c\x00\x00\x008\x7f\x0e\x00\x00\x00\x0e\x008\x00\x00\x00\x1c\x7f\x1c\x00\x00\x00\x07\x008\x00\x00\x00\x1c\x7f\x1c\x00\x00\x00\x07\x008\x00\x00\x00\x1c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1e\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1f\x80\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1f\xe0\x00\x00\x07\x000\x00\x00\x00\x1c\x7f\x1d\xf8\x00\x00\x07\x000\x00\x00\x00|\x7f\x1c\xfe\x00\x00\x07\x000\x00\x00\x01\xfc\x7f\x1c?\x80\x00\x07\x000\x00\x00\x07\xfc\x7f\x1c\x0f\xe0\x00\x07\x000\x00\x00\x1f\x8c\x7f\x1c\x03\xf8\x00\x07\x000\x00\x00~\x0c\x7f\x1c\x00\xfe\x00\x07\x000\x00\x01\xf8\x0c\x7f\x1c\x00?\x80\x07\x000\x00\x07\xe0\x0c\x7f\x1c\x00\x0f\xe0\x07\x000\x00\x1f\x80\x0c\x7f\x1c\x00\x07\xf8\x07\x000\x00\x7f\x00\x0c\x7f\x1c\x00\x0f\xfe\x07\x000\x01\xfc\x00\x0c\x7f\x1c\x00\x1f\xff\x87\x000\x07\xf6\x80\x0c\x7f\x1c\x00?\x9f\xe7\x000\x1f\xf2\x00\x0c\x7f\x1c\x00\xbf\xbb\xff\x000\x7f\xef\x00\x0c\x7f\x1c\x00\x7f\xfc\xff\x001\xff\xff@\x0c\x7f\x1c\x00\x7f\xfc?\x00?\xff\xff\x00\x0c\x7f\x1c\x00\x7f\xfc\x0f\x00?\xaf\xff@\x0c\x7f\x1c\x00?\xf8\x07\x00>\x0f\xff\x00\x0c\x7f\x1c\x00\xbf\xfa\x07\x008\x07\xfe\x00\x1c\x7f\x0e\x00\x1f\xf0\x0e\x008\x17\xfe\x80\x1c\x7f\x0e\x00\x0f\xe0\x0e\x00<\x03\xfc\x00<\x7f\x0f\x00\x03\x80\x1e\x00\x1c\x04\xf2\x008\x7f\x07\x80\x04 <\x00\x1e\x01\x08\x00x\x7f\x03\xc0\x00\x00x\x00\x0f\x80\x00\x01\xf0\x7f\x01\xf8\x00\x03\xf0\x00\x07\xe0\x00\x07\xe0\x7f\x00\xff\xff\xff\xe0\x00\x03\xff\xff\xff\xc0\x7f\x00?\xff\xff\x80\x00\x00\xff\xff\xff\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f'
|
||||
Awake=b'P4\n89 64\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x1f\xff\xff\x00\x00\x00?\xff\xfc\x00\x7f\x00\x7f\xff\xff\xc0\x00\x01\xff\xff\xff\x80\x7f\x01\xff\xff\xff\xf0\x00\x03\xff\xff\xff\xc0\x7f\x03\xe0\x00\x00\xf8\x00\x07\xc0\x00\x03\xe0\x7f\x07\x80\x00\x00<\x00\x0f\x00\x00\x00\xf0\x7f\x07\x00\x00\x00\x1c\x00\x1e\x00\x00\x00x\x7f\x0e\x00\x00\x00\x0e\x00\x1c\x00\x00\x008\x7f\x0e\x00\x00\x00\x0e\x008\x00\x00\x00\x1c\x7f\x1c\x00\x00\x00\x07\x008\x00\x00\x00\x1c\x7f\x1c\x00\x00\x00\x07\x008\x00\x00\x00\x1c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1f\x00\x00\x00\x07\x000\x00\x00\x00|\x7f\x1f\xf8\x00\x00\x07\x000\x00\x00\x07\xfc\x7f\x1f\xff\xc0\x00\x07\x000\x00\x01\xff\xfc\x7f\x1c\x1f\xff\x00\x07\x000\x00?\xfe\x0c\x7f\x1c\x00\xff\xf0\x07\x000\x07\xff\xc0\x0c\x7f\x1c\x00?\xff\x87\x000\x7f\xfe\x00\x0c\x7f\x1c\x01\x7f\xff\xff\x00?\xff\xff\x00\x0c\x7f\x1c\x00~i\xff\x00?\xe1\xfd\xa0\x0c\x7f\x1c\x02\xfeh\x0f\x00<\x03\xf9\xc0\x0c\x7f\x1c\x01\xff\xf0\x07\x000\x03\xff\xc0\x0c\x7f\x1c\x01\xff\xf0\x07\x000\x0b\xff\xd0\x0c\x7f\x1c\x01\xff\xf0\x07\x000\x03\xff\xc0\x0c\x7f\x1c\x01\xff\xf0\x07\x000\x0b\xff\xd0\x0c\x7f\x1c\x02\xff\xe8\x07\x000\x03\xff\xc0\x0c\x7f\x1c\x00\xff\xc0\x07\x000\x05\xff\xa0\x0c\x7f\x1c\x01\x7f\xd0\x07\x000\x00\xff\x00\x0c\x7f\x1c\x00\x1f\x00\x07\x000\x00~\x00\x0c\x7f\x1c\x00@@\x07\x000\x00\x81\x00\x0c\x7f\x1c\x00\n\x00\x07\x000\x00(\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x008\x00\x00\x00\x1c\x7f\x0e\x00\x00\x00\x0e\x008\x00\x00\x00\x1c\x7f\x0e\x00\x00\x00\x0e\x00<\x00\x00\x00<\x7f\x0f\x00\x00\x00\x1e\x00\x1c\x00\x00\x008\x7f\x07\x80\x00\x00<\x00\x1e\x00\x00\x00x\x7f\x03\xc0\x00\x00x\x00\x0f\x80\x00\x01\xf0\x7f\x01\xf8\x00\x03\xf0\x00\x07\xe0\x00\x07\xe0\x7f\x00\xff\xff\xff\xe0\x00\x03\xff\xff\xff\xc0\x7f\x00?\xff\xff\x80\x00\x00\xff\xff\xff\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f'
|
||||
Black_eye=b'P4\n89 64\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00?\xff\xfc\x00\x7f\x00\x00\x00\x00\x00\x00\x01\xff\xff\xff\x80\x7f\x00\x00\x00\x00\x00\x00\x03\xff\xff\xff\xc0\x7f\x00\x1f\xff\xfe\x00\x00\x07\xc0\x00\x03\xe0\x7f\x00\x7f\xff\xff\xc0\x00\x0f\x00\x00\x00\xf0\x7f\x01\xff\xff\xff\xf0\x00\x1e\x00\x00\x00x\x7f\x03\xfa\xaa\xab\xf8\x00\x1c\x00\x00\x008\x7f\x07\xd2U%|\x008\x00\x00\x00\x1c\x7f\x07\xad\xaa\xda\xbc\x008\x00\x00\x00\x1c\x7f\x0fRU%^\x008\x00\x00\x00\x1c\x7f\x0fm\xaa\xda\xae\x000\x00\x00\x00\x0c\x7f\x1e\x92U$\xaf\x000\x00\x00\x00\x0c\x7f\x1dm\xaa\xdbW\x000\x00\x00\x00\x0c\x7f\x1e\x92U$\xaf\x000\x00\x00\x00\x0c\x7f\x1dm\xaa\xdbW\x000\x00\x00\x00\x0c\x7f\x1c\x92U$\xaf\x000\x00\x00\x00\x0c\x7f\x1fm\xaa\xdbW\x000\x00\x00\x00\x0c\x7f\x1c\x92U$\x97\x000\x00\x00\x00\x0c\x7f\x1f\xff\xff\xff\xff\x000\x00B\x00\x0c\x7f\x1f\xff\xff\xff\xff\x000\x018\x80\x0c\x7f\x1f\xff\xff\xff\xff\x000\x00\x7f\x00\x0c\x7f\x1c\x00\x7f\xc0\x07\x000\x05\xfd\xa0\x0c\x7f\x1c\x00\xfe`\x07\x000\x01\xfc\x80\x0c\x7f\x1c\x02\xfe\xe8\x07\x000\x03\xfb\xc0\x0c\x7f\x1c\x01\xff\xf0\x07\x000\x0b\xff\xd0\x0c\x7f\x1c\x01\xff\xf0\x07\x000\x03\xff\xc0\x0c\x7f\x1c\x01\xff\xf0\x07\x000\x0b\xff\xd0\x0c\x7f\x1c\x02\xff\xe8\x07\x000\x03\xff\xc0\x0c\x7f\x1c\x00\xff\xe0\x07\x000\x01\xff\x80\x0c\x7f\x1f\xff\xff\xff\xff\x000\x05\xff\xa0\x0c\x7f\x1f\xff\xff\xff\xff\x000\x00\xff\x00\x0c\x7f\x1f\xff\xff\xff\xff\x000\x01<\x80\x0c\x7f\x1dUUUW\x000\x00B\x00\x0c\x7f\x1dT\x92UW\x000\x00\x00\x00\x0c\x7f\x1e\xabm\xaa\xaf\x000\x00\x00\x00\x0c\x7f\x1dT\x92UW\x000\x00\x00\x00\x0c\x7f\x1fKm\xaa\xaf\x000\x00\x00\x00\x0c\x7f\x0e\xb4\x92U\xae\x000\x00\x00\x00\x0c\x7f\x0fKm\xaa^\x008\x00\x00\x00\x1c\x7f\x07\xb4\x92U\xbc\x008\x00\x00\x00\x1c\x7f\x07\xcbm\xaa|\x00<\x00\x00\x00<\x7f\x03\xf4\x92K\xf8\x00\x1c\x00\x00\x008\x7f\x01\xff\xff\xff\xf0\x00\x1e\x00\x00\x00x\x7f\x00\x7f\xff\xff\xc0\x00\x0f\x80\x00\x01\xf0\x7f\x00\x1f\xff\xff\x00\x00\x07\xe0\x00\x07\xe0\x7f\x00\x00\x00\x00\x00\x00\x03\xff\xff\xff\xc0\x7f\x00\x00\x00\x00\x00\x00\x00\xff\xff\xff\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f'
|
||||
Bottom_left=b'P4\n89 64\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x1f\xff\xff\x00\x00\x00?\xff\xfc\x00\x7f\x00\x7f\xff\xff\xc0\x00\x01\xff\xff\xff\x80\x7f\x01\xff\xff\xff\xf0\x00\x03\xff\xff\xff\xc0\x7f\x03\xe0\x00\x00\xf8\x00\x07\xc0\x00\x03\xe0\x7f\x07\x80\x00\x00<\x00\x0f\x00\x00\x00\xf0\x7f\x07\x00\x00\x00\x1c\x00\x1e\x00\x00\x00x\x7f\x0e\x00\x00\x00\x0e\x00\x1c\x00\x00\x008\x7f\x0e\x00\x00\x00\x0e\x008\x00\x00\x00\x1c\x7f\x1c\x00\x00\x00\x07\x008\x00\x00\x00\x1c\x7f\x1c\x00\x00\x00\x07\x008\x00\x00\x00\x1c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x02\x80\x00\x07\x000\x05\x00\x00\x0c\x7f\x1c\x10\x10\x00\x07\x000 @\x00\x0c\x7f\x1c\x07\xc8\x00\x07\x000\x1f\x80\x00\x0c\x7f\x1c_\xf0\x00\x07\x000?\xc0\x00\x0c\x7f\x1c\x1f\x98\x00\x07\x001\x7fh\x00\x0c\x7f\x1c\xbf\x9a\x00\x07\x000\xfep\x00\x0c\x7f\x1c\x7f\xfc\x00\x07\x000\xff\xf0\x00\x0c\x7f\x1c\x7f\xfc\x00\x07\x002\xff\xf4\x00\x0c\x7f\x1c\x7f\xfc\x00\x07\x000\xff\xf0\x00\x0c\x7f\x1c\x7f\xfc\x00\x07\x002\xff\xf4\x00\x0c\x7f\x1c\xbf\xfa\x00\x07\x000\xff\xf0\x00\x0c\x7f\x1c?\xf0\x00\x07\x001\x7f\xe8\x00\x0c\x7f\x1c_\xf4\x00\x07\x000?\xc0\x00\x0c\x7f\x1c\x07\xc0\x00\x07\x000\x1f\x80\x00\x0c\x7f\x1c\x10\x10\x00\x07\x008 @\x00\x1c\x7f\x0e\x02\x80\x00\x0e\x008\n\x00\x00\x1c\x7f\x0e\x00\x00\x00\x0e\x00<\x00\x00\x00<\x7f\x0f\x00\x00\x00\x1e\x00\x1c\x00\x00\x008\x7f\x07\x80\x00\x00<\x00\x1e\x00\x00\x00x\x7f\x03\xc0\x00\x00x\x00\x0f\x80\x00\x01\xf0\x7f\x01\xf8\x00\x03\xf0\x00\x07\xe0\x00\x07\xe0\x7f\x00\xff\xff\xff\xe0\x00\x03\xff\xff\xff\xc0\x7f\x00?\xff\xff\x80\x00\x00\xff\xff\xff\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f'
|
||||
Bottom_right=b'P4\n89 64\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x1f\xff\xff\x00\x00\x00?\xff\xfc\x00\x7f\x00\x7f\xff\xff\xc0\x00\x01\xff\xff\xff\x80\x7f\x01\xff\xff\xff\xf0\x00\x03\xff\xff\xff\xc0\x7f\x03\xe0\x00\x00\xf8\x00\x07\xc0\x00\x03\xe0\x7f\x07\x80\x00\x00<\x00\x0f\x00\x00\x00\xf0\x7f\x07\x00\x00\x00\x1c\x00\x1e\x00\x00\x00x\x7f\x0e\x00\x00\x00\x0e\x00\x1c\x00\x00\x008\x7f\x0e\x00\x00\x00\x0e\x008\x00\x00\x00\x1c\x7f\x1c\x00\x00\x00\x07\x008\x00\x00\x00\x1c\x7f\x1c\x00\x00\x00\x07\x008\x00\x00\x00\x1c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00(\x07\x000\x00\x00P\x0c\x7f\x1c\x00\x01\x01\x07\x000\x00\x02\x04\x0c\x7f\x1c\x00\x00|\x87\x000\x00\x01\xf8\x0c\x7f\x1c\x00\x05\xff\x07\x000\x00\x03\xfc\x0c\x7f\x1c\x00\x01\xf9\x87\x000\x00\x17\xf6\x8c\x7f\x1c\x00\x0b\xf9\xa7\x000\x00\x0f\xe7\x0c\x7f\x1c\x00\x07\xff\xc7\x000\x00\x0f\xff\x0c\x7f\x1c\x00\x07\xff\xc7\x000\x00/\xffL\x7f\x1c\x00\x07\xff\xc7\x000\x00\x0f\xff\x0c\x7f\x1c\x00\x07\xff\xc7\x000\x00/\xffL\x7f\x1c\x00\x0b\xff\xa7\x000\x00\x0f\xff\x0c\x7f\x1c\x00\x03\xff\x07\x000\x00\x17\xfe\x8c\x7f\x1c\x00\x05\xffG\x000\x00\x03\xfc\x0c\x7f\x1c\x00\x00|\x07\x000\x00\x01\xf8\x0c\x7f\x1c\x00\x01\x01\x07\x008\x00\x02\x04\x1c\x7f\x0e\x00\x00(\x0e\x008\x00\x00\xa0\x1c\x7f\x0e\x00\x00\x00\x0e\x00<\x00\x00\x00<\x7f\x0f\x00\x00\x00\x1e\x00\x1c\x00\x00\x008\x7f\x07\x80\x00\x00<\x00\x1e\x00\x00\x00x\x7f\x03\xc0\x00\x00x\x00\x0f\x80\x00\x01\xf0\x7f\x01\xf8\x00\x03\xf0\x00\x07\xe0\x00\x07\xe0\x7f\x00\xff\xff\xff\xe0\x00\x03\xff\xff\xff\xc0\x7f\x00?\xff\xff\x80\x00\x00\xff\xff\xff\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f'
|
||||
Crazy_1=b'P4\n89 64\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x1f\xff\xff\x00\x00\x00?\xff\xfc\x00\x7f\x00\x7f\xff\xff\xc0\x00\x01\xff\xff\xff\x80\x7f\x01\xff\xff\xff\xf0\x00\x03\xff\xff\xff\xc0\x7f\x03\xe0\x00\x00\xf8\x00\x07\xc0\x00\x03\xe0\x7f\x07\x80\x00\x00<\x00\x0f\x00\x00\x00\xf0\x7f\x07\x00\x00\x00\x1c\x00\x1e\x00\x00\x00x\x7f\x0e\x00\x00\x00\x0e\x00\x1c\x00\x00\x008\x7f\x0e\x00\x00\x00\x0e\x008\x00\x00\x00\x1c\x7f\x1c\x00\x00\x00\x07\x008\x00\x00\x00\x1c\x7f\x1c\x00\x00\x00\x07\x008\x00\x00\x00\x1c\x7f\x1c\x01\x08\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\xe0\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x03\xf8\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x07\xfc\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x0f\xe6\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c/\xee\x80\x07\x000\x00\x00\x00\x0c\x7f\x1c\x1f\xff\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x1f\xff\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x1f\xff\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x0f\xfe\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c/\xfe\x80\x07\x000\x00\x00\x00\x0c\x7f\x1c\x07\xfc\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x03\xf8\x00\x07\x000\x00\x01@\x0c\x7f\x1c\x00\xe0\x00\x07\x000\x00\x08\x10\x0c\x7f\x1c\x01\x08\x00\x07\x000\x00\x07\xe0\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x0f\xf0\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00_\xda\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00?\x9c\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00?\xfc\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\xbf\xfd\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00?\xfc\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\xbf\xfd\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00?\xfc\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00_\xfa\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x0f\xf0\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x07\xe0\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x08\x10\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x02\x80\x0c\x7f\x1c\x00\x00\x00\x07\x008\x00\x00\x00\x1c\x7f\x0e\x00\x00\x00\x0e\x008\x00\x00\x00\x1c\x7f\x0e\x00\x00\x00\x0e\x00<\x00\x00\x00<\x7f\x0f\x00\x00\x00\x1e\x00\x1c\x00\x00\x008\x7f\x07\x80\x00\x00<\x00\x1e\x00\x00\x00x\x7f\x03\xc0\x00\x00x\x00\x0f\x80\x00\x01\xf0\x7f\x01\xf8\x00\x03\xf0\x00\x07\xe0\x00\x07\xe0\x7f\x00\xff\xff\xff\xe0\x00\x03\xff\xff\xff\xc0\x7f\x00?\xff\xff\x80\x00\x00\xff\xff\xff\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f'
|
||||
Crazy_2=b'P4\n89 64\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x1f\xff\xff\x00\x00\x00?\xff\xfc\x00\x7f\x00\x7f\xff\xff\xc0\x00\x01\xff\xff\xff\x80\x7f\x01\xff\xff\xff\xf0\x00\x03\xff\xff\xff\xc0\x7f\x03\xe0\x00\x00\xf8\x00\x07\xc0\x00\x03\xe0\x7f\x07\x80\x00\x00<\x00\x0f\x00\x00\x00\xf0\x7f\x07\x00\x00\x00\x1c\x00\x1e\x00\x00\x00x\x7f\x0e\x00\x00\x00\x0e\x00\x1c\x00\x00\x008\x7f\x0e\x00\x00\x00\x0e\x008\x00\x00\x00\x1c\x7f\x1c\x00\x00\x00\x07\x008\x00\x00\x00\x1c\x7f\x1c\x00\x00\x00\x07\x008\x00\x00\x00\x1c\x7f\x1c\x00\x00\x00\x07\x000\x00\x04 \x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x13\x88\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x07\xf0\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00_\xda\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x1f\xc8\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00?\xbc\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\xbf\xfd\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00?\xfc\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\xbf\xfd\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00?\xfc\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x1f\xf8\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00_\xfa\x0c\x7f\x1c\x00\xa0\x00\x07\x000\x00\x0f\xf0\x0c\x7f\x1c\x04\x04\x00\x07\x000\x00\x13\xc8\x0c\x7f\x1c\x01\xf2\x00\x07\x000\x00\x04 \x0c\x7f\x1c\x17\xfc\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x07\xe6\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c/\xe6\x80\x07\x000\x00\x00\x00\x0c\x7f\x1c\x1f\xff\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x1f\xff\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x1f\xff\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x1f\xff\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c/\xfe\x80\x07\x000\x00\x00\x00\x0c\x7f\x1c\x0f\xfc\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x17\xfd\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x01\xf0\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x04\x04\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\xa0\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x008\x00\x00\x00\x1c\x7f\x0e\x00\x00\x00\x0e\x008\x00\x00\x00\x1c\x7f\x0e\x00\x00\x00\x0e\x00<\x00\x00\x00<\x7f\x0f\x00\x00\x00\x1e\x00\x1c\x00\x00\x008\x7f\x07\x80\x00\x00<\x00\x1e\x00\x00\x00x\x7f\x03\xc0\x00\x00x\x00\x0f\x80\x00\x01\xf0\x7f\x01\xf8\x00\x03\xf0\x00\x07\xe0\x00\x07\xe0\x7f\x00\xff\xff\xff\xe0\x00\x03\xff\xff\xff\xc0\x7f\x00?\xff\xff\x80\x00\x00\xff\xff\xff\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f'
|
||||
Disappointed=b'P4\n89 64\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x1f\xff\xff\x00\x00\x00?\xff\xfc\x00\x7f\x00\x7f\xff\xff\xc0\x00\x01\xff\xff\xff\x80\x7f\x01\xff\xff\xff\xf0\x00\x03\xff\xff\xff\xc0\x7f\x03\xe0\x00\x1f\xf8\x00\x07\xfc\x00\x03\xe0\x7f\x07\x80\x00><\x00\x0f\x1e\x00\x00\xf0\x7f\x07\x00\x00|\x1c\x00\x1e\x0f\x00\x00x\x7f\x0e\x00\x00\xf8\x0e\x00\x1c\x07\x80\x008\x7f\x0e\x00\x01\xf0\x0e\x008\x03\xc0\x00\x1c\x7f\x1c\x00\x03\xe0\x07\x008\x01\xe0\x00\x1c\x7f\x1c\x00\x07\xc0\x07\x008\x00\xf0\x00\x1c\x7f\x1c\x00\x0f\x80\x07\x000\x00x\x00\x0c\x7f\x1c\x00\x1f\x00\x07\x000\x00<\x00\x0c\x7f\x1c\x00>\x00\x07\x000\x00\x1e\x00\x0c\x7f\x1c\x00|@\x07\x000\x00\x9f\x00\x0c\x7f\x1c\x00\xff \x07\x000\x00\x7f\x80\x0c\x7f\x1c\x01\xff\xc0\x07\x000\x00\xff\xc0\x0c\x7f\x1c\x03\xfe`\x07\x000\x05\xfd\xe0\x0c\x7f\x1c\x07\xfeh\x07\x000\x03\xf9\xf0\x0c\x7f\x1c\x0f\xff\xf0\x07\x000\x03\xff\xf8\x0c\x7f\x1c\x1f\xff\xf0\x07\x000\x0b\xff\xfc\x0c\x7f\x1c?\xff\xf0\x07\x000\x03\xff\xde\x0c\x7f\x1c}\xff\xf0\x07\x000\x0b\xff\xdf\x0c\x7f\x1c\xfa\xff\xe8\x07\x000\x03\xff\xc7\x8c\x7f\x1d\xf0\xff\xc0\x07\x000\x05\xff\xa3\xcc\x7f\x1f\xe1\x7f\xd0\x07\x000\x00\xff\x01\xfc\x7f\x1f\xc0\x1f\x00\x07\x000\x00~\x00\xfc\x7f\x1f\x80@@\x07\x000\x00\x81\x00|\x7f\x1f\x00\n\x00\x07\x000\x00(\x00<\x7f\x1e\x00\x00\x00\x07\x000\x00\x00\x00\x1c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x008\x00\x00\x00\x1c\x7f\x0e\x00\x00\x00\x0e\x008\x00\x00\x00\x1c\x7f\x0e\x00\x00\x00\x0e\x00<\x00\x00\x00<\x7f\x0f\x00\x00\x00\x1e\x00\x1c\x00\x00\x008\x7f\x07\x80\x00\x00<\x00\x1e\x00\x00\x00x\x7f\x03\xc0\x00\x00x\x00\x0f\x80\x00\x01\xf0\x7f\x01\xf8\x00\x03\xf0\x00\x07\xe0\x00\x07\xe0\x7f\x00\xff\xff\xff\xe0\x00\x03\xff\xff\xff\xc0\x7f\x00?\xff\xff\x80\x00\x00\xff\xff\xff\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f'
|
||||
Dizzy=b'P4\n89 64\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x1f\xff\xff\x00\x00\x00?\xff\xfc\x00\x7f\x00\x7f\xff\xff\xc0\x00\x01\xff\xff\xff\x80\x7f\x01\xff\xff\xff\xf0\x00\x03\xff\xff\xff\xc0\x7f\x03\xe0\x00\x00\xf8\x00\x07\xc0\x00\x03\xe0\x7f\x07\x80\x00\x00<\x00\x0f\x00\x00\x00\xf0\x7f\x07\x00\x00\x00\x1c\x00\x1e\x00\x00\x00x\x7f\x0e\x00\x00\x00\x0e\x00\x1c\x00\x00\x008\x7f\x0e\x00\x00\x00\x0e\x008\x00\x00\x00\x1c\x7f\x1c\x00\x00\x00\x07\x008\x00\x00\x00\x1c\x7f\x1c\x00\x00\x00\x07\x008\x00\x00\x00\x1c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x000\x00\x07\x000\x00\xc0\x00\x0c\x7f\x1c\x00\xf0\x00\x07\x000\x03\xc0\x00\x0c\x7f\x1c\x01\xc0\x00\x07\x000\x07\x00\x00\x0c\x7f\x1c\x03\x9f\xe0\x07\x000\x0e\x7f\x80\x0c\x7f\x1c\x07<\xf8\x07\x000\x1c\xf3\xe0\x0c\x7f\x1c\x06`\x1c\x07\x000\x19\x80p\x0c\x7f\x1c\x0c\xc7\xcc\x07\x0003\x1f0\x0c\x7f\x1c\x0c\xcf\xe6\x07\x0003?\x98\x0c\x7f\x1c\r\x98v\x07\x0006a\xd8\x0c\x7f\x1c\r\x9b3\x07\x0006l\xcc\x0c\x7f\x1c\r\x9b\xb3\x07\x0006n\xcc\x0c\x7f\x1c\r\x9f\xb3\x07\x0006~\xcc\x0c\x7f\x1c\x0c\xcf6\x07\x0003<\xd8\x0c\x7f\x1c\x0e\xe0f\x07\x000;\x81\x98\x0c\x7f\x1c\x06y\xee\x07\x000\x19\xe7\xb8\x0c\x7f\x1c\x03\x1f\x8c\x07\x000\x0c~0\x0c\x7f\x1c\x03\x80\x18\x07\x000\x0e\x00`\x0c\x7f\x1c\x00\xf0p\x07\x000\x03\xc1\xc0\x0c\x7f\x1c\x00\x7f\xe0\x07\x000\x01\xff\x80\x0c\x7f\x1c\x00\x0f\x00\x07\x000\x00<\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x008\x00\x00\x00\x1c\x7f\x0e\x00\x00\x00\x0e\x008\x00\x00\x00\x1c\x7f\x0e\x00\x00\x00\x0e\x00<\x00\x00\x00<\x7f\x0f\x00\x00\x00\x1e\x00\x1c\x00\x00\x008\x7f\x07\x80\x00\x00<\x00\x1e\x00\x00\x00x\x7f\x03\xc0\x00\x00x\x00\x0f\x80\x00\x01\xf0\x7f\x01\xf8\x00\x03\xf0\x00\x07\xe0\x00\x07\xe0\x7f\x00\xff\xff\xff\xe0\x00\x03\xff\xff\xff\xc0\x7f\x00?\xff\xff\x80\x00\x00\xff\xff\xff\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f'
|
||||
Down=b'P4\n89 64\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x1f\xff\xff\x00\x00\x00?\xff\xfc\x00\x7f\x00\x7f\xff\xff\xc0\x00\x01\xff\xff\xff\x80\x7f\x01\xff\xff\xff\xf0\x00\x03\xff\xff\xff\xc0\x7f\x03\xe0\x00\x00\xf8\x00\x07\xc0\x00\x03\xe0\x7f\x07\x80\x00\x00<\x00\x0f\x00\x00\x00\xf0\x7f\x07\x00\x00\x00\x1c\x00\x1e\x00\x00\x00x\x7f\x0e\x00\x00\x00\x0e\x00\x1c\x00\x00\x008\x7f\x0e\x00\x00\x00\x0e\x008\x00\x00\x00\x1c\x7f\x1c\x00\x00\x00\x07\x008\x00\x00\x00\x1c\x7f\x1c\x00\x00\x00\x07\x008\x00\x00\x00\x1c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\n\x00\x07\x000\x00(\x00\x0c\x7f\x1c\x00@@\x07\x000\x00\x81\x00\x0c\x7f\x1c\x00\x9f\x00\x07\x000\x00~\x00\x0c\x7f\x1c\x00\x7f\xd0\x07\x000\x00\xff\x00\x0c\x7f\x1c\x00\xfe`\x07\x000\x05\xfd\xa0\x0c\x7f\x1c\x02\xfeh\x07\x000\x03\xf9\xc0\x0c\x7f\x1c\x01\xff\xf0\x07\x000\x03\xff\xc0\x0c\x7f\x1c\x01\xff\xf0\x07\x000\x0b\xff\xd0\x0c\x7f\x1c\x01\xff\xf0\x07\x000\x03\xff\xc0\x0c\x7f\x1c\x01\xff\xf0\x07\x000\x0b\xff\xd0\x0c\x7f\x1c\x02\xff\xe8\x07\x000\x03\xff\xc0\x0c\x7f\x1c\x00\x7f\xe0\x07\x008\x05\xff\xa0\x1c\x7f\x0e\x01\x7f\xd0\x0e\x008\x00\xff\x00\x1c\x7f\x0e\x00\x1f\x00\x0e\x00<\x00~\x00<\x7f\x0f\x00@@\x1e\x00\x1c\x00\x81\x008\x7f\x07\x80\x15\x00<\x00\x1e\x00\x14\x00x\x7f\x03\xc0\x00\x00x\x00\x0f\x80\x00\x01\xf0\x7f\x01\xf8\x00\x03\xf0\x00\x07\xe0\x00\x07\xe0\x7f\x00\xff\xff\xff\xe0\x00\x03\xff\xff\xff\xc0\x7f\x00?\xff\xff\x80\x00\x00\xff\xff\xff\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f'
|
||||
Evil=b'P4\n89 64\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x0f\xff\xff\x00\x00\x00?\xff\xfc\x00\x7f\x00\x7f\xff\xff\xc0\x00\x01\xff\xff\xff\x80\x7f\x01\xff\xff\xff\xf0\x00\x03\xff\xff\xff\xc0\x7f\x03\xe0\x00\x00\xf8\x00\x07\xc0\x00\x03\xe0\x7f\x07\xf0\x00\x00<\x00\x0f\x00\x00\x03\xf0\x7f\x07\xf8\x00\x00\x1c\x00\x1e\x00\x00\x07\xf8\x7f\x0e<\x00\x00\x0e\x00\x1c\x00\x00\x0e8\x7f\x0e\x1e\x00\x00\x0e\x008\x00\x00<\x1c\x7f\x1c\x0f\x00\x00\x07\x008\x00\x00x\x1c\x7f\x1c\x07\x80\x00\x07\x008\x00\x00\xf0\x1c\x7f\x1c\x01\xe0\x00\x07\x000\x00\x01\xe0\x0c\x7f\x1c\x00\xf0\x00\x07\x000\x00\x03\xc0\x0c\x7f\x1c\x00x\x00\x07\x000\x00\x07\x80\x0c\x7f\x1c\x00<\x00\x07\x000\x00\x0e\x00\x0c\x7f\x1c\x00\x1e\x00\x07\x000\x00>\x00\x0c\x7f\x1c\x00O\x00\x07\x000\x00|\x80\x0c\x7f\x1c\x00?\x80\x07\x000\x00\xff\x00\x0c\x7f\x1c\x00\x7f\xe0\x07\x000\x01\xfd\xa0\x0c\x7f\x1c\x00\xfe\xf0\x07\x000\x03\xfc\x80\x0c\x7f\x1c\x02\xfe\xf8\x07\x000\x07\xfb\xc0\x0c\x7f\x1c\x01\xff\xfc\x07\x000\x1f\xff\xd0\x0c\x7f\x1c\x01\xff\xfe\x07\x000?\xff\xc0\x0c\x7f\x1c\x01\xff\xff\x07\x000\x7f\xff\xd0\x0c\x7f\x1c\x00\xff\xe3\xc7\x000\xf3\xff\xc0\x0c\x7f\x1c\x02\xff\xe9\xe7\x001\xe1\xff\x80\x0c\x7f\x1c\x00\x7f\xc0\xf7\x003\xc5\xff\xa0\x0c\x7f\x1c\x00?\x80\x7f\x00?\x00\xff\x00\x0c\x7f\x1c\x00\x0e\x00?\x00>\x01<\x80\x0c\x7f\x1c\x00\x10\x80\x1f\x00<\x00B\x00\x0c\x7f\x1c\x00\x00\x00\x07\x008\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x008\x00\x00\x00\x1c\x7f\x0e\x00\x00\x00\x0e\x008\x00\x00\x00\x1c\x7f\x0e\x00\x00\x00\x0e\x00<\x00\x00\x00<\x7f\x0f\x00\x00\x00\x1e\x00\x1c\x00\x00\x008\x7f\x07\x80\x00\x00<\x00\x1e\x00\x00\x00x\x7f\x03\xc0\x00\x00x\x00\x0f\x80\x00\x01\xf0\x7f\x01\xf8\x00\x03\xf0\x00\x07\xe0\x00\x07\xe0\x7f\x00\xff\xff\xff\xe0\x00\x03\xff\xff\xff\xc0\x7f\x00?\xff\xff\x80\x00\x00\xff\xff\xff\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f'
|
||||
Hurt=b'P4\n89 64\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x1f\xff\xff\x00\x00\x00?\xff\xfc\x00\x7f\x00\x7f\xff\xff\xc0\x00\x01\xff\xff\xff\x80\x7f\x01\xff\xff\xff\xf0\x00\x03\xff\xff\xff\xc0\x7f\x03\xe0\x00\x00\xf8\x00\x07\xc0\x00\x03\xe0\x7f\x07\x80\x00\x00<\x00\x0f\x00\x00\x00\xf0\x7f\x07\x00\x00\x00\x1c\x00\x1e\x00\x00\x00x\x7f\x0e\x00\x00\x00\x0e\x00\x1c\x00\x00\x008\x7f\x0e\x00\x00\x00\x0e\x008\x00\x00\x00\x1c\x7f\x1c\x00\x00\x00\x07\x008\x00\x00\x00\x1c\x7f\x1c\x00\x00\x00\x07\x008\x00\x00\x00\x1c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x0f\x008\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00?\x00>\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\xff\x00?\x80\x00\x00\x0c\x7f\x1c\x00\x00\x03\xff\x00?\xe0\x00\x00\x0c\x7f\x1c\x00\x00\x0f\xe7\x001\xf8\x00\x00\x0c\x7f\x1c\x00\x00?\x87\x000~\x00\x00\x0c\x7f\x1c\x00\x00\xfe\x07\x000\x1f\x80\x00\x0c\x7f\x1c\x00\x03\xf8\x07\x000\x07\xe0\x00\x0c\x7f\x1c\x00\x0f\xf0\x07\x000\x03\xf8\x00\x0c\x7f\x1c\x00?\x80\x07\x000\x04\xfe\x00\x0c\x7f\x1c\x00\xff\xe0\x07\x000\x03\xff\x80\x0c\x7f\x1c\x03\xff\xf0\x07\x000\x17\xff\xe0\x0c\x7f\x1c\x0f\xff\x98\x07\x000\x07\xf3\xf8\x0c\x7f\x1c?\xbf\xba\x07\x000\x0f\xef~\x0c\x7f\x1c\xff\x7f\xfc\x07\x000/\xff_\x8c\x7f\x1d\xf8\x7f\xfc\x07\x000\x0f\xff\x07\xec\x7f\x1f\xe0\x7f\xfc\x07\x000/\xffA\xfc\x7f\x1f\x80?\xf8\x07\x000\x0f\xff\x00|\x7f\x1e\x00\xbf\xfa\x07\x008\x07\xfe\x00\x1c\x7f\x0e\x00\x1f\xf0\x0e\x008\x17\xfe\x80\x1c\x7f\x0e\x00\x0f\xe0\x0e\x00<\x03\xfc\x00<\x7f\x0f\x00\x03\x80\x1e\x00\x1c\x04\xf2\x008\x7f\x07\x80\x04 <\x00\x1e\x01\x08\x00x\x7f\x03\xc0\x00\x00x\x00\x0f\x80\x00\x01\xf0\x7f\x01\xf8\x00\x03\xf0\x00\x07\xe0\x00\x07\xe0\x7f\x00\xff\xff\xff\xe0\x00\x03\xff\xff\xff\xc0\x7f\x00?\xff\xff\x80\x00\x00\xff\xff\xff\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f'
|
||||
Knocked_out=b'P4\n89 64\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x1f\xff\xff\x00\x00\x00?\xff\xfc\x00\x7f\x00\x7f\xff\xff\xc0\x00\x01\xff\xff\xff\x80\x7f\x01\xff\xff\xff\xf0\x00\x03\xff\xff\xff\xc0\x7f\x03\xe0\x00\x00\xf8\x00\x07\xc0\x00\x03\xe0\x7f\x07\x80\x00\x00<\x00\x0f\x00\x00\x00\xf0\x7f\x07\x00\x00\x00\x1c\x00\x1e\x00\x00\x00x\x7f\x0e\x00\x00\x00\x0e\x00\x1c\x00\x00\x008\x7f\x0e\x00\x00\x00\x0e\x008\x00\x00\x00\x1c\x7f\x1c\x00\x00\x00\x07\x008\x00\x00\x00\x1c\x7f\x1c\x00\x00\x00\x07\x008\x00\x00\x00\x1c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x0e\x00\x07\x000\x00\x18\x00\x0c\x7f\x1c\x00\x0e\x00\x07\x000\x00\x18\x00\x0c\x7f\x1c\x00\x0e\x00\x07\x000\x00\x18\x00\x0c\x7f\x1c\x00\x0e\x00\x07\x000\x00\x18\x00\x0c\x7f\x1c\x00\x0e\x00\x07\x000\x00\x18\x00\x0c\x7f\x1c\x00\x0e\x00\x07\x000\x00\x18\x00\x0c\x7f\x1c\x00\x0e\x00\x07\x000\x00\x18\x00\x0c\x7f\x1c\x00\x0e\x00\x07\x000\x00\x18\x00\x0c\x7f\x1c\x0f\xff\xfe\x07\x000\x1f\xff\xf8\x0c\x7f\x1c\x0f\xff\xfe\x07\x000?\xff\xfc\x0c\x7f\x1c\x0f\xff\xfe\x07\x000?\xff\xf8\x0c\x7f\x1c\x00\x0e\x00\x07\x000\x00\x18\x00\x0c\x7f\x1c\x00\x0e\x00\x07\x000\x00\x18\x00\x0c\x7f\x1c\x00\x0e\x00\x07\x000\x00\x18\x00\x0c\x7f\x1c\x00\x0e\x00\x07\x000\x00\x18\x00\x0c\x7f\x1c\x00\x0e\x00\x07\x000\x00\x18\x00\x0c\x7f\x1c\x00\x0e\x00\x07\x000\x00\x18\x00\x0c\x7f\x1c\x00\x0e\x00\x07\x000\x00\x18\x00\x0c\x7f\x1c\x00\x0e\x00\x07\x000\x00\x18\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x008\x00\x00\x00\x1c\x7f\x0e\x00\x00\x00\x0e\x008\x00\x00\x00\x1c\x7f\x0e\x00\x00\x00\x0e\x00<\x00\x00\x00<\x7f\x0f\x00\x00\x00\x1e\x00\x1c\x00\x00\x008\x7f\x07\x80\x00\x00<\x00\x1e\x00\x00\x00x\x7f\x03\xc0\x00\x00x\x00\x0f\x80\x00\x01\xf0\x7f\x01\xf8\x00\x03\xf0\x00\x07\xe0\x00\x07\xe0\x7f\x00\xff\xff\xff\xe0\x00\x03\xff\xff\xff\xc0\x7f\x00?\xff\xff\x80\x00\x00\xff\xff\xff\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f'
|
||||
Love=b'P4\n89 64\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x1f\xff\xff\x00\x00\x00?\xff\xfc\x00\x7f\x00\x7f\xff\xff\xc0\x00\x01\xff\xff\xff\x80\x7f\x01\xff\xff\xff\xf0\x00\x03\xff\xff\xff\xc0\x7f\x03\xe0\x00\x00\xf8\x00\x07\xc0\x00\x03\xe0\x7f\x07\x80\x00\x00<\x00\x0f\x00\x00\x00\xf0\x7f\x07\x00\x00\x00\x1c\x00\x1e\x00\x00\x00x\x7f\x0e\x00\x00\x00\x0e\x00\x1c\x00\x00\x008\x7f\x0e\x00\x00\x00\x0e\x008\x00\x00\x00\x1c\x7f\x1c\x00\x00\x00\x07\x008\x00\x00\x00\x1c\x7f\x1c\x00\x00\x00\x07\x008\x00\x00\x00\x1c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x07\xe0\xfc\x07\x000\x0f\x81\xf0\x0c\x7f\x1c\x0f\xd1\xfa\x07\x000\x1fC\xf8\x0c\x7f\x1c\x1f\xeb\xfd\x07\x000?\xa7\xf4\x0c\x7f\x1c\x1f\xff\xfd\x07\x000\x7f\xff\xfa\x0c\x7f\x1c?\xff\xfe\x07\x000\x7f\xff\xfa\x0c\x7f\x1c?\xff\xff\x87\x000\x7f\xff\xfe\x0c\x7f\x1c?\xff\xff\x87\x000\x7f\xff\xfe\x0c\x7f\x1c?\xff\xff\x87\x000\x7f\xff\xfe\x0c\x7f\x1c\x1f\xff\xff\x07\x000\x7f\xff\xfe\x0c\x7f\x1c\x1f\xff\xff\x07\x000\x7f\xff\xfe\x0c\x7f\x1c\x1f\xff\xff\x07\x000?\xff\xfc\x0c\x7f\x1c\x0f\xff\xfe\x07\x000\x1f\xff\xf8\x0c\x7f\x1c\x03\xff\xf8\x07\x000\x0f\xff\xf0\x0c\x7f\x1c\x01\xff\xf0\x07\x000\x07\xff\xe0\x0c\x7f\x1c\x00\xff\xe0\x07\x000\x03\xff\xc0\x0c\x7f\x1c\x00\x7f\xc0\x07\x000\x01\xff\x80\x0c\x7f\x1c\x00?\x80\x07\x000\x00~\x00\x0c\x7f\x1c\x00\x1f\x00\x07\x000\x00<\x00\x0c\x7f\x1c\x00\x0e\x00\x07\x000\x00\x18\x00\x0c\x7f\x1c\x00\x04\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x008\x00\x00\x00\x1c\x7f\x0e\x00\x00\x00\x0e\x008\x00\x00\x00\x1c\x7f\x0e\x00\x00\x00\x0e\x00<\x00\x00\x00<\x7f\x0f\x00\x00\x00\x1e\x00\x1c\x00\x00\x008\x7f\x07\x80\x00\x00<\x00\x1e\x00\x00\x00x\x7f\x03\xc0\x00\x00x\x00\x0f\x80\x00\x01\xf0\x7f\x01\xf8\x00\x03\xf0\x00\x07\xe0\x00\x07\xe0\x7f\x00\xff\xff\xff\xe0\x00\x03\xff\xff\xff\xc0\x7f\x00?\xff\xff\x80\x00\x00\xff\xff\xff\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f'
|
||||
Middle_left=b'P4\n89 64\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x1f\xff\xff\x00\x00\x00?\xff\xfc\x00\x7f\x00\x7f\xff\xff\xc0\x00\x01\xff\xff\xff\x80\x7f\x01\xff\xff\xff\xf0\x00\x03\xff\xff\xff\xc0\x7f\x03\xe0\x00\x00\xf8\x00\x07\xc0\x00\x03\xe0\x7f\x07\x80\x00\x00<\x00\x0f\x00\x00\x00\xf0\x7f\x07\x00\x00\x00\x1c\x00\x1e\x00\x00\x00x\x7f\x0e\x00\x00\x00\x0e\x00\x1c\x00\x00\x008\x7f\x0e\x00\x00\x00\x0e\x008\x00\x00\x00\x1c\x7f\x1c\x00\x00\x00\x07\x008\x00\x00\x00\x1c\x7f\x1c\x00\x00\x00\x07\x008\x00\x00\x00\x1c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x08@\x00\x07\x000 \x80\x00\x0c\x7f\x1c\x03\x80\x00\x07\x000\x07 \x00\x0c\x7f\x1c\x0f\xe0\x00\x07\x000?\x80\x00\x0c\x7f\x1c\x1f\xf0\x00\x07\x001\x7f\xe8\x00\x0c\x7f\x1c?\x98\x00\x07\x000\x7f \x00\x0c\x7f\x1c\xbf\xba\x00\x07\x002\xfe\xf0\x00\x0c\x7f\x1c\x7f\xfc\x00\x07\x000\xff\xf4\x00\x0c\x7f\x1c\x7f\xfc\x00\x07\x002\xff\xf0\x00\x0c\x7f\x1c\x7f\xfc\x00\x07\x000\xff\xf4\x00\x0c\x7f\x1c?\xf8\x00\x07\x002\xff\xf0\x00\x0c\x7f\x1c\xbf\xfa\x00\x07\x000\x7f\xe0\x00\x0c\x7f\x1c\x1f\xf0\x00\x07\x001\x7f\xe8\x00\x0c\x7f\x1c\x0f\xe0\x00\x07\x000?\xc0\x00\x0c\x7f\x1c\x03\x80\x00\x07\x000O \x00\x0c\x7f\x1c\x08@\x00\x07\x000\x10\x80\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x008\x00\x00\x00\x1c\x7f\x0e\x00\x00\x00\x0e\x008\x00\x00\x00\x1c\x7f\x0e\x00\x00\x00\x0e\x00<\x00\x00\x00<\x7f\x0f\x00\x00\x00\x1e\x00\x1c\x00\x00\x008\x7f\x07\x80\x00\x00<\x00\x1e\x00\x00\x00x\x7f\x03\xc0\x00\x00x\x00\x0f\x80\x00\x01\xf0\x7f\x01\xf8\x00\x03\xf0\x00\x07\xe0\x00\x07\xe0\x7f\x00\xff\xff\xff\xe0\x00\x03\xff\xff\xff\xc0\x7f\x00?\xff\xff\x80\x00\x00\xff\xff\xff\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f'
|
||||
Middle_right=b'P4\n89 64\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x1f\xff\xff\x00\x00\x00?\xff\xfc\x00\x7f\x00\x7f\xff\xff\xc0\x00\x01\xff\xff\xff\x80\x7f\x01\xff\xff\xff\xf0\x00\x03\xff\xff\xff\xc0\x7f\x03\xe0\x00\x00\xf8\x00\x07\xc0\x00\x03\xe0\x7f\x07\x80\x00\x00<\x00\x0f\x00\x00\x00\xf0\x7f\x07\x00\x00\x00\x1c\x00\x1e\x00\x00\x00x\x7f\x0e\x00\x00\x00\x0e\x00\x1c\x00\x00\x008\x7f\x0e\x00\x00\x00\x0e\x008\x00\x00\x00\x1c\x7f\x1c\x00\x00\x00\x07\x008\x00\x00\x00\x1c\x7f\x1c\x00\x00\x00\x07\x008\x00\x00\x00\x1c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x84\x07\x000\x00\x02\x08\x0c\x7f\x1c\x00\x008\x07\x000\x00\x00r\x0c\x7f\x1c\x00\x00\xfe\x07\x000\x00\x03\xf8\x0c\x7f\x1c\x00\x01\xff\x07\x000\x00\x17\xfe\x8c\x7f\x1c\x00\x03\xf9\x87\x000\x00\x07\xf2\x0c\x7f\x1c\x00\x0b\xfb\xa7\x000\x00\x0f\xef\x0c\x7f\x1c\x00\x07\xff\xc7\x000\x00/\xffL\x7f\x1c\x00\x07\xff\xc7\x000\x00\x0f\xffL\x7f\x1c\x00\x07\xff\xc7\x000\x00/\xff\x0c\x7f\x1c\x00\x03\xff\x87\x000\x00\x0f\xffL\x7f\x1c\x00\x0b\xff\xa7\x000\x00\x07\xfe\x0c\x7f\x1c\x00\x01\xff\x07\x000\x00\x17\xfe\x8c\x7f\x1c\x00\x00\xfe\x07\x000\x00\x03\xfc\x0c\x7f\x1c\x00\x008\x07\x000\x00\x04\xf2\x0c\x7f\x1c\x00\x00\x84\x07\x000\x00\x01\x08\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x008\x00\x00\x00\x1c\x7f\x0e\x00\x00\x00\x0e\x008\x00\x00\x00\x1c\x7f\x0e\x00\x00\x00\x0e\x00<\x00\x00\x00<\x7f\x0f\x00\x00\x00\x1e\x00\x1c\x00\x00\x008\x7f\x07\x80\x00\x00<\x00\x1e\x00\x00\x00x\x7f\x03\xc0\x00\x00x\x00\x0f\x80\x00\x01\xf0\x7f\x01\xf8\x00\x03\xf0\x00\x07\xe0\x00\x07\xe0\x7f\x00\xff\xff\xff\xe0\x00\x03\xff\xff\xff\xc0\x7f\x00?\xff\xff\x80\x00\x00\xff\xff\xff\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f'
|
||||
Neutral=b'P4\n89 64\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x1f\xff\xff\x00\x00\x00?\xff\xfc\x00\x7f\x00\x7f\xff\xff\xc0\x00\x01\xff\xff\xff\x80\x7f\x01\xff\xff\xff\xf0\x00\x03\xff\xff\xff\xc0\x7f\x03\xe0\x00\x00\xf8\x00\x07\xc0\x00\x03\xe0\x7f\x07\x80\x00\x00<\x00\x0f\x00\x00\x00\xf0\x7f\x07\x00\x00\x00\x1c\x00\x1e\x00\x00\x00x\x7f\x0e\x00\x00\x00\x0e\x00\x1c\x00\x00\x008\x7f\x0e\x00\x00\x00\x0e\x008\x00\x00\x00\x1c\x7f\x1c\x00\x00\x00\x07\x008\x00\x00\x00\x1c\x7f\x1c\x00\x00\x00\x07\x008\x00\x00\x00\x1c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00!\x00\x07\x000\x00\x82\x00\x0c\x7f\x1c\x00\x0e\x00\x07\x000\x00\x1c\x80\x0c\x7f\x1c\x00?\x80\x07\x000\x00\xfe\x00\x0c\x7f\x1c\x00\x7f\xc0\x07\x000\x05\xff\xa0\x0c\x7f\x1c\x00\xfe`\x07\x000\x01\xfc\x80\x0c\x7f\x1c\x02\xfe\xe8\x07\x000\x03\xfb\xc0\x0c\x7f\x1c\x01\xff\xf0\x07\x000\x0b\xff\xd0\x0c\x7f\x1c\x01\xff\xf0\x07\x000\x03\xff\xc0\x0c\x7f\x1c\x01\xff\xf0\x07\x000\x0b\xff\xd0\x0c\x7f\x1c\x00\xff\xe0\x07\x000\x03\xff\xc0\x0c\x7f\x1c\x02\xff\xe8\x07\x000\x01\xff\x80\x0c\x7f\x1c\x00\x7f\xc0\x07\x000\x05\xff\xa0\x0c\x7f\x1c\x00?\x80\x07\x000\x00\xff\x00\x0c\x7f\x1c\x00\x0e\x00\x07\x000\x01<\x80\x0c\x7f\x1c\x00!\x00\x07\x000\x00B\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x008\x00\x00\x00\x1c\x7f\x0e\x00\x00\x00\x0e\x008\x00\x00\x00\x1c\x7f\x0e\x00\x00\x00\x0e\x00<\x00\x00\x00<\x7f\x0f\x00\x00\x00\x1e\x00\x1c\x00\x00\x008\x7f\x07\x80\x00\x00<\x00\x1e\x00\x00\x00x\x7f\x03\xc0\x00\x00x\x00\x0f\x80\x00\x01\xf0\x7f\x01\xf8\x00\x03\xf0\x00\x07\xe0\x00\x07\xe0\x7f\x00\xff\xff\xff\xe0\x00\x03\xff\xff\xff\xc0\x7f\x00?\xff\xff\x80\x00\x00\xff\xff\xff\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f'
|
||||
Nuclear=b"P4\n89 64\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x1f\xff\xff\x00\x00\x00?\xff\xfc\x00\x7f\x00\x7f\xff\xff\xc0\x00\x01\xff\xff\xff\x80\x7f\x01\xff\xff\xff\xf0\x00\x03\xff\xff\xff\xc0\x7f\x03\xe0\x00\x00\xf8\x00\x07\xc0\x00\x03\xe0\x7f\x07\x80\x00\x00<\x00\x0f\x00\x00\x00\xf0\x7f\x07\x00\x00\x00\x1c\x00\x1e\x00\x00\x00x\x7f\x0e\x00\x00\x00\x0e\x00\x1c\x00\x00\x008\x7f\x0e\x00\x00\x00\x0e\x008\x00\x00\x00\x1c\x7f\x1c\x00\x00\x00\x07\x008\x00\x00\x00\x1c\x7f\x1c\x00\x00\x00\x07\x008\x00\x00\x00\x1c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x1e\x00\x07\x000\x00<\x00\x0c\x7f\x1c\x00\xf3\xc0\x07\x000\x01\xe7\x80\x0c\x7f\x1c\x03\x800\x07\x000\x07\x00`\x0c\x7f\x1c\x06\x00\x08\x07\x000\x0c\x00\x10\x0c\x7f\x1c\r\x80$\x07\x000\x1b\x00H\x0c\x7f\x1c\x1b\x80r\x07\x0007\x00\xe4\x0c\x7f\x1c\x13\xc0\xfb\x07\x000'\x81\xf6\x0c\x7f\x1c7\xe0\xfd\x07\x000o\xc1\xfa\x0c\x7f\x1c/\xe1\xfd\x87\x000_\xc3\xfb\x0c\x7f\x1c/\xe1\xfc\x87\x000_\xc3\xf9\x0c\x7f\x1co\xe4\xfe\x87\x000\xdf\xc9\xfd\x0c\x7f\x1cO\xce\xfe\x87\x000\x9f\x9d\xfd\x0c\x7f\x1c@\x1e\x00\x87\x000\x80<\x01\x0c\x7f\x1c@\x0c\x00\x87\x000\x80\x18\x01\x0c\x7f\x1c \x00\x00\x87\x000@\x00\x01\x0c\x7f\x1c \x0e\x00\x87\x000@\x1c\x01\x0c\x7f\x1c \x1f\x01\x87\x000@>\x03\x0c\x7f\x1c\x10?\x01\x07\x000 ~\x02\x0c\x7f\x1c\x18?\x82\x07\x0000\x7f\x04\x0c\x7f\x1c\x08\x7f\x86\x07\x000\x10\xff\x0c\x0c\x7f\x1c\x04\x7f\xcc\x07\x000\x08\xff\x98\x0c\x7f\x1c\x03\x1e\x18\x07\x000\x06<0\x0c\x7f\x1c\x01\xc0`\x07\x000\x03\x80\xc0\x0c\x7f\x1c\x00\x7f\x80\x07\x000\x00\xff\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x008\x00\x00\x00\x1c\x7f\x0e\x00\x00\x00\x0e\x008\x00\x00\x00\x1c\x7f\x0e\x00\x00\x00\x0e\x00<\x00\x00\x00<\x7f\x0f\x00\x00\x00\x1e\x00\x1c\x00\x00\x008\x7f\x07\x80\x00\x00<\x00\x1e\x00\x00\x00x\x7f\x03\xc0\x00\x00x\x00\x0f\x80\x00\x01\xf0\x7f\x01\xf8\x00\x03\xf0\x00\x07\xe0\x00\x07\xe0\x7f\x00\xff\xff\xff\xe0\x00\x03\xff\xff\xff\xc0\x7f\x00?\xff\xff\x80\x00\x00\xff\xff\xff\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f"
|
||||
Pinch_left=b'P4\n89 64\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x1f\xff\xff\x00\x00\x00?\xff\xfc\x00\x7f\x00\x7f\xff\xff\xc0\x00\x01\xff\xff\xff\x80\x7f\x01\xff\xff\xff\xf0\x00\x03\xff\xff\xff\xc0\x7f\x03\xe0\x00\x00\xf8\x00\x07\xc0\x00\x03\xe0\x7f\x07\x80\x00\x00<\x00\x0f\x00\x00\x00\xf0\x7f\x07\x00\x00\x00\x1c\x00\x1e\x00\x00\x00x\x7f\x0e\x00\x00\x00\x0e\x00\x1c\x00\x00\x008\x7f\x0e\x00\x00\x00\x0e\x008\x00\x00\x00\x1c\x7f\x1c\x00\x00\x00\x07\x008\x00\x00\x00\x1c\x7f\x1c\x00\x00\x00\x07\x008\x00\x00\x00\x1c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x008\x00\x00\x00\x0c\x7f\x1f\xff\xff\xff\xff\x00?\xff\xff\xff\xfc\x7f\x1f\xff\xff\xff\xff\x00?\xff\xff\xff\xfc\x7f\x1d\x7f\xbd\x00\x07\x00:\xfe\xfc\x00\x1c\x7f\x1c\x7f\xfc\x00\x07\x002\xff\xf0\x00\x0c\x7f\x1c\x7f\xfc\x00\x07\x000\xff\xf4\x00\x0c\x7f\x1c?\xf8\x00\x07\x002\xff\xf0\x00\x0c\x7f\x1c\xbf\xfa\x00\x07\x000\x7f\xe0\x00\x0c\x7f\x1c\x1f\xf0\x00\x07\x000\x7f\xe8\x00\x0c\x7f\x1c\x0f\xe0\x00\x07\x000\xbf\xd0\x00\x0c\x7f\x1c\x03\x80\x00\x07\x000\x0f\x00\x00\x0c\x7f\x1c\x18`\x00\x07\x0000\xc0\x00\x1c\x7f\x1f\xff\xff\xff\xff\x00?\xff\xff\xff\xfc\x7f\x1f\xff\xff\xff\xff\x00?\xff\xff\xff\xfc\x7f\x1c\x00\x00\x00\x07\x008\x00\x00\x00\x1c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x008\x00\x00\x00\x1c\x7f\x0e\x00\x00\x00\x0e\x008\x00\x00\x00\x1c\x7f\x0e\x00\x00\x00\x0e\x00<\x00\x00\x00<\x7f\x0f\x00\x00\x00\x1e\x00\x1c\x00\x00\x008\x7f\x07\x80\x00\x00<\x00\x1e\x00\x00\x00x\x7f\x03\xc0\x00\x00x\x00\x0f\x80\x00\x01\xf0\x7f\x01\xf8\x00\x03\xf0\x00\x07\xe0\x00\x07\xe0\x7f\x00\xff\xff\xff\xe0\x00\x03\xff\xff\xff\xc0\x7f\x00?\xff\xff\x80\x00\x00\xff\xff\xff\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f'
|
||||
Pinch_middle=b'P4\n89 64\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x1f\xff\xff\x00\x00\x00?\xff\xfc\x00\x7f\x00\x7f\xff\xff\xc0\x00\x01\xff\xff\xff\x80\x7f\x01\xff\xff\xff\xf0\x00\x03\xff\xff\xff\xc0\x7f\x03\xe0\x00\x00\xf8\x00\x07\xc0\x00\x03\xe0\x7f\x07\x80\x00\x00<\x00\x0f\x00\x00\x00\xf0\x7f\x07\x00\x00\x00\x1c\x00\x1e\x00\x00\x00x\x7f\x0e\x00\x00\x00\x0e\x00\x1c\x00\x00\x008\x7f\x0e\x00\x00\x00\x0e\x008\x00\x00\x00\x1c\x7f\x1c\x00\x00\x00\x07\x008\x00\x00\x00\x1c\x7f\x1c\x00\x00\x00\x07\x008\x00\x00\x00\x1c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x008\x00\x00\x00\x0c\x7f\x1f\xff\xff\xff\xff\x00?\xff\xff\xff\xfc\x7f\x1f\xff\xff\xff\xff\x00?\xff\xff\xff\xfc\x7f\x1c\x05\xfe\xf4\x07\x008\x0b\xfb\xf0\x1c\x7f\x1c\x01\xff\xf0\x07\x000\x03\xff\xc0\x0c\x7f\x1c\x01\xff\xf0\x07\x000\x0b\xff\xd0\x0c\x7f\x1c\x00\xff\xe0\x07\x000\x03\xff\xc0\x0c\x7f\x1c\x02\xff\xe8\x07\x000\x01\xff\x80\x0c\x7f\x1c\x00\x7f\xc0\x07\x000\x01\xff\xa0\x0c\x7f\x1c\x00?\x80\x07\x000\x02\xff@\x0c\x7f\x1c\x00\x0e\x00\x07\x000\x00<\x00\x0c\x7f\x1c\x00a\x80\x07\x000\x00\xc3\x00\x1c\x7f\x1f\xff\xff\xff\xff\x00?\xff\xff\xff\xfc\x7f\x1f\xff\xff\xff\xff\x00?\xff\xff\xff\xfc\x7f\x1c\x00\x00\x00\x07\x008\x00\x00\x00\x1c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x008\x00\x00\x00\x1c\x7f\x0e\x00\x00\x00\x0e\x008\x00\x00\x00\x1c\x7f\x0e\x00\x00\x00\x0e\x00<\x00\x00\x00<\x7f\x0f\x00\x00\x00\x1e\x00\x1c\x00\x00\x008\x7f\x07\x80\x00\x00<\x00\x1e\x00\x00\x00x\x7f\x03\xc0\x00\x00x\x00\x0f\x80\x00\x01\xf0\x7f\x01\xf8\x00\x03\xf0\x00\x07\xe0\x00\x07\xe0\x7f\x00\xff\xff\xff\xe0\x00\x03\xff\xff\xff\xc0\x7f\x00?\xff\xff\x80\x00\x00\xff\xff\xff\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f'
|
||||
Pinch_right=b'P4\n89 64\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x1f\xff\xff\x00\x00\x00?\xff\xfc\x00\x7f\x00\x7f\xff\xff\xc0\x00\x01\xff\xff\xff\x80\x7f\x01\xff\xff\xff\xf0\x00\x03\xff\xff\xff\xc0\x7f\x03\xe0\x00\x00\xf8\x00\x07\xc0\x00\x03\xe0\x7f\x07\x80\x00\x00<\x00\x0f\x00\x00\x00\xf0\x7f\x07\x00\x00\x00\x1c\x00\x1e\x00\x00\x00x\x7f\x0e\x00\x00\x00\x0e\x00\x1c\x00\x00\x008\x7f\x0e\x00\x00\x00\x0e\x008\x00\x00\x00\x1c\x7f\x1c\x00\x00\x00\x07\x008\x00\x00\x00\x1c\x7f\x1c\x00\x00\x00\x07\x008\x00\x00\x00\x1c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x008\x00\x00\x00\x0c\x7f\x1f\xff\xff\xff\xff\x00?\xff\xff\xff\xfc\x7f\x1f\xff\xff\xff\xff\x00?\xff\xff\xff\xfc\x7f\x1c\x00\x17\xfb\xd7\x008\x00/\xef\\\x7f\x1c\x00\x07\xff\xc7\x000\x00\x0f\xffL\x7f\x1c\x00\x07\xff\xc7\x000\x00/\xff\x0c\x7f\x1c\x00\x03\xff\x87\x000\x00\x0f\xffL\x7f\x1c\x00\x0b\xff\xa7\x000\x00\x07\xfe\x0c\x7f\x1c\x00\x01\xff\x07\x000\x00\x07\xfe\x8c\x7f\x1c\x00\x00\xfe\x07\x000\x00\x0b\xfd\x0c\x7f\x1c\x00\x008\x07\x000\x00\x00\xf0\x0c\x7f\x1c\x00\x01C\x07\x000\x00\x03\x0c\x1c\x7f\x1f\xff\xff\xff\xff\x00?\xff\xff\xff\xfc\x7f\x1f\xff\xff\xff\xff\x00?\xff\xff\xff\xfc\x7f\x1c\x00\x00\x00\x07\x008\x00\x00\x00\x1c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x008\x00\x00\x00\x1c\x7f\x0e\x00\x00\x00\x0e\x008\x00\x00\x00\x1c\x7f\x0e\x00\x00\x00\x0e\x00<\x00\x00\x00<\x7f\x0f\x00\x00\x00\x1e\x00\x1c\x00\x00\x008\x7f\x07\x80\x00\x00<\x00\x1e\x00\x00\x00x\x7f\x03\xc0\x00\x00x\x00\x0f\x80\x00\x01\xf0\x7f\x01\xf8\x00\x03\xf0\x00\x07\xe0\x00\x07\xe0\x7f\x00\xff\xff\xff\xe0\x00\x03\xff\xff\xff\xc0\x7f\x00?\xff\xff\x80\x00\x00\xff\xff\xff\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f'
|
||||
Tear=b'P4\n89 64\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x1f\xff\xff\x00\x00\x00?\xff\xfc\x00\x7f\x00\x7f\xff\xff\xc0\x00\x01\xff\xff\xff\x80\x7f\x01\xff\xff\xff\xf0\x00\x03\xff\xff\xff\xc0\x7f\x03\xe0\x00\x00\xf8\x00\x07\xc0\x00\x03\xe0\x7f\x07\x80\x00\x00<\x00\x0f\x00\x00\x00\xf0\x7f\x07\x00\x00\x00\x1c\x00\x1e\x00\x00\x00x\x7f\x0e\x00\x00\x00\x0e\x00\x1c\x00\x00\x008\x7f\x0e\x00\x00\x00\x0e\x008\x00\x00\x00\x1c\x7f\x1e\x00\x00\x00\x0f\x008\x00\x00\x00\x1c\x7f\x1f\xff\xff\xff\xff\x00?\xff\xff\xff\xfc\x7f\x1f\xff\xff\xff\xff\x00?\xff\xff\xff\xfc\x7f\x1c\x00\xbf\xa0\x07\x008\x02\xfe@\x1c\x7f\x1c\x00\x7f\xc0\x07\x000\x00\xff\x00\x0c\x7f\x1c\x00\xfe`\x07\x000\x05\xfd\xa0\x0c\x7f\x1c\x02\xfeh\x07\x000\x03\xf9\xc0\x0c\x7f\x1c\x01\xff\xf0\x07\x000\x0b\xff\xd0\x0c\x7f\x1c\x01\xff\xf0\x07\x000\x03\xff\xc0\x0c\x7f\x1c\x01\xff\xf0\x07\x000\x0b\xff\xd0\x0c\x7f\x1c\x00\xff\xe0\x07\x000\x03\xff\xc0\x0c\x7f\x1f\xff\xff\xff\xff\x00?\xff\xff\xff\xfc\x7f\x1f\xff\xff\xff\xff\x00?\xff\xff\xff\xfc\x7f\x1f\xff\xff\xff\xff\x00?\xff\xff\xff\xfc\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00 \x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00 \x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00 \x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x000\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00p\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00p\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\xf8\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x01\xfc\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x01\xf6\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x03\xfa\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x03\xfe\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x03\xfe\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x01\xfe\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\xfc\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00p\x0c\x7f\x1c\x00\x00\x00\x07\x008\x00\x00\x00\x1c\x7f\x0e\x00\x00\x00\x0e\x008\x00\x00\x00\x1c\x7f\x0e\x00\x00\x00\x0e\x00<\x00\x00\x00<\x7f\x0f\x00\x00\x00\x1e\x00\x1c\x00\x00\x008\x7f\x07\x80\x00\x00<\x00\x1e\x00\x00\x00x\x7f\x03\xc0\x00\x00x\x00\x0f\x80\x00\x01\xf0\x7f\x01\xf8\x00\x03\xf0\x00\x07\xe0\x00\x07\xe0\x7f\x00\xff\xff\xff\xe0\x00\x03\xff\xff\xff\xc0\x7f\x00?\xff\xff\x80\x00\x00\xff\xff\xff\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f'
|
||||
Tired_left=b'P4\n89 64\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x1f\xff\xff\x00\x00\x00?\xff\xfc\x00\x7f\x00\x7f\xff\xff\xc0\x00\x01\xff\xff\xff\x80\x7f\x01\xff\xff\xff\xf0\x00\x03\xff\xff\xff\xc0\x7f\x03\xe0\x00\x00\xf8\x00\x07\xc0\x00\x03\xe0\x7f\x07\x80\x00\x00<\x00\x0f\x00\x00\x00\xf0\x7f\x07\x00\x00\x00\x1c\x00\x1e\x00\x00\x00x\x7f\x0e\x00\x00\x00\x0e\x00\x1c\x00\x00\x008\x7f\x0e\x00\x00\x00\x0e\x008\x00\x00\x00\x1c\x7f\x1c\x00\x00\x00\x07\x008\x00\x00\x00\x1c\x7f\x1c\x00\x00\x00\x07\x008\x00\x00\x00\x1c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x1c\x7f\x1f\xff\xff\xff\xff\x00?\xff\xff\xff\xfc\x7f\x1f\xff\xff\xff\xff\x00?\xff\xff\xff\xfc\x7f\x1c\xbf\xba\x00\x07\x00:\xfet\x00\x1c\x7f\x1c\x7f\xf8\x00\x07\x000\xff\xf0\x00\x0c\x7f\x1c\x7f\xfc\x00\x07\x002\xff\xf4\x00\x0c\x7f\x1c\x7f\xfc\x00\x07\x000\xff\xf0\x00\x0c\x7f\x1c\x7f\xfc\x00\x07\x002\xff\xf4\x00\x0c\x7f\x1c\xbf\xfa\x00\x07\x000\xff\xf0\x00\x0c\x7f\x1c\x1f\xf8\x00\x07\x009\x7f\xe8\x00\x1c\x7f\x0e_\xf4\x00\x0e\x008?\xc0\x00\x1c\x7f\x0e\x07\xc0\x00\x0e\x00<\x1f\x80\x00<\x7f\x0f\x10\x10\x00\x1e\x00\x1c @\x008\x7f\x07\x85@\x00<\x00\x1e\x05\x00\x00x\x7f\x03\xc0\x00\x00x\x00\x0f\x80\x00\x01\xf0\x7f\x01\xf8\x00\x03\xf0\x00\x07\xe0\x00\x07\xe0\x7f\x00\xff\xff\xff\xe0\x00\x03\xff\xff\xff\xc0\x7f\x00?\xff\xff\x80\x00\x00\xff\xff\xff\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f'
|
||||
Tired_middle=b'P4\n89 64\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x1f\xff\xff\x00\x00\x00?\xff\xfc\x00\x7f\x00\x7f\xff\xff\xc0\x00\x01\xff\xff\xff\x80\x7f\x01\xff\xff\xff\xf0\x00\x03\xff\xff\xff\xc0\x7f\x03\xe0\x00\x00\xf8\x00\x07\xc0\x00\x03\xe0\x7f\x07\x80\x00\x00<\x00\x0f\x00\x00\x00\xf0\x7f\x07\x00\x00\x00\x1c\x00\x1e\x00\x00\x00x\x7f\x0e\x00\x00\x00\x0e\x00\x1c\x00\x00\x008\x7f\x0e\x00\x00\x00\x0e\x008\x00\x00\x00\x1c\x7f\x1c\x00\x00\x00\x07\x008\x00\x00\x00\x1c\x7f\x1c\x00\x00\x00\x07\x008\x00\x00\x00\x1c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x1c\x7f\x1f\xff\xff\xff\xff\x00?\xff\xff\xff\xfc\x7f\x1f\xff\xff\xff\xff\x00?\xff\xff\xff\xfc\x7f\x1c\x02\xff\xe8\x07\x008\x0b\xfb\xd0\x1c\x7f\x1c\x01\xff\xf0\x07\x000\x03\xff\xd0\x0c\x7f\x1c\x01\xff\xf0\x07\x000\x0b\xff\xc0\x0c\x7f\x1c\x01\xff\xf0\x07\x000\x0b\xff\xd0\x0c\x7f\x1c\x00\xff\xe0\x07\x000\x03\xff\xc0\x0c\x7f\x1c\x02\xff\xe8\x07\x000\x01\xff\x80\x0c\x7f\x1c\x00\x7f\xc0\x07\x008\x05\xff\xa0\x1c\x7f\x0e\x00?\x80\x0e\x008\x00\xff\x00\x1c\x7f\x0e\x00\x0e\x00\x0e\x00<\x01<\x80<\x7f\x0f\x00!\x00\x1e\x00\x1c\x00B\x008\x7f\x07\x80\x00\x00<\x00\x1e\x00\x00\x00x\x7f\x03\xc0\x00\x00x\x00\x0f\x80\x00\x01\xf0\x7f\x01\xf8\x00\x03\xf0\x00\x07\xe0\x00\x07\xe0\x7f\x00\xff\xff\xff\xe0\x00\x03\xff\xff\xff\xc0\x7f\x00?\xff\xff\x80\x00\x00\xff\xff\xff\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f'
|
||||
Tired_right=b'P4\n89 64\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x1f\xff\xff\x00\x00\x00?\xff\xfc\x00\x7f\x00\x7f\xff\xff\xc0\x00\x01\xff\xff\xff\x80\x7f\x01\xff\xff\xff\xf0\x00\x03\xff\xff\xff\xc0\x7f\x03\xe0\x00\x00\xf8\x00\x07\xc0\x00\x03\xe0\x7f\x07\x80\x00\x00<\x00\x0f\x00\x00\x00\xf0\x7f\x07\x00\x00\x00\x1c\x00\x1e\x00\x00\x00x\x7f\x0e\x00\x00\x00\x0e\x00\x1c\x00\x00\x008\x7f\x0e\x00\x00\x00\x0e\x008\x00\x00\x00\x1c\x7f\x1c\x00\x00\x00\x07\x008\x00\x00\x00\x1c\x7f\x1c\x00\x00\x00\x07\x008\x00\x00\x00\x1c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x1c\x7f\x1f\xff\xff\xff\xff\x00?\xff\xff\xff\xfc\x7f\x1f\xff\xff\xff\xff\x00?\xff\xff\xff\xfc\x7f\x1c\x00\x0b\xfb\xa7\x008\x00/\xe7\\\x7f\x1c\x00\x07\xff\x87\x000\x00\x0f\xff\x0c\x7f\x1c\x00\x07\xff\xc7\x000\x00/\xffL\x7f\x1c\x00\x07\xff\xc7\x000\x00\x0f\xff\x0c\x7f\x1c\x00\x07\xff\xc7\x000\x00/\xffL\x7f\x1c\x00\x0b\xff\xa7\x000\x00\x0f\xff\x0c\x7f\x1c\x00\x01\xff\x87\x008\x00\x17\xfe\x9c\x7f\x0e\x00\x05\xffN\x008\x00\x03\xfc\x1c\x7f\x0e\x00\x00|\x0e\x00<\x00\x01\xf8<\x7f\x0f\x00\x01\x01\x1e\x00\x1c\x00\x02\x048\x7f\x07\x80\x00(<\x00\x1e\x00\x00Px\x7f\x03\xc0\x00\x00x\x00\x0f\x80\x00\x01\xf0\x7f\x01\xf8\x00\x03\xf0\x00\x07\xe0\x00\x07\xe0\x7f\x00\xff\xff\xff\xe0\x00\x03\xff\xff\xff\xc0\x7f\x00?\xff\xff\x80\x00\x00\xff\xff\xff\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f'
|
||||
Toxic=b'P4\n89 64\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x1f\xff\xff\x00\x00\x00?\xff\xfc\x00\x7f\x00\x7f\xff\xff\xc0\x00\x01\xff\xff\xff\x80\x7f\x01\xff\xff\xff\xf0\x00\x03\xff\xff\xff\xc0\x7f\x03\xe0\x00\x00\xf8\x00\x07\xc0\x00\x03\xe0\x7f\x07\x80\x00\x00<\x00\x0f\x00\x00\x00\xf0\x7f\x07\x00\x00\x00\x1c\x00\x1e\x00\x00\x00x\x7f\x0e\x00\x00\x00\x0e\x00\x1c\x00\x00\x008\x7f\x0e\x00\x00\x00\x0e\x008\x00\x00\x00\x1c\x7f\x1c\x00\x00\x00\x07\x008\x00\x00\x00\x1c\x7f\x1c\x00\x00\x00\x07\x008\x00\x00\x00\x1c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x0e\x00\x07\x000\x008\x00\x0c\x7f\x1c\x00\x7f@\x07\x000\x00\xff\x00\x0c\x7f\x1c\x00\x7f\xc0\x07\x000\x01\xff\x00\x0c\x7f\x1c\x00\xff\xe0\x07\x000\x03\xff\x80\x0c\x7f\x1c\x00\xff\xe0\x07\x000\x03\xff\xc0\x0c\x7f\x1c\x01\xff\xf0\x07\x000\x03\xff\xc0\x0c\x7f\x1c\x01\xc4p\x07\x000\x03\x18\xc0\x0c\x7f\x1c\x01\xc4p\x07\x000\x03\x08\xc0\x0c\x7f\x1c\x00\xce`\x07\x000\x03\x99\xc0\x0c\x7f\x1c\x00\xf9\xe0\x07\x000\x01\xe7\x80\x0c\x7f\x1c\x00y\xc0\x07\x000\x00\xe7\x00\x0c\x7f\x1c\x04\x1f\x02\x07\x000\x18>\x0c\x0c\x7f\x1c\x0f\x8a\x1e\x07\x000?\x10<\x0c\x7f\x1c\x0c\xf0\xf3\x07\x0003\xe1\xec\x0c\x7f\x1c\x00>@\x07\x000\x00|\x00\x0c\x7f\x1c\r\xe3\xe6\x07\x000\x1b\xcf\xc8\x0c\x7f\x1c\x0f\xc0\xfe\x07\x000\x1f\x81\xfc\x0c\x7f\x1c\x06\x00\x0e\x07\x000\x0c\x008\x0c\x7f\x1c\x06\x00\x0c\x07\x000\x08\x00\x18\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x008\x00\x00\x00\x1c\x7f\x0e\x00\x00\x00\x0e\x008\x00\x00\x00\x1c\x7f\x0e\x00\x00\x00\x0e\x00<\x00\x00\x00<\x7f\x0f\x00\x00\x00\x1e\x00\x1c\x00\x00\x008\x7f\x07\x80\x00\x00<\x00\x1e\x00\x00\x00x\x7f\x03\xc0\x00\x00x\x00\x0f\x80\x00\x01\xf0\x7f\x01\xf8\x00\x03\xf0\x00\x07\xe0\x00\x07\xe0\x7f\x00\xff\xff\xff\xe0\x00\x03\xff\xff\xff\xc0\x7f\x00?\xff\xff\x80\x00\x00\xff\xff\xff\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f'
|
||||
Up=b'P4\n89 64\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x1f\xff\xff\x00\x00\x00?\xff\xfc\x00\x7f\x00\x7f\xff\xff\xc0\x00\x01\xff\xff\xff\x80\x7f\x01\xff\xff\xff\xf0\x00\x03\xff\xff\xff\xc0\x7f\x03\xe0\x00\x00\xf8\x00\x07\xc0\x00\x03\xe0\x7f\x07\x80\x00\x00<\x00\x0f\x00\x00\x00\xf0\x7f\x07\x00!\x00\x1c\x00\x1e\x00\x82\x00x\x7f\x0e\x00\x0e\x00\x0e\x00\x1c\x00\x1c\x808\x7f\x0e\x00?\x80\x0e\x008\x00\xfe\x00\x1c\x7f\x1c\x00\x7f\xc0\x07\x008\x05\xff\xa0\x1c\x7f\x1c\x00\xfe`\x07\x008\x01\xfc\x80\x1c\x7f\x1c\x02\xfe\xe8\x07\x000\x03\xfb\xc0\x0c\x7f\x1c\x01\xff\xf0\x07\x000\x0b\xff\xd0\x0c\x7f\x1c\x01\xff\xf0\x07\x000\x03\xff\xc0\x0c\x7f\x1c\x01\xff\xf0\x07\x000\x0b\xff\xd0\x0c\x7f\x1c\x00\xff\xe0\x07\x000\x03\xff\xc0\x0c\x7f\x1c\x02\xff\xe8\x07\x000\x01\xff\x80\x0c\x7f\x1c\x00\x7f\xc0\x07\x000\x05\xff\xa0\x0c\x7f\x1c\x00?\x80\x07\x000\x00\xff\x00\x0c\x7f\x1c\x00\x0e\x00\x07\x000\x01<\x80\x0c\x7f\x1c\x00!\x00\x07\x000\x00B\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x008\x00\x00\x00\x1c\x7f\x0e\x00\x00\x00\x0e\x008\x00\x00\x00\x1c\x7f\x0e\x00\x00\x00\x0e\x00<\x00\x00\x00<\x7f\x0f\x00\x00\x00\x1e\x00\x1c\x00\x00\x008\x7f\x07\x80\x00\x00<\x00\x1e\x00\x00\x00x\x7f\x03\xc0\x00\x00x\x00\x0f\x80\x00\x01\xf0\x7f\x01\xf8\x00\x03\xf0\x00\x07\xe0\x00\x07\xe0\x7f\x00\xff\xff\xff\xe0\x00\x03\xff\xff\xff\xc0\x7f\x00?\xff\xff\x80\x00\x00\xff\xff\xff\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f'
|
||||
Winking=b'P4\n89 64\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x1f\xff\xff\x00\x00\x00?\xff\xfc\x00\x7f\x00\x7f\xff\xff\xc0\x00\x01\xff\xff\xff\x80\x7f\x01\xff\xff\xff\xf0\x00\x03\xff\xff\xff\xc0\x7f\x03\xe0\x00\x00\xf8\x00\x07\xc0\x00\x03\xe0\x7f\x07\x80\x00\x00<\x00\x0f\x00\x00\x00\xf0\x7f\x07\x00\x00\x00\x1c\x00\x1e\x00\x00\x00x\x7f\x0e\x00\x00\x00\x0e\x00\x1c\x00\x00\x008\x7f\x0e\x00\x00\x00\x0e\x008\x00\x00\x00\x1c\x7f\x1c\x00\x00\x00\x07\x008\x00\x00\x00\x1c\x7f\x1c\x00\x00\x00\x07\x008\x00\x00\x00\x1c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00!\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x0e\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00?\x80\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x7f\xc0\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\xfe`\x07\x000\x00\x00\x00\x0c\x7f\x1c\x02\xfe\xe8\x07\x000\x00\x00\x00\x0c\x7f\x1c\x01\xff\xf0\x07\x00?\xff\xff\xff\xfc\x7f\x1c\x01\xff\xf0\x07\x00?\xff\xff\xff\xfc\x7f\x1c\x01\xff\xf0\x07\x00?\xff\xff\xff\xfc\x7f\x1c\x00\xff\xe0\x07\x000\x00\x00\x00\x0c\x7f\x1c\x02\xff\xe8\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x7f\xc0\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00?\x80\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x0e\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00!\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x000\x00\x00\x00\x0c\x7f\x1c\x00\x00\x00\x07\x008\x00\x00\x00\x1c\x7f\x0e\x00\x00\x00\x0e\x008\x00\x00\x00\x1c\x7f\x0e\x00\x00\x00\x0e\x00<\x00\x00\x00<\x7f\x0f\x00\x00\x00\x1e\x00\x1c\x00\x00\x008\x7f\x07\x80\x00\x00<\x00\x1e\x00\x00\x00x\x7f\x03\xc0\x00\x00x\x00\x0f\x80\x00\x01\xf0\x7f\x01\xf8\x00\x03\xf0\x00\x07\xe0\x00\x07\xe0\x7f\x00\xff\xff\xff\xe0\x00\x03\xff\xff\xff\xc0\x7f\x00?\xff\xff\x80\x00\x00\xff\xff\xff\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f'
|
||||
74
boards/default/micropython/build/lib/gnss.py
Normal file
74
boards/default/micropython/build/lib/gnss.py
Normal file
@@ -0,0 +1,74 @@
|
||||
"""
|
||||
GNSS
|
||||
|
||||
Micropython library for the GNSS(NMEA0183/GPS,DBS)
|
||||
=======================================================
|
||||
|
||||
#Preliminary composition 20230314
|
||||
|
||||
@dahanzimin From the Mixly Team
|
||||
"""
|
||||
from ubinascii import unhexlify
|
||||
|
||||
class NMEA0183:
|
||||
def __init__(self, uart, baudrate=9600, timeout=200):
|
||||
self._uart=uart
|
||||
self._uart.init(baudrate=baudrate, timeout=timeout, rxbuf=1024)
|
||||
self.time=[None, None, None, None, None, None, None, 0]
|
||||
self.locate=['', None, '', None, None, None, None] #0'1经度,2'3纬度,4海拔m,5速度m/s,6航向°
|
||||
self.status=[False, ' ', 0] #有效标注,定位模式,卫星量
|
||||
|
||||
def _crc8(self, buffer):
|
||||
'''对数据进行CRC校验'''
|
||||
crc = 0x00
|
||||
for byte in buffer:
|
||||
crc ^= byte
|
||||
return crc & 0xff
|
||||
|
||||
def _judge(self, buffer, dlen):
|
||||
try:
|
||||
data=buffer.strip().decode().split(',')
|
||||
if len(data) == dlen:
|
||||
if unhexlify(data[-1][-2:])[0] == self._crc8(buffer[1:-5]):
|
||||
return True,data
|
||||
return False,None
|
||||
except :
|
||||
return False,None
|
||||
|
||||
def any(self):
|
||||
flag_rmc,flag_gga=False,False
|
||||
while self._uart.any():
|
||||
_data=self._uart.readline()
|
||||
if b'$GNGGA' in _data:
|
||||
flag_gga,data=self._judge(_data, 15)
|
||||
#print("GGA----",flag_gga)
|
||||
if flag_gga:
|
||||
self.time[4]= int(data[1][0:2]) if data[1] else None
|
||||
self.time[5]= int(data[1][2:4]) if data[1] else None
|
||||
self.time[6]= int(data[1][4:6]) if data[1] else None
|
||||
self.locate[0]= data[5]
|
||||
self.locate[1]= int(data[4][:3])+int(data[4][3:].replace('.',''))/6000000 if data[4] else None
|
||||
self.locate[2]= data[3]
|
||||
self.locate[3]= int(data[2][:2])+int(data[2][2:].replace('.',''))/6000000 if data[2] else None
|
||||
self.locate[4]= float(data[9]) if data[3] else None
|
||||
self.status[0]= False if '0' in data[6] else True
|
||||
self.status[2]= int(data[7])
|
||||
if b'$GNRMC' in _data:
|
||||
flag_rmc,data=self._judge(_data, 14)
|
||||
#print("RMC----",flag_rmc)
|
||||
if flag_rmc:
|
||||
self.time[0]= int(data[9][4:6])+2000 if data[9] else None
|
||||
self.time[1]= int(data[9][2:4]) if data[9] else None
|
||||
self.time[2]= int(data[9][0:2]) if data[9] else None
|
||||
self.time[4]= int(data[1][0:2])+8 if data[1] else None
|
||||
self.time[5]= int(data[1][2:4]) if data[1] else None
|
||||
self.time[6]= int(data[1][4:6]) if data[1] else None
|
||||
self.locate[0]= data[6]
|
||||
self.locate[1]= int(data[5][:3])+int(data[5][3:].replace('.',''))/6000000 if data[5] else None
|
||||
self.locate[2]= data[4]
|
||||
self.locate[3]= int(data[3][:2])+int(data[3][2:].replace('.',''))/6000000 if data[3] else None
|
||||
self.locate[5]= round(float(data[7])*0.514, 2) if data[7] else None
|
||||
self.locate[6]= float(data[8]) if data[8] else None
|
||||
self.status[0]= False if 'V' in data[2] else True
|
||||
self.status[1]= data[12]
|
||||
return flag_rmc | flag_gga
|
||||
88
boards/default/micropython/build/lib/hp203x.py
Normal file
88
boards/default/micropython/build/lib/hp203x.py
Normal file
@@ -0,0 +1,88 @@
|
||||
"""
|
||||
HP203X
|
||||
|
||||
MicroPython library for the HP203X(Air pressure sensor)
|
||||
=======================================================
|
||||
|
||||
#Changed from circuitpython to micropython 20220211
|
||||
#Format unified 20220623
|
||||
|
||||
dahanzimin From the Mixly Team
|
||||
"""
|
||||
|
||||
import time
|
||||
from micropython import const
|
||||
|
||||
HP203X_ADDRESS = const(0x76)
|
||||
HP203X_REG_RST = const(0x06)
|
||||
HP203X_REG_RDY = const(0x0D)
|
||||
HP20X_READ_P = const(0x30)
|
||||
HP20X_READ_H = const(0x31)
|
||||
HP20X_READ_T = const(0x32)
|
||||
HP20X_READ_CAL = const(0x28)
|
||||
HP20X_WR_CONVERT_CMD = const(0x40)
|
||||
|
||||
#转换时间 越大时间越久
|
||||
#HP20X_CONVERT_OSR4096 =0<<2
|
||||
HP20X_CONVERT_OSR2048 =1<<2
|
||||
#HP20X_CONVERT_OSR1024 =2<<2
|
||||
#HP20X_CONVERT_OSR512 =3<<2
|
||||
#HP20X_CONVERT_OSR256 =4<<2
|
||||
#HP20X_CONVERT_OSR128 =5<<2
|
||||
|
||||
class HP203X:
|
||||
def __init__(self, i2c_bus,cal=False):
|
||||
self._device = i2c_bus
|
||||
self._address = HP203X_ADDRESS
|
||||
self.data_reg = bytearray(3)
|
||||
self._buffer = bytearray(1)
|
||||
self.osr = HP20X_CONVERT_OSR2048 #SET time
|
||||
|
||||
if self._read_rdy()&0x40 ==0:
|
||||
raise AttributeError("Cannot find a HP203X")
|
||||
|
||||
self._rst() #Reset
|
||||
time.sleep(0.1)
|
||||
if cal: #Calibration
|
||||
self._write_cmd(HP20X_WR_CONVERT_CMD|self.osr)
|
||||
time.sleep(0.1)
|
||||
self._calibration()
|
||||
print("calibration")
|
||||
|
||||
def _read_data(self, address):
|
||||
self._buffer[0] = address & 0xFF
|
||||
self._device.writeto(self._address,self._buffer)
|
||||
self._device.readfrom_into(self._address,self.data_reg)
|
||||
return self.data_reg
|
||||
|
||||
def _write_cmd(self,command):
|
||||
self._buffer[0] = command & 0xFF
|
||||
self._device.writeto(self._address,self._buffer)
|
||||
|
||||
def _read_rdy(self):
|
||||
return self._read_data(HP203X_REG_RDY)[0]
|
||||
|
||||
def _calibration(self):
|
||||
self._write_cmd(HP20X_READ_CAL)
|
||||
|
||||
def _rst(self):
|
||||
self._write_cmd(HP203X_REG_RST)
|
||||
|
||||
def u2s(self,n):
|
||||
return n if n < (1 << 23) else n - (1 << 24)
|
||||
|
||||
def get_data(self,flag):
|
||||
self._write_cmd(HP20X_WR_CONVERT_CMD|self.osr)
|
||||
time.sleep(0.1)
|
||||
self._read_data(flag)
|
||||
hp_data=(self.data_reg[0]<<16)|(self.data_reg[1]<<8)|self.data_reg[2]
|
||||
return self.u2s(hp_data)/100
|
||||
|
||||
def pressure(self):
|
||||
return self.get_data(HP20X_READ_P)
|
||||
|
||||
def altitude(self):
|
||||
return self.get_data(HP20X_READ_H)
|
||||
|
||||
def temperature(self):
|
||||
return self.get_data(HP20X_READ_T)
|
||||
59
boards/default/micropython/build/lib/ht16k33.py
Normal file
59
boards/default/micropython/build/lib/ht16k33.py
Normal file
@@ -0,0 +1,59 @@
|
||||
"""
|
||||
HT16K33-framebuf
|
||||
|
||||
Micropython library for the HT16K33 Matrix16x8
|
||||
=======================================================
|
||||
|
||||
#Preliminary composition 20230411
|
||||
|
||||
@dahanzimin From the Mixly Team
|
||||
"""
|
||||
import uframebuf
|
||||
from micropython import const
|
||||
|
||||
_HT16K33_BLINK_CMD = const(0x80)
|
||||
_HT16K33_BLINK_DISPLAYON = const(0x01)
|
||||
_HT16K33_CMD_BRIGHTNESS = const(0xE0)
|
||||
_HT16K33_OSCILATOR_ON = const(0x21)
|
||||
|
||||
class HT16K33(uframebuf.FrameBuffer_Ascall):
|
||||
def __init__(self, i2c, address=0x70, brightness=0.3, width=16, height=8):
|
||||
self._i2c = i2c
|
||||
self._address = address
|
||||
self._blink_rate=0
|
||||
self._brightness=brightness
|
||||
self._buffer = bytearray((width + 7) // 8 * height)
|
||||
super().__init__(self._buffer, width, height, uframebuf.MONO_HMSB)
|
||||
self._write_cmd(_HT16K33_OSCILATOR_ON)
|
||||
self.blink_rate(0)
|
||||
self.set_brightness(brightness)
|
||||
self.fill(0)
|
||||
self.show()
|
||||
|
||||
def _write_cmd(self, val):
|
||||
'''I2C write command'''
|
||||
self._i2c.writeto(self._address,val.to_bytes(1, 'little'))
|
||||
|
||||
def blink_rate(self, rate=None):
|
||||
if rate is None:
|
||||
return self._blink_rate
|
||||
if not 0 <= rate <= 3:
|
||||
raise ValueError("Blink rate must be an integer in the range: 0-3")
|
||||
rate = rate & 0x03
|
||||
self._blink_rate = rate
|
||||
self._write_cmd(_HT16K33_BLINK_CMD | _HT16K33_BLINK_DISPLAYON | rate << 1)
|
||||
|
||||
def get_brightness(self):
|
||||
return self._brightness
|
||||
|
||||
def set_brightness(self, brightness):
|
||||
if not 0.0 <= brightness <= 1.0:
|
||||
raise ValueError("Brightness must be a decimal number in the range: 0.0-1.0")
|
||||
self._brightness = brightness
|
||||
xbright = round(15 * brightness)
|
||||
xbright = xbright & 0x0F
|
||||
self._write_cmd(_HT16K33_CMD_BRIGHTNESS | xbright)
|
||||
|
||||
def show(self):
|
||||
"""Refresh the display and show the changes."""
|
||||
self._i2c.writeto_mem(self._address, 0x00, self._buffer)
|
||||
305
boards/default/micropython/build/lib/huskylens.py
Normal file
305
boards/default/micropython/build/lib/huskylens.py
Normal file
@@ -0,0 +1,305 @@
|
||||
"""
|
||||
HuskyLens
|
||||
|
||||
MicroPython library for the HuskyLens-I2C(DF)
|
||||
=======================================================
|
||||
|
||||
#Preliminary composition 20220224
|
||||
#base on https://github.com/HuskyLens/HUSKYLENSPython 20220623
|
||||
|
||||
dahanzimin From the Mixly Team
|
||||
"""
|
||||
|
||||
import time
|
||||
from ubinascii import unhexlify,hexlify
|
||||
|
||||
commandHeaderAndAddress = "55AA11"
|
||||
algorthimsByteID = {
|
||||
"ALGORITHM_OBJECT_TRACKING": "0100", #物体追踪
|
||||
"ALGORITHM_FACE_RECOGNITION": "0000", #人脸识别
|
||||
"ALGORITHM_OBJECT_RECOGNITION": "0200", #物体识别
|
||||
"ALGORITHM_LINE_TRACKING": "0300", #巡线
|
||||
"ALGORITHM_COLOR_RECOGNITION": "0400", #颜色识别
|
||||
"ALGORITHM_TAG_RECOGNITION": "0500", #标签识别
|
||||
"ALGORITHM_OBJECT_CLASSIFICATION": "0600", #物体分类
|
||||
"ALGORITHM_QR_CODE_RECOGNTITION" : "0700", #二维码识别(教育版独有)
|
||||
"ALGORITHM_BARCODE_RECOGNTITION":"0800", #条形码识别(教育版独有)
|
||||
}
|
||||
|
||||
class Arrow:
|
||||
def __init__(self, xTail, yTail , xHead , yHead, ID):
|
||||
self.xTarget=xTail
|
||||
self.yTarget=yTail
|
||||
self.xOrigin=xHead
|
||||
self.yOrigin=yHead
|
||||
self.id=ID
|
||||
self.learned= True if ID > 0 else False
|
||||
self.type="arrows"
|
||||
|
||||
class Block:
|
||||
def __init__(self, x, y , width , height, ID):
|
||||
self.xCenter = x
|
||||
self.yCenter=y
|
||||
self.width=width
|
||||
self.height=height
|
||||
self.id=ID
|
||||
self.learned= True if ID > 0 else False
|
||||
self.type="blocks"
|
||||
|
||||
class HuskyLens:
|
||||
def __init__(self, i2c,address=0x32):
|
||||
self._address = address
|
||||
self.checkOnceAgain=True
|
||||
self._device = i2c
|
||||
self._buffer=[]
|
||||
self._learned_number=0
|
||||
if not self.knock():
|
||||
raise AttributeError("Cannot find a HuskyLens")
|
||||
|
||||
def _write_cmd(self, cmd):
|
||||
'''Write memory address'''
|
||||
self._device.writeto(self._address, unhexlify(cmd))
|
||||
|
||||
def _read_cmd(self, nbytes):
|
||||
'''Read memory address'''
|
||||
return self._device.readfrom(self._address, nbytes)
|
||||
|
||||
def _checksum(self, hexStr):
|
||||
'''data checksums'''
|
||||
total = 0
|
||||
for i in range(0, len(hexStr), 2):
|
||||
total += int(hexStr[i:i+2], 16)
|
||||
hexStr = hex(total)[-2:]
|
||||
return hexStr
|
||||
|
||||
def _read_data(self):
|
||||
'''Read data'''
|
||||
while True:
|
||||
time.sleep(0.01)
|
||||
buffer = self._read_cmd(5)
|
||||
if buffer[0] == 0x55:
|
||||
break
|
||||
buffer += self._read_cmd(int(buffer[3])+1)
|
||||
strs=hexlify(buffer).decode()
|
||||
|
||||
headers = strs[0:4]
|
||||
address = strs[4:6]
|
||||
data_length = int(strs[6:8], 16)
|
||||
command = strs[8:10]
|
||||
if(data_length > 0):
|
||||
data = strs[10:10+data_length*2]
|
||||
else:
|
||||
data = ''
|
||||
checkSum = strs[2*(6+data_length-1):2*(6+data_length-1)+2]
|
||||
return [headers, address, data_length, command, data, checkSum]
|
||||
|
||||
def getBlockOrArrowCommand(self):
|
||||
commandSplit = self._read_data()
|
||||
isBlock = True if commandSplit[3] == "2a" else False
|
||||
return (commandSplit[4],isBlock)
|
||||
|
||||
def processReturnData(self):
|
||||
inProduction = True
|
||||
byteString=""
|
||||
if inProduction :
|
||||
commandSplit = self._read_data()
|
||||
|
||||
if commandSplit[3] == "2e":
|
||||
return "Knock Recieved"
|
||||
else:
|
||||
returnData = []
|
||||
numberOfBlocksOrArrow = int(commandSplit[4][2:4]+commandSplit[4][0:2], 16)
|
||||
self._learned_number = int(commandSplit[4][6:8]+commandSplit[4][4:6], 16)
|
||||
|
||||
for i in range(numberOfBlocksOrArrow):
|
||||
tmpObj=self.getBlockOrArrowCommand()
|
||||
isBlock=tmpObj[1]
|
||||
returnData.append(tmpObj[0])
|
||||
|
||||
if returnData :
|
||||
finalData = []
|
||||
tmp = []
|
||||
for i in returnData:
|
||||
tmp = []
|
||||
for q in range(0, len(i), 4):
|
||||
low=int(i[q:q+2], 16)
|
||||
high=int(i[q+2:q+4], 16)
|
||||
if(high>0):
|
||||
val=low+255+high
|
||||
else:
|
||||
val=low
|
||||
tmp.append(val)
|
||||
finalData.append(tmp)
|
||||
tmp = []
|
||||
self.checkOnceAgain=True
|
||||
self._buffer=self.convert_to_class_object(finalData,isBlock)
|
||||
return "Data processing completed"
|
||||
else:
|
||||
self._buffer=[]
|
||||
|
||||
def convert_to_class_object(self,data,isBlock):
|
||||
tmp=[]
|
||||
for i in data:
|
||||
if(isBlock):
|
||||
obj = Block(i[0],i[1],i[2],i[3],i[4])
|
||||
else:
|
||||
obj = Arrow(i[0],i[1],i[2],i[3],i[4])
|
||||
tmp.append(obj)
|
||||
return tmp
|
||||
|
||||
def knock(self):
|
||||
'''Send a simple knock to the HuskyLens to ensure that you are connected and can communicate.'''
|
||||
self._write_cmd(commandHeaderAndAddress+"002c3c")
|
||||
return self._read_data()[3] == "2e"
|
||||
|
||||
def command_request_algorthim(self, alg):
|
||||
'''切换xx算法'''
|
||||
if alg in algorthimsByteID:
|
||||
cmd = commandHeaderAndAddress+"022d"+algorthimsByteID[alg]
|
||||
cmd += self._checksum(cmd)
|
||||
self._write_cmd(cmd)
|
||||
return self.processReturnData()
|
||||
else:
|
||||
print("INCORRECT ALGORITHIM NAME")
|
||||
|
||||
def command_request(self):
|
||||
'''请求一次数据 存入结果'''
|
||||
self._write_cmd(commandHeaderAndAddress+"002030")
|
||||
self.processReturnData()
|
||||
|
||||
def read_learned_id_count(self):
|
||||
'''从结果中获取 已学习ID总数'''
|
||||
return self._learned_number
|
||||
|
||||
def is_appear_direct(self,shape):
|
||||
'''从结果中获取 方块或箭头 是否在画面中'''
|
||||
if len(self._buffer) > 0:
|
||||
return self._buffer[0].type == shape
|
||||
|
||||
|
||||
def read_block_center_parameter_direct(self,shape):
|
||||
'''从结果中获取靠近中心 方块或箭头 的信息'''
|
||||
if len(self._buffer) > 0:
|
||||
if self._buffer[0].type == shape :
|
||||
return self._buffer[0]
|
||||
else :
|
||||
return False
|
||||
|
||||
def is_learned(self,get_id):
|
||||
'''从结果中获取获取IDx是否已学习'''
|
||||
if 0 < get_id < self._learned_number:
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
|
||||
def is_appear(self,get_id,shape):
|
||||
'''从结果中获取获取IDx 方块或箭头 是否在画面中'''
|
||||
if len(self._buffer) > 0:
|
||||
for i in self._buffer :
|
||||
if i.id == get_id :
|
||||
return i.type == shape
|
||||
|
||||
def read_blocks_arrows_parameter(self,get_id,number,shape):
|
||||
'''从结果中获取获取IDx 第number个方块或箭头 的信息'''
|
||||
if len(self._buffer) > 0:
|
||||
id_list=[]
|
||||
for i in self._buffer :
|
||||
if i.id == get_id and i.type == shape:
|
||||
id_list.append(i)
|
||||
if number is None:
|
||||
return id_list[0]
|
||||
else:
|
||||
return id_list[number-1]
|
||||
|
||||
def read_count(self,get_id,shape):
|
||||
'''从结果中获取获取IDx 方块或箭头 的总数'''
|
||||
num=0
|
||||
if len(self._buffer) > 0:
|
||||
for i in self._buffer :
|
||||
if get_id is None and i.type == shape:
|
||||
num+=1
|
||||
if i.id == get_id and i.type == shape:
|
||||
num+=1
|
||||
return num
|
||||
|
||||
def read_blocks_arrows_parameter_direct(self,number,shape):
|
||||
'''从结果中获取获取第x个 方块或箭头 的信息'''
|
||||
if len(self._buffer) >= number :
|
||||
print(len(self._buffer))
|
||||
if self._buffer[number-1].type == shape :
|
||||
return self._buffer[number-1]
|
||||
|
||||
def command_request_learn_once(self,get_id):
|
||||
'''自动学习一次 IDx'''
|
||||
data = "{:04x}".format(get_id)
|
||||
part1=data[2:]
|
||||
part2=data[0:2]
|
||||
#reverse to correct endiness
|
||||
data=part1+part2
|
||||
dataLen = "{:02x}".format(len(data)//2)
|
||||
cmd = commandHeaderAndAddress+dataLen+"36"+data
|
||||
print("-----",cmd)
|
||||
cmd += self._checksum(cmd)
|
||||
self._write_cmd(cmd)
|
||||
|
||||
def command_request_forget(self):
|
||||
'''遗忘当前算法的所有学习数据'''
|
||||
self._write_cmd(commandHeaderAndAddress+"003747")
|
||||
|
||||
def command_request_customnames(self,name,get_id):
|
||||
'''设置当前算法 IDx 名字为 name'''
|
||||
nameDataSize = "{:02x}".format(len(name)+1)
|
||||
name = hexlify(name).decode()+"00"
|
||||
localId = "{:02x}".format(get_id)
|
||||
data = localId+nameDataSize+name
|
||||
dataLen = "{:02x}".format(len(data)//2)
|
||||
cmd = commandHeaderAndAddress+dataLen+"2f"+data
|
||||
cmd += self._checksum(cmd)
|
||||
self._write_cmd(cmd)
|
||||
|
||||
def command_request_custom_text(self,name,x,y):
|
||||
'''屏幕叠加显示文字name 在 xy'''
|
||||
name=hexlify(name).decode()
|
||||
nameDataSize = "{:02x}".format(len(name)//2)
|
||||
if x>255:
|
||||
x="ff"+"{:02x}".format(x%255)
|
||||
else:
|
||||
x="00"+"{:02x}".format(x)
|
||||
y="{:02x}".format(y)
|
||||
data = nameDataSize+x+y+name
|
||||
dataLen = "{:02x}".format(len(data)//2)
|
||||
cmd = commandHeaderAndAddress+dataLen+"34"+data
|
||||
cmd += self._checksum(cmd)
|
||||
self._write_cmd(cmd)
|
||||
|
||||
def command_request_clear_text(self):
|
||||
'''清除屏幕显示的文字'''
|
||||
self._write_cmd(commandHeaderAndAddress+"003545")
|
||||
|
||||
def command_request_photo(self):
|
||||
'''触发拍照保存到SD卡'''
|
||||
self._write_cmd(commandHeaderAndAddress+"003040")
|
||||
time.sleep(0.5)
|
||||
|
||||
def command_request_screenshot(self):
|
||||
'''触发截屏保存到SD卡'''
|
||||
self._write_cmd(commandHeaderAndAddress+"003949")
|
||||
time.sleep(0.5)
|
||||
|
||||
def command_request_save_model_to_SD_card(self,idVal):
|
||||
'''保存当前算法数据位SD卡 (0~4) 号模型'''
|
||||
idVal = "{:04x}".format(idVal)
|
||||
idVal = idVal[2:]+idVal[0:2]
|
||||
cmd = commandHeaderAndAddress+"0232"+idVal
|
||||
cmd += self._checksum(cmd)
|
||||
self._write_cmd(cmd)
|
||||
time.sleep(0.5)
|
||||
|
||||
def command_request_load_model_from_SD_card(self,idVal):
|
||||
'''加载当前算法数据位SD卡 (0~4) 号模型'''
|
||||
idVal = "{:04x}".format(idVal)
|
||||
idVal = idVal[2:]+idVal[0:2]
|
||||
cmd = commandHeaderAndAddress+"0233"+idVal
|
||||
cmd += self._checksum(cmd)
|
||||
self._write_cmd(cmd)
|
||||
time.sleep(0.5)
|
||||
280
boards/default/micropython/build/lib/i2cdevice.py
Normal file
280
boards/default/micropython/build/lib/i2cdevice.py
Normal file
@@ -0,0 +1,280 @@
|
||||
"""
|
||||
I2C_Device
|
||||
|
||||
Micropython library for the I2C communication Device(TD)
|
||||
=======================================================
|
||||
|
||||
@dahanzimin From the Mixly Team
|
||||
"""
|
||||
import random
|
||||
from machine import SoftI2C
|
||||
|
||||
def _u2s(value, n=8):
|
||||
return value if value < (1 << (n-1)) else value - (1 << n)
|
||||
|
||||
'''i2c-Inheritance'''
|
||||
class I2C_device(SoftI2C):
|
||||
|
||||
CRC8_Table =b'\x00^\xbc\xe2a?\xdd\x83\xc2\x9c~ \xa3\xfd\x1fA\x9d\xc3!\x7f\xfc\xa2@\x1e_\x01\xe3\xbd>`\x82\xdc#}\x9f\xc1B\x1c\xfe\xa0\xe1\xbf]\x03\x80\xde<b\xbe\xe0\x02\\\xdf\x81c=|"\xc0\x9e\x1dC\xa1\xffF\x18\xfa\xa4\'y\x9b\xc5\x84\xda8f\xe5\xbbY\x07\xdb\x85g9\xba\xe4\x06X\x19G\xa5\xfbx&\xc4\x9ae;\xd9\x87\x04Z\xb8\xe6\xa7\xf9\x1bE\xc6\x98z$\xf8\xa6D\x1a\x99\xc7%{:d\x86\xd8[\x05\xe7\xb9\x8c\xd20n\xed\xb3Q\x0fN\x10\xf2\xac/q\x93\xcd\x11O\xad\xf3p.\xcc\x92\xd3\x8do1\xb2\xec\x0eP\xaf\xf1\x13M\xce\x90r,m3\xd1\x8f\x0cR\xb0\xee2l\x8e\xd0S\r\xef\xb1\xf0\xaeL\x12\x91\xcf-s\xca\x94v(\xab\xf5\x17I\x08V\xb4\xeai7\xd5\x8bW\t\xeb\xb56h\x8a\xd4\x95\xcb)w\xf4\xaaH\x16\xe9\xb7U\x0b\x88\xd64j+u\x97\xc9J\x14\xf6\xa8t*\xc8\x96\x15K\xa9\xf7\xb6\xe8\nT\xd7\x89k5'
|
||||
|
||||
def _crc8(self, buf):
|
||||
_sum = 0
|
||||
for i in range(0, len(buf)):
|
||||
_sum = self.CRC8_Table[_sum ^ buf[i]]
|
||||
return _sum
|
||||
|
||||
def read_device(self, addr, cmd, nbytes=1):
|
||||
buf = self.readfrom_mem(addr, cmd, nbytes+2)
|
||||
if self._crc8(buf[:-1]) == buf[-1]:
|
||||
return buf[1] if nbytes<=1 else buf[1:-1]
|
||||
|
||||
def write_device(self, addr, cmd, buf=0):
|
||||
buf = buf.to_bytes(1, 'little') if type(buf) is int else buf
|
||||
buf = bytearray([cmd, random.randint(0, 255)]) + buf
|
||||
crc8 = self._crc8(buf).to_bytes(1, 'little')
|
||||
self.writeto(addr, buf + crc8)
|
||||
if crc8 == self.readfrom(addr, 1):
|
||||
return True
|
||||
|
||||
'''Fundamentals of Sensors'''
|
||||
class Base:
|
||||
def __init__(self, i2c_bus):
|
||||
self._i2c = i2c_bus
|
||||
|
||||
def addr_set(self, old=0, new=0):
|
||||
try:
|
||||
self._i2c.write_device(self._addrs[old], 0x04, bytearray([self._addrs[old], self._addrs[new]]))
|
||||
except Exception as e:
|
||||
print("Warning: No serial number can be changed or", e)
|
||||
|
||||
def addr_get(self):
|
||||
_addred = []
|
||||
for add in self._i2c.scan():
|
||||
if add in self._addrs:
|
||||
_addred.append(self._addrs.index(add))
|
||||
return tuple(_addred)
|
||||
|
||||
'''Motor'''
|
||||
class Motor(Base):
|
||||
_addrs = [0x30, 0x31, 0x32, 0x33]
|
||||
|
||||
def run(self, naddr=0, speed=None):
|
||||
'''普票电机参数 speed: 速度-100~100%, None返回速度值'''
|
||||
try:
|
||||
if speed is None:
|
||||
return _u2s(self._i2c.read_device(self._addrs[naddr], 0x10))
|
||||
else:
|
||||
speed = max(min(speed, 100), -100)
|
||||
self._i2c.write_device(self._addrs[naddr], 0xA0, speed)
|
||||
except Exception as e:
|
||||
raise RuntimeError("Cannot find a Motor device", e)
|
||||
|
||||
'''Traffic light'''
|
||||
class Traffic_LED(Base):
|
||||
_addrs = [0x48, 0x49, 0x4A, 0x4B]
|
||||
|
||||
def led(self, naddr=0, num=0, value=0):
|
||||
'''交通灯参数 value: 0,全灭 1,长亮 -1,闪烁(1hz)'''
|
||||
try:
|
||||
if value == 0:
|
||||
self._i2c.write_device(self._addrs[naddr], 0xA0, 0x00)
|
||||
elif value == 1:
|
||||
self._i2c.write_device(self._addrs[naddr], 0xA0, 0x04 >> num)
|
||||
elif value == -1:
|
||||
self._i2c.write_device(self._addrs[naddr], 0xA0, 0x40 >> num)
|
||||
except Exception as e:
|
||||
raise RuntimeError("Cannot find a Traffic lights", e)
|
||||
|
||||
'''LED'''
|
||||
class LED(Base):
|
||||
|
||||
def brightness(self, naddr=0, value=None):
|
||||
'''LED灯参数 value: 亮度0~100%, None返回亮度值'''
|
||||
try:
|
||||
if value is None:
|
||||
return self._i2c.read_device(self._addrs[naddr], 0x10)
|
||||
else:
|
||||
value = max(min(value, 100), 0)
|
||||
self._i2c.write_device(self._addrs[naddr], 0xA0, value)
|
||||
|
||||
except Exception as e:
|
||||
raise RuntimeError("Cannot find a LED device", e)
|
||||
|
||||
class W_LED(LED):
|
||||
_addrs = [0x38, 0x39, 0x3A, 0x3B]
|
||||
|
||||
class R_LED(LED):
|
||||
_addrs = [0x3C, 0x3D, 0x3E, 0x3F]
|
||||
|
||||
class Y_LED(LED):
|
||||
_addrs = [0x40, 0x41, 0x42, 0x43]
|
||||
|
||||
class G_LED(LED):
|
||||
_addrs = [0x44, 0x45, 0x46, 0x47]
|
||||
|
||||
class B_LED(LED):
|
||||
_addrs = [0x78, 0x79, 0x7A, 0x7B]
|
||||
|
||||
'''button*5'''
|
||||
class Buttonx5(Base):
|
||||
_addrs = [0x68, 0x69, 0x6A, 0x6B]
|
||||
|
||||
def value(self, naddr=0):
|
||||
'''十字按键返回 (上,下,左,右,中)/bool'''
|
||||
try:
|
||||
flag = self._i2c.read_device(self._addrs[naddr], 0x10)
|
||||
return bool(flag >> 4 & 1), bool(flag >> 3 & 1), bool(flag >> 2 & 1), bool(flag >> 1 & 1), bool(flag & 1)
|
||||
except Exception as e:
|
||||
raise RuntimeError("Cannot find a Button sensor", e)
|
||||
|
||||
'''button*1'''
|
||||
class Button(Base):
|
||||
_addrs = [0x54, 0x55, 0x56, 0x57]
|
||||
|
||||
def value(self, naddr=0):
|
||||
'''触碰传感器返回 数值/bool'''
|
||||
try:
|
||||
return bool(self._i2c.read_device(self._addrs[naddr], 0x10))
|
||||
except Exception as e:
|
||||
raise RuntimeError("Cannot find a Touch sensor", e)
|
||||
|
||||
'''Infrared sensor'''
|
||||
class Infrared(Base):
|
||||
_addrs = [0x6C, 0x6D, 0x6E, 0x6F]
|
||||
|
||||
def value(self, naddr=0):
|
||||
'''红外接近返回 数值0~100%'''
|
||||
try:
|
||||
return self._i2c.read_device(self._addrs[naddr], 0x10)
|
||||
except Exception as e:
|
||||
raise RuntimeError("Cannot find a Infrared sensor", e)
|
||||
|
||||
'''ultrasonic sensor'''
|
||||
class Sonar(Base):
|
||||
_addrs = [0x24, 0x25, 0x26, 0x27]
|
||||
_state = 0x00
|
||||
def value(self, naddr=0):
|
||||
'''超声波测距返回 距离数值cm'''
|
||||
try:
|
||||
value = self._i2c.read_device(self._addrs[naddr], 0x10, 2)
|
||||
return value[0] << 8 | value[1]
|
||||
except Exception as e:
|
||||
raise RuntimeError("Cannot find a Ultrasonic sensor", e)
|
||||
|
||||
def led(self, naddr=0, num=0, value=0):
|
||||
'''超声波指示灯参数 num:序号0~3,value:0灭,1亮,-1反转 '''
|
||||
try:
|
||||
if value > 0:
|
||||
self._state |= 1 << num
|
||||
elif value < 0:
|
||||
self._state ^= 1 << num
|
||||
else:
|
||||
self._state &= ~ (1 << num)
|
||||
self._i2c.write_device(self._addrs[naddr], 0xA0, bytearray([self._state & 0xff, 0x00]))
|
||||
except Exception as e:
|
||||
raise RuntimeError("Cannot find a Ultrasonic sensor", e)
|
||||
|
||||
'''Potentiometer'''
|
||||
class Dimmer(Base):
|
||||
_addrs = [0x2C, 0x2D, 0x2E, 0x2F]
|
||||
|
||||
def value(self, naddr=0):
|
||||
'''旋钮传感器返回 数值0~100%'''
|
||||
try:
|
||||
return self._i2c.read_device(self._addrs[naddr], 0x10)
|
||||
except Exception as e:
|
||||
raise RuntimeError("Cannot find a Potentiometer", e)
|
||||
|
||||
'''Color sensor'''
|
||||
class Color_ID(Base):
|
||||
_id = ('Black', 'Violet', 'Unknown', 'Blue', 'Cyan', 'Green', 'Unknown', 'Yellow', 'Unknown', 'Red', 'White', 'Unknown')
|
||||
_addrs = [0x20, 0x21, 0x22, 0x23]
|
||||
|
||||
def recognition(self, naddr=0):
|
||||
'''颜色识别返回 (颜色名,(R,G,B),环境亮度0~100,反射亮度0~100)'''
|
||||
try:
|
||||
color = self._i2c.read_device(self._addrs[naddr], 0x10, 6)
|
||||
return self._id[min(color[0],11)], (color[1],color[2],color[3]), color[4], color[5]
|
||||
except Exception as e:
|
||||
raise RuntimeError("Cannot find a Color sensor", e)
|
||||
|
||||
'''Laser Sensor'''
|
||||
class TOF(Base):
|
||||
_addrs = [0x5C, 0x5D, 0x5E, 0x5F]
|
||||
|
||||
def value(self, naddr=0):
|
||||
'''激光测距传感器返回 数值cm'''
|
||||
try:
|
||||
flag = self._i2c.read_device(self._addrs[naddr], 0x10, 2)
|
||||
return (flag[0] << 8 | flag[1]) / 100
|
||||
except Exception as e:
|
||||
raise RuntimeError("Cannot find a Laser Sensor", e)
|
||||
|
||||
def enable(self, naddr=0, en=True):
|
||||
'''激光测距传感器 en:0关闭,1打开'''
|
||||
try:
|
||||
self._i2c.write_device(self._addrs[naddr], 0xA0, int(en) & 0x01)
|
||||
except Exception as e:
|
||||
raise RuntimeError("Cannot find a Laser Sensor", e)
|
||||
|
||||
'''Servo Motor'''
|
||||
class Motor_servo(Base):
|
||||
_addrs = [0x60, 0x61, 0x62, 0x63]
|
||||
_mstop = [0, 0, 0, 0]
|
||||
|
||||
def stop_mode(self, naddr=0, mode=0):
|
||||
'''电机停止模式 mode:0,保持位置 1,惯性滑行 2,阻力制动'''
|
||||
self._mstop[naddr] = mode
|
||||
|
||||
def _write(self, naddr=0, mode=0, value=0, direction=0, angle=0, origin=0, keep=0, select=0):
|
||||
'''寄存器参数设置'''
|
||||
try:
|
||||
_bytes1 = direction<<6 | mode<<5 | select<<4 | origin<<3 | keep<<2 | self._mstop[naddr]
|
||||
_bytes2 = max(min(value, 100), 0)
|
||||
_bytes3 = angle & 0xFF
|
||||
_bytes4 = angle>>8 & 0xFF
|
||||
_bytes5 = angle>>16 & 0xFF
|
||||
self._i2c.write_device(self._addrs[naddr], 0xA0, bytearray([_bytes1, _bytes2, _bytes3, _bytes4, _bytes5]))
|
||||
except Exception as e:
|
||||
raise RuntimeError("Cannot find a Servo Motor", e)
|
||||
|
||||
def absolute_run(self, naddr=0, mode=0, value=50, direction=0, angle=0):
|
||||
''' 绝对角度运行模式(类舵机)
|
||||
运行模式mode 0:速度模式,1:功率模式
|
||||
模式数值value 0~100%
|
||||
转向设置direction 0:顺时针,1:最短路径,2:逆时针
|
||||
旋转角度angle 0~360°
|
||||
'''
|
||||
self._write(naddr=naddr, mode=mode, value=value, direction=direction, angle=angle, select=0)
|
||||
|
||||
def relative_run(self, naddr=0, mode=0, value=50, angle=0):
|
||||
''' 相对角度运行模式(类编码电机)
|
||||
运行模式mode 0:速度模式,1:功率模式
|
||||
模式数值value 0~100%
|
||||
旋转角度angle -8388607~8388607°
|
||||
'''
|
||||
self._write(naddr=naddr, mode=mode, value=value, angle=angle, select=1)
|
||||
|
||||
def relative_origin(self, naddr=0):
|
||||
'''当前位置设置为原点'''
|
||||
self._write(naddr=naddr, origin=1, select=1)
|
||||
|
||||
def relative_continue(self, naddr=0, mode=0, value=50, direction=0):
|
||||
''' 相对角度运行模式(类普通电机)
|
||||
运行模式mode 0:速度模式,1:功率模式
|
||||
模式数值value 0~100%
|
||||
转向设置direction 0:顺时针,2:逆时针
|
||||
'''
|
||||
self._write(naddr=naddr, mode=mode, value=value, direction=direction, keep=1, select=1)
|
||||
|
||||
def stop(self, naddr=0):
|
||||
'''电机停止'''
|
||||
self._write(naddr=naddr, keep=1)
|
||||
|
||||
def state(self,naddr=0):
|
||||
'''运行状态返回 (功率, 速度, 绝对角度, 相对角度, 是否堵住, 是否转完) '''
|
||||
try:
|
||||
_buf = self._i2c.read_device(self._addrs[naddr], 0x10, 7)
|
||||
return _u2s(_buf[0]), _u2s(_buf[1]), (_buf[2] & 0x01)<<8 | _buf[3], _u2s((_buf[4]<<16 | _buf[5]<<8 | _buf[6]),24), bool(_buf[2] & 0x40), bool(_buf[2] & 0x80)
|
||||
except Exception as e:
|
||||
raise RuntimeError("Cannot find a Servo Motor", e)
|
||||
79
boards/default/micropython/build/lib/i2clcd.py
Normal file
79
boards/default/micropython/build/lib/i2clcd.py
Normal file
@@ -0,0 +1,79 @@
|
||||
"""
|
||||
LCD1602、LCD2004_I2C
|
||||
|
||||
Micropython library for the I2C(LCD1602、LCD2004)
|
||||
=======================================================
|
||||
|
||||
#Preliminary composition 20221117
|
||||
|
||||
dahanzimin From the Mixly Team
|
||||
"""
|
||||
from time import sleep_ms
|
||||
from micropython import const
|
||||
|
||||
LCD_DAT = const(0x01) # Mode - Sending data
|
||||
LCD_CMD = const(0x00) # Mode - Sending command
|
||||
LCD_LINES = (0x80, 0xC0, 0x94, 0xD4)
|
||||
|
||||
class LCD():
|
||||
def __init__(self, i2c_bus, i2c_addr=0x27, lcd_width=16):
|
||||
self._device = i2c_bus
|
||||
self._address = i2c_addr
|
||||
self._lcd_width = lcd_width
|
||||
self._backlight = True
|
||||
self._last_data = 0x00
|
||||
|
||||
for i in [0x30, 0x30, 0x30,0x20]:
|
||||
self._i2c_write(i)
|
||||
sleep_ms(1)
|
||||
for i in [0x28, 0x0C, 0x06]:
|
||||
self.write_byte(i , LCD_CMD)
|
||||
self.clear()
|
||||
|
||||
def _i2c_write(self, data , pulse_en=True):
|
||||
"""write one byte to I2C bus"""
|
||||
self._last_data = data
|
||||
self._device.writeto(self._address,data.to_bytes(1, 'little'))
|
||||
sleep_ms(0)
|
||||
if pulse_en :
|
||||
self._device.writeto(self._address,(data | 0b00000100).to_bytes(1, 'little'))
|
||||
sleep_ms(0)
|
||||
self._device.writeto(self._address,(data & ~0b00000100).to_bytes(1, 'little'))
|
||||
sleep_ms(0)
|
||||
|
||||
def write_byte(self, data, mode):
|
||||
"""write one byte to LCD"""
|
||||
data_H = (data & 0xF0) | self._backlight * 0x08 | mode
|
||||
data_L = ((data << 4) & 0xF0) | self._backlight * 0x08 | mode
|
||||
self._i2c_write(data_H)
|
||||
self._i2c_write(data_L)
|
||||
|
||||
def clear(self):
|
||||
"""Clear the display and reset the cursor position"""
|
||||
self.write_byte(0x01, LCD_CMD)
|
||||
sleep_ms(1)
|
||||
|
||||
def backlight(self, on_off):
|
||||
""" Set whether the LCD backlight is on or off"""
|
||||
self._backlight = on_off & 0x01
|
||||
i2c_data = (self._last_data & 0xF7) + self._backlight * 0x08
|
||||
self._i2c_write(i2c_data,pulse_en=False)
|
||||
|
||||
def shows(self, text, line=0, column=0, center=False):
|
||||
'''Character display'''
|
||||
text = str(text).encode('ascii')
|
||||
column=(self._lcd_width-len(text))//2 if center else column
|
||||
self.write_byte(LCD_LINES[line] + column, LCD_CMD)
|
||||
for b in text:
|
||||
self.write_byte(0x0C+0*0x02+0*0x01, LCD_CMD)
|
||||
self.write_byte(b, LCD_DAT)
|
||||
|
||||
def print(self, text, line=0, column=0, delay=500):
|
||||
'''Print Effect Character Display'''
|
||||
text = str(text).encode('ascii')
|
||||
self.write_byte(LCD_LINES[line] + column, LCD_CMD)
|
||||
for b in text:
|
||||
self.write_byte(0x0C+1*0x02+1*0x01, LCD_CMD)
|
||||
sleep_ms(delay)
|
||||
self.write_byte(b, LCD_DAT)
|
||||
sleep_ms(delay)
|
||||
94
boards/default/micropython/build/lib/icm42670.py
Normal file
94
boards/default/micropython/build/lib/icm42670.py
Normal file
@@ -0,0 +1,94 @@
|
||||
"""
|
||||
ICM42670P
|
||||
|
||||
Micropython library for the ICM42670P(Accelerometer+Gyroscope)
|
||||
=======================================================
|
||||
|
||||
#Preliminary composition 20220716
|
||||
|
||||
dahanzimin From the Mixly Team
|
||||
"""
|
||||
import time
|
||||
from micropython import const
|
||||
|
||||
ICM42670_REG_DEVICE_ID = const(0x00)
|
||||
ICM42670_REG_RESET = const(0x02)
|
||||
ICM42670_REG_DATA = const(0x09)
|
||||
ICM42670_REG_PWR_MGMT0 = const(0x1F)
|
||||
ICM42670_REG_GYRO_CONFIG0 = const(0x20)
|
||||
ICM42670_REG_ACCEL_CONFIG0 = const(0x21)
|
||||
ICM42670_REG_APEX_DATA0 = const(0x31)
|
||||
ICM42670_REG_WHO_AM_I = const(0x75)
|
||||
|
||||
AccRange_16g = 0
|
||||
AccRange_8g = 1
|
||||
AccRange_4g = 2
|
||||
AccRange_2g = 3
|
||||
|
||||
GyrRange_2000dps = 0
|
||||
GyrRange_1000dps = 1
|
||||
GyrRange_500dps = 2
|
||||
GyrRange_250dps = 3
|
||||
|
||||
Acc_Gyr_Odr_1600Hz = 0x05
|
||||
Acc_Gyr_Odr_800Hz = 0x06
|
||||
Acc_Gyr_Odr_400Hz = 0x07
|
||||
Acc_Gyr_Odr_200Hz = 0x08
|
||||
Acc_Gyr_Odr_100Hz = 0x09
|
||||
Acc_Gyr_Odr_50Hz = 0x0A
|
||||
Acc_Gyr_Odr_25Hz = 0x0B
|
||||
Acc_Gyr_Odr_12_5Hz = 0x0C
|
||||
|
||||
class ICM42670:
|
||||
def __init__(self, i2c_bus, addr=0x68, AccRange=AccRange_16g, GyrRange=GyrRange_2000dps, Acc_Gyr_Odr=Acc_Gyr_Odr_100Hz):
|
||||
self._device = i2c_bus
|
||||
self._address = addr
|
||||
if self._chip_id() != 0x67:
|
||||
raise AttributeError("Cannot find a ICM42670")
|
||||
|
||||
self._wreg(ICM42670_REG_RESET,0x10) #Software reset enabled
|
||||
time.sleep(0.1)
|
||||
self._wreg(ICM42670_REG_GYRO_CONFIG0,(GyrRange << 4) | Acc_Gyr_Odr) #Gyr-500HZ/2000dps
|
||||
self._wreg(ICM42670_REG_ACCEL_CONFIG0,(AccRange << 4) | Acc_Gyr_Odr) #ACC-100HZ/16G
|
||||
self._wreg(ICM42670_REG_PWR_MGMT0,0x1E)
|
||||
time.sleep(0.1)
|
||||
self.acc_lsb_div= 2 ** (11 + AccRange)
|
||||
self.gyr_lsb_div= 2 ** (14 + GyrRange)
|
||||
|
||||
def _wreg(self, reg, val):
|
||||
'''Write memory address'''
|
||||
self._device.writeto_mem(self._address,reg,val.to_bytes(1, 'little'))
|
||||
|
||||
def _rreg(self, reg,nbytes=1):
|
||||
'''Read memory address'''
|
||||
return self._device.readfrom_mem(self._address, reg, nbytes)[0] if nbytes<=1 else self._device.readfrom_mem(self._address, reg, nbytes)[0:nbytes]
|
||||
|
||||
def _chip_id(self):
|
||||
return self._rreg(ICM42670_REG_WHO_AM_I)
|
||||
|
||||
def u2s(self,n):
|
||||
return n if n < (1 << 15) else n - (1 << 16)
|
||||
|
||||
def getdata(self):
|
||||
_buffer=self._rreg(ICM42670_REG_DATA,14)
|
||||
tmp= float(self.u2s(_buffer[0]<<8|_buffer[1]))/128+25
|
||||
acc_x=float(self.u2s(_buffer[2]<<8|_buffer[3]))/self.acc_lsb_div
|
||||
acc_y=float(self.u2s(_buffer[4]<<8|_buffer[5]))/self.acc_lsb_div
|
||||
acc_z=float(self.u2s(_buffer[6]<<8|_buffer[7]))/self.acc_lsb_div
|
||||
gyr_x=float(self.u2s(_buffer[8]<<8|_buffer[9]))/self.gyr_lsb_div
|
||||
gyr_y=float(self.u2s(_buffer[10]<<8|_buffer[11]))/self.gyr_lsb_div
|
||||
gyr_z=float(self.u2s(_buffer[12]<<8|_buffer[13]))/self.gyr_lsb_div
|
||||
return (acc_x,acc_y,acc_z),(gyr_x,gyr_y,gyr_z),round(tmp,2)
|
||||
|
||||
def accelerometer(self):
|
||||
return self.getdata()[0]
|
||||
|
||||
def strength(self):
|
||||
from math import sqrt
|
||||
return sqrt(self.accelerometer()[0]**2+self.accelerometer()[1]**2+self.accelerometer()[2]**2)
|
||||
|
||||
def gyroscope(self):
|
||||
return self.getdata()[1]
|
||||
|
||||
def temperature(self):
|
||||
return self.getdata()[2]
|
||||
16
boards/default/micropython/build/lib/informatio_picture.py
Normal file
16
boards/default/micropython/build/lib/informatio_picture.py
Normal file
@@ -0,0 +1,16 @@
|
||||
#Take the picture bytes in informatio_picture.py
|
||||
#--dahanzimin From the Mixly Team
|
||||
|
||||
Accept=b'P4\n89 64\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00p\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x8c\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x01\xa7\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x03y\x80\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x02~`\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x04\xff0\x00\x7f\x00\x00\x00\x00\x00\x00\x00\t\xff\xec\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x1b\xff\xf6\x00\x7f\x00\x00\x00\x00\x00\x00\x007\xff\xfd\x80\x7f\x00\x00\x00\x00\x00\x00\x00o\xff\xff\x80\x7f\x00\x00\x00\x00\x00\x00\x00_\xff\xff\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x9f\xff\xfe\x00\x7f\x00\x00\x00\x00\x00\x00\x01\xbf\xff\xfc\x00\x7f\x00\x00\x00\x00\x00\x00\x03\x7f\xff\xf8\x00\x7f\x00\x00\x00\x00\x00\x00\x06\xff\xff\xf0\x00\x7f\x00\x00\x00\x00\x00\x00\x05\xff\xff\xe0\x00\x7f\x00\x00\x00\x00\x00\x00\x0b\xff\xff\xc0\x00\x7f\x00\x00\x00\x00\x00\x00\x17\xff\xff\x80\x00\x7f\x00\x00\x00\x00\x00\x007\xff\xfe\x00\x00\x7f\x00\x00\x00\x00\x00\x00o\xff\xfc\x00\x00\x7f\x00\x00\x00\x00\x00\x00_\xff\xf8\x00\x00\x7f\x00\x00\x00\x00\x00\x00\xbf\xff\xf0\x00\x00\x7f\x00\x00\x00\x00\x00\x01\x7f\xff\xe0\x00\x00\x7f\x00\x00\x00\x00\x00\x03\x7f\xff\xc0\x00\x00\x7f\x00\x00\x00\x00\x00\x07\xff\xff\x80\x00\x00\x7f\x00\x00\x00\x00\x00\r\xff\xff\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x0b\xff\xfe\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x1f\xff\xfc\x00\x00\x00\x7f\x00\x00\x00\x00\x00/\xff\xf8\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x7f\xff\xf0\x00\x00\x00\x7f\x00\x00\x01\xc0\x00\xff\xff\xe0\x00\x00\x00\x7f\x00\x00\x1e@\x00\xff\xff\xc0\x00\x00\x00\x7f\x00\x01\xeb \x01\xff\xff\x80\x00\x00\x00\x7f\x00\x1e\xff\xa0\x03\xff\xff\x00\x00\x00\x00\x7f\x00w\xff\xb0\x07\xff\xfe\x00\x00\x00\x00\x7f\x00?\xff\x90\x0f\xff\xfc\x00\x00\x00\x00\x7f\x00\x1f\xff\xd0\x0f\xff\xf8\x00\x00\x00\x00\x7f\x00\x1f\xff\xf8\x1f\xff\xf0\x00\x00\x00\x00\x7f\x00\x0f\xff\xe8?\xff\xe0\x00\x00\x00\x00\x7f\x00\x07\xff\xf8\x7f\xff\xc0\x00\x00\x00\x00\x7f\x00\x03\xff\xf4\xff\xff\x80\x00\x00\x00\x00\x7f\x00\x03\xff\xfd\xff\xff\x00\x00\x00\x00\x00\x7f\x00\x01\xff\xff\xff\xfe\x00\x00\x00\x00\x00\x7f\x00\x00\xff\xff\xff\xfc\x00\x00\x00\x00\x00\x7f\x00\x00\x7f\xff\xff\xf8\x00\x00\x00\x00\x00\x7f\x00\x00\x7f\xff\xff\xf0\x00\x00\x00\x00\x00\x7f\x00\x00?\xff\xff\xe0\x00\x00\x00\x00\x00\x7f\x00\x00\x1f\xff\xff\xc0\x00\x00\x00\x00\x00\x7f\x00\x00\x0f\xff\xff\x80\x00\x00\x00\x00\x00\x7f\x00\x00\x07\xff\xff\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x07\xff\xfe\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x03\xff\xf8\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x01\xff\xf0\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\xff\xe0\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\xff\xc0\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x7f\x80\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00?\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x1e\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x1c\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f'
|
||||
Backward=b'P4\n89 64\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x0f\xff\xfc\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x0b\xff\xf4\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x0f\xff\xfc\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x0f\xff\xf4\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x0f\xff\xfc\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x0f\xff\xf4\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x0f\xff\xfc\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x0f\xff\xf4\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x0f\xff\xfc\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x0f\xff\xf4\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x0f\xff\xfc\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x0f\xff\xf4\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x0f\xff\xfc\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x0f\xff\xf4\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x0f\xff\xfc\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x0f\xff\xf4\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x0f\xff\xfc\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x0f\xff\xf4\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x0f\xff\xfc\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x0f\xff\xf4\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x0f\xff\xfc\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x0f\xff\xf4\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x0f\xff\xfc\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x0f\xff\xf4\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x0f\xff\xfc\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x0f\xff\xf4\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x0f\xff\xfc\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x0f\xff\xf4\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x0f\xff\xfc\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x0f\xff\xf4\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x0f\xff\xfc\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x0f\xff\xf4\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x0f\xff\xfc\x00\x00\x00\x00\x7f\x00\x00\x00?\xff\xff\xf7\xfe\x00\x00\x00\x7f\x00\x00\x00?\xff\xff\xfdW\x00\x00\x00\x7f\x00\x00\x00\x1f\xff\xff\xff\xf2\x00\x00\x00\x7f\x00\x00\x00\x1f\xff\xff\xff\xe4\x00\x00\x00\x7f\x00\x00\x00\x0f\xff\xff\xff\xe8\x00\x00\x00\x7f\x00\x00\x00\x07\xff\xff\xff\xd8\x00\x00\x00\x7f\x00\x00\x00\x03\xff\xff\xff\xb0\x00\x00\x00\x7f\x00\x00\x00\x03\xff\xff\xff\xa0\x00\x00\x00\x7f\x00\x00\x00\x01\xff\xff\xff@\x00\x00\x00\x7f\x00\x00\x00\x00\xff\xff\xff\xc0\x00\x00\x00\x7f\x00\x00\x00\x00\x7f\xff\xfe\x80\x00\x00\x00\x7f\x00\x00\x00\x00\x7f\xff\xfd\x00\x00\x00\x00\x7f\x00\x00\x00\x00?\xff\xfe\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x1f\xff\xfe\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x0f\xff\xfc\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x0f\xff\xf8\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x07\xff\xf8\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x03\xff\xf0\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x01\xff\xe0\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x01\xff\xc0\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\xff\xc0\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x7f\x80\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00?\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00>\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x1e\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x0c\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f'
|
||||
Decline=b'P4\n89 64\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x000\x00\x00\x00\x02\x00\x00\x00\x7f\x00\x00\x00x\x00\x00\x00\x05\x00\x00\x00\x7f\x00\x00\x00\xfc\x00\x00\x00\x0f\x80\x00\x00\x7f\x00\x00\x01\xfe\x00\x00\x00\x17\xc0\x00\x00\x7f\x00\x00\x03\xff\x00\x00\x00?\xa0\x00\x00\x7f\x00\x00\x07\xff\x80\x00\x00_\xf0\x00\x00\x7f\x00\x00\x0f\xff\xc0\x00\x00\xff\xe8\x00\x00\x7f\x00\x00\x1f\xff\xe0\x00\x01\x7f\xfc\x00\x00\x7f\x00\x00?\xff\xf0\x00\x03\xff\xfa\x00\x00\x7f\x00\x00\x7f\xff\xf8\x00\x05\xff\xff\x00\x00\x7f\x00\x00\xff\xff\xfc\x00\x0f\xff\xfe\x80\x00\x7f\x00\x01\xff\xff\xfe\x00\x17\xff\xff\xc0\x00\x7f\x00\x01\xff\xff\xff\x00?\xff\xff\xc0\x00\x7f\x00\x00\xff\xff\xff\x80_\xff\xff\x80\x00\x7f\x00\x00\x7f\xff\xff\xc0\xff\xff\xff\x00\x00\x7f\x00\x00?\xff\xff\xe1\x7f\xff\xfe\x00\x00\x7f\x00\x00\x1f\xff\xff\xf3\xff\xff\xfc\x00\x00\x7f\x00\x00\x0f\xff\xff\xfd\xff\xff\xf8\x00\x00\x7f\x00\x00\x07\xff\xff\xff\xff\xff\xf0\x00\x00\x7f\x00\x00\x03\xff\xff\xff\xff\xff\xe0\x00\x00\x7f\x00\x00\x01\xff\xff\xff\xff\xff\xc0\x00\x00\x7f\x00\x00\x00\xff\xff\xff\xff\xff\x80\x00\x00\x7f\x00\x00\x00\x7f\xff\xff\xff\xff\x00\x00\x00\x7f\x00\x00\x00?\xff\xff\xff\xfe\x00\x00\x00\x7f\x00\x00\x00\x1f\xff\xff\xff\xfc\x00\x00\x00\x7f\x00\x00\x00\x0f\xff\xff\xff\xf8\x00\x00\x00\x7f\x00\x00\x00\x07\xff\xff\xff\xf0\x00\x00\x00\x7f\x00\x00\x00\x03\xff\xff\xff\xe0\x00\x00\x00\x7f\x00\x00\x00\x01\xff\xff\xff\xc0\x00\x00\x00\x7f\x00\x00\x00\x00\xff\xff\xff\x80\x00\x00\x00\x7f\x00\x00\x00\x00\xff\xff\xff\xc0\x00\x00\x00\x7f\x00\x00\x00\x01\xff\xff\xff\xe0\x00\x00\x00\x7f\x00\x00\x00\x03\xff\xff\xff\xf0\x00\x00\x00\x7f\x00\x00\x00\x07\xff\xff\xff\xf8\x00\x00\x00\x7f\x00\x00\x00\x0b\xff\xff\xff\xfc\x00\x00\x00\x7f\x00\x00\x00\x1f\xff\xff\xff\xfe\x00\x00\x00\x7f\x00\x00\x00/\xff\xff\xff\xff\x00\x00\x00\x7f\x00\x00\x00\x7f\xff\xff\xff\xff\x80\x00\x00\x7f\x00\x00\x00\xbf\xff\xff\xff\xff\xc0\x00\x00\x7f\x00\x00\x01\xff\xff\xff\xff\xff\xe0\x00\x00\x7f\x00\x00\x02\xff\xff\xff\xff\xff\xf0\x00\x00\x7f\x00\x00\x07\xff\xff\xff\xff\xff\xf8\x00\x00\x7f\x00\x00\x0b\xff\xff\xf7\xff\xff\xfc\x00\x00\x7f\x00\x00\x1f\xff\xff\xe3\xff\xff\xfe\x00\x00\x7f\x00\x00/\xff\xff\xc1\xff\xff\xff\x00\x00\x7f\x00\x00\x7f\xff\xff\x80\xff\xff\xff\x80\x00\x7f\x00\x00\xbf\xff\xff\x00\x7f\xff\xff\xc0\x00\x7f\x00\x01\xff\xff\xfe\x00?\xff\xff\xc0\x00\x7f\x00\x00\xff\xff\xfc\x00\x1f\xff\xff\xc0\x00\x7f\x00\x00\x7f\xff\xf8\x00\x0f\xff\xff\x80\x00\x7f\x00\x00?\xff\xf0\x00\x07\xff\xff\x00\x00\x7f\x00\x00\x1f\xff\xe0\x00\x03\xff\xfe\x00\x00\x7f\x00\x00\x0f\xff\xc0\x00\x01\xff\xfc\x00\x00\x7f\x00\x00\x07\xff\x80\x00\x00\xff\xf8\x00\x00\x7f\x00\x00\x03\xff\x00\x00\x00\x7f\xf0\x00\x00\x7f\x00\x00\x01\xfe\x00\x00\x00?\xe0\x00\x00\x7f\x00\x00\x00\xfc\x00\x00\x00\x1f\xc0\x00\x00\x7f\x00\x00\x00x\x00\x00\x00\x0f\x80\x00\x00\x7f\x00\x00\x000\x00\x00\x00\x07\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f'
|
||||
Forward=b'P4\n89 64\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x1c\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x006\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00+\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00]\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\xdc\x80\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x01\xbe\xc0\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x01\x7f`\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x02\xff\xa0\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x07\xff\x90\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x05\xff\xd8\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x0f\xff\xec\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x17\xff\xf4\x00\x00\x00\x00\x7f\x00\x00\x00\x00?\xff\xf2\x00\x00\x00\x00\x7f\x00\x00\x00\x00?\xff\xfb\x00\x00\x00\x00\x7f\x00\x00\x00\x00_\xff\xfd\x80\x00\x00\x00\x7f\x00\x00\x00\x00\xff\xff\xfe\x80\x00\x00\x00\x7f\x00\x00\x00\x01\xff\xff\xfe@\x00\x00\x00\x7f\x00\x00\x00\x01\xff\xff\xff`\x00\x00\x00\x7f\x00\x00\x00\x03\xff\xff\xff\xb0\x00\x00\x00\x7f\x00\x00\x00\x07\xff\xff\xff\xd0\x00\x00\x00\x7f\x00\x00\x00\x07\xff\xff\xff\xc8\x00\x00\x00\x7f\x00\x00\x00\x0f\xff\xff\xff\xec\x00\x00\x00\x7f\x00\x00\x00\x1f\xff\xff\xff\xf4\x00\x00\x00\x7f\x00\x00\x00?\xff\xff\xff\xf2\x00\x00\x00\x7f\x00\x00\x00?\xff\xff\xff\xff\x00\x00\x00\x7f\x00\x00\x00\x00\x1f\xff\xfc\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x0f\xff\xf8\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x0f\xff\xf8\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x0f\xff\xf8\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x0f\xff\xf8\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x0f\xff\xf8\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x0f\xff\xf8\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x0f\xff\xf8\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x0f\xff\xf8\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x0f\xff\xf8\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x0f\xff\xf8\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x0f\xff\xf8\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x0f\xff\xf8\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x0f\xff\xf8\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x0f\xff\xf8\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x0f\xff\xf8\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x0f\xff\xf8\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x0f\xff\xf8\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x0f\xff\xf8\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x0f\xff\xf8\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x0f\xff\xf8\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x0f\xff\xf8\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x0f\xff\xf8\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x0f\xff\xf8\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x0f\xff\xf8\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x0f\xff\xf8\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x0f\xff\xf8\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x0f\xff\xf8\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x0f\xff\xf8\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x0f\xff\xf8\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x0f\xff\xf8\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x0f\xff\xf8\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x0f\xff\xf8\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x0f\xff\xf8\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f'
|
||||
Left=b'P4\n89 64\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x06\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x0e\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x12\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00b\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\xce\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x01>\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x06~\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\r\xfe\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x13\xfe\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00g\xfe\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\xdf\xff\xff\xff\xff\xff\xf0\x00\x7f\x00\x00\x01?\xffUUUUX\x00\x7f\x00\x00\x06\xff\xff\xff\xff\xff\xff\xf8\x00\x7f\x00\x00\r\xff\xff\xff\xff\xff\xff\xe8\x00\x7f\x00\x00\x17\xff\xff\xff\xff\xff\xff\xf8\x00\x7f\x00\x00\x7f\xff\xff\xff\xff\xff\xff\xf8\x00\x7f\x00\x00\xff\xff\xff\xff\xff\xff\xff\xf8\x00\x7f\x00\x01\xff\xff\xff\xff\xff\xff\xff\xf8\x00\x7f\x00\x07\xff\xff\xff\xff\xff\xff\xff\xf8\x00\x7f\x00\x07\xff\xff\xff\xff\xff\xff\xff\xf8\x00\x7f\x00\x01\xff\xff\xff\xff\xff\xff\xff\xf8\x00\x7f\x00\x00\xff\xff\xff\xff\xff\xff\xff\xf8\x00\x7f\x00\x00\x7f\xff\xff\xff\xff\xff\xff\xf8\x00\x7f\x00\x00\x1f\xff\xff\xff\xff\xff\xff\xf8\x00\x7f\x00\x00\x0f\xff\xff\xff\xff\xff\xff\xf8\x00\x7f\x00\x00\x03\xff\xff\xff\xff\xff\xff\xf8\x00\x7f\x00\x00\x01\xff\xff\xff\xff\xff\xff\xf8\x00\x7f\x00\x00\x00\xff\xff\xff\xff\xff\xff\xf0\x00\x7f\x00\x00\x00?\xfe\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x1f\xfe\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x0f\xfe\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x03\xfe\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x01\xfe\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00~\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00>\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x1e\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x06\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f'
|
||||
No_go=b'P4\n89 64\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x01\xff\xe0\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x1f\xfc>\x00\x00\x00\x00\x7f\x00\x00\x00\x00\xff\xff\xc3\x80\x00\x00\x00\x7f\x00\x00\x00\x03\xff\xff\xf8`\x00\x00\x00\x7f\x00\x00\x00\x07\xff\xff\xff\x18\x00\x00\x00\x7f\x00\x00\x00\x1f\xff\xff\xff\xcc\x00\x00\x00\x7f\x00\x00\x00?\xff\xff\xff\xf3\x00\x00\x00\x7f\x00\x00\x00\x7f\xff\xc1\xff\xfd\x80\x00\x00\x7f\x00\x00\x00\xff\xfc\x00\x1f\xfc\xc0\x00\x00\x7f\x00\x00\x01\xff\xf0\x00\x03\xff`\x00\x00\x7f\x00\x00\x03\xff\xc0\x00\x00\xf7\xb0\x00\x00\x7f\x00\x00\x07\xff\x00\x00\x00\x7f\xd0\x00\x00\x7f\x00\x00\x0f\xfe\x00\x00\x00_\xe8\x00\x00\x7f\x00\x00\x0f\xf8\x00\x00\x00\xff\xf4\x00\x00\x7f\x00\x00\x1f\xf0\x00\x00\x01\x7f\xf4\x00\x00\x7f\x00\x00?\xf0\x00\x00\x03\xff\xfa\x00\x00\x7f\x00\x00?\xe0\x00\x00\x05\xff\xfb\x00\x00\x7f\x00\x00\x7f\xc0\x00\x00\x0f\xfd\xfd\x00\x00\x7f\x00\x00\x7f\xc0\x00\x00\x17\xf8\xfd\x00\x00\x7f\x00\x00\x7f\x80\x00\x00?\xf0\xff\x80\x00\x7f\x00\x00\xff\x80\x00\x00_\xe0~\x80\x00\x7f\x00\x00\xff\x00\x00\x00\xff\xc0\x7f\x80\x00\x7f\x00\x00\xff\x00\x00\x01\x7f\x80?@\x00\x7f\x00\x00\xfe\x00\x00\x03\xff\x00?@\x00\x7f\x00\x01\xfe\x00\x00\x05\xfe\x00?@\x00\x7f\x00\x01\xfe\x00\x00\x0f\xfc\x00\x1f\xc0\x00\x7f\x00\x01\xfe\x00\x00\x17\xf8\x00\x1f\xc0\x00\x7f\x00\x01\xfc\x00\x00?\xf0\x00\x1f\xe0\x00\x7f\x00\x01\xfc\x00\x00_\xe0\x00\x1f\xa0\x00\x7f\x00\x01\xfc\x00\x00\xff\xc0\x00\x1f\xe0\x00\x7f\x00\x01\xfc\x00\x01\x7f\x80\x00\x1f\xa0\x00\x7f\x00\x01\xfc\x00\x03\xff\x00\x00\x1f\xe0\x00\x7f\x00\x01\xfe\x00\x05\xfe\x00\x00\x1f\xe0\x00\x7f\x00\x01\xfe\x00\x0f\xfc\x00\x00\x1f\xc0\x00\x7f\x00\x01\xfe\x00\x17\xf8\x00\x00?\xc0\x00\x7f\x00\x01\xfe\x00?\xf0\x00\x00?\xc0\x00\x7f\x00\x00\xff\x00_\xe0\x00\x00?\xc0\x00\x7f\x00\x00\xff\x00\xff\xc0\x00\x00\x7f\xc0\x00\x7f\x00\x00\xff\x01\xff\x80\x00\x00\x7f\x80\x00\x7f\x00\x00\xff\x83\xff\x00\x00\x00\x7f\x80\x00\x7f\x00\x00\x7f\x87\xfe\x00\x00\x00\xff\x80\x00\x7f\x00\x00\x7f\xcf\xfc\x00\x00\x01\xff\x00\x00\x7f\x00\x00?\xff\xf8\x00\x00\x01\xff\x00\x00\x7f\x00\x00?\xff\xf0\x00\x00\x03\xfe\x00\x00\x7f\x00\x00\x1f\xff\xe0\x00\x00\x07\xfe\x00\x00\x7f\x00\x00\x1f\xff\xc0\x00\x00\x07\xfc\x00\x00\x7f\x00\x00\x0f\xff\x80\x00\x00\x1f\xfc\x00\x00\x7f\x00\x00\x07\xff\x00\x00\x00?\xf8\x00\x00\x7f\x00\x00\x07\xff\x80\x00\x00\xff\xf0\x00\x00\x7f\x00\x00\x03\xff\xe0\x00\x01\xff\xe0\x00\x00\x7f\x00\x00\x01\xff\xf8\x00\x0f\xff\xc0\x00\x00\x7f\x00\x00\x00\xff\xff\x00\x7f\xff\x80\x00\x00\x7f\x00\x00\x00\x7f\xff\xff\xff\xff\x00\x00\x00\x7f\x00\x00\x00\x1f\xff\xff\xff\xfe\x00\x00\x00\x7f\x00\x00\x00\x0f\xff\xff\xff\xfc\x00\x00\x00\x7f\x00\x00\x00\x03\xff\xff\xff\xf0\x00\x00\x00\x7f\x00\x00\x00\x01\xff\xff\xff\xc0\x00\x00\x00\x7f\x00\x00\x00\x00?\xff\xff\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x07\xff\xf8\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00?\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f'
|
||||
Question_mark=b'P4\n89 64\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x03\xff\xf0\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x1f\xff\x1e\x00\x00\x00\x00\x7f\x00\x00\x00\x00?\xff\xe3\x80\x00\x00\x00\x7f\x00\x00\x00\x00\xff\xff\xfc\xc0\x00\x00\x00\x7f\x00\x00\x00\x01\xff\xff\xff \x00\x00\x00\x7f\x00\x00\x00\x03\xff\xff\xff\x90\x00\x00\x00\x7f\x00\x00\x00\x07\xff\xff\xff\xc8\x00\x00\x00\x7f\x00\x00\x00\x0f\xff\xff\xff\xe4\x00\x00\x00\x7f\x00\x00\x00\x1f\xff\xf1\xff\xf2\x00\x00\x00\x7f\x00\x00\x00\x1f\xff\x80\x7f\xf9\x00\x00\x00\x7f\x00\x00\x00?\xfe\x00\x1f\xfd\x00\x00\x00\x7f\x00\x00\x00?\xfc\x00\x07\xfd\x80\x00\x00\x7f\x00\x00\x00?\xf8\x00\x07\xfe\x80\x00\x00\x7f\x00\x00\x00\x7f\xf8\x00\x03\xfe\x80\x00\x00\x7f\x00\x00\x00\x7f\xf0\x00\x03\xfe\x80\x00\x00\x7f\x00\x00\x00\x7f\xf0\x00\x01\xfe\x80\x00\x00\x7f\x00\x00\x00\x7f\xf0\x00\x01\xff\x80\x00\x00\x7f\x00\x00\x00\x7f\xe0\x00\x01\xff\x80\x00\x00\x7f\x00\x00\x00\x7f\xe0\x00\x01\xff\x80\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x01\xff\x80\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x03\xff\x80\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x07\xff\x80\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x0f\xff\x80\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x1f\xff\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00?\xfe\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x7f\xfe\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\xff\xfc\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x01\xff\xf8\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x03\xff\xf0\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x07\xff\xe0\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x0f\xff\xc0\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x1f\xff\x80\x00\x00\x00\x7f\x00\x00\x00\x00\x00?\xff\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x7f\xfe\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x7f\xfc\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\xff\xf8\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\xff\xf0\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\xff\xe0\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\xff\xc0\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x01\xff\xc0\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x01\xff\x80\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x01\xff\x80\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\xff\x80\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\xfd\x80\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x01\xfe\xc0\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x03\xff@\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x03\xff\xa0\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x03\xff\xe0\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x03\xff\xe0\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x03\xff\xe0\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x03\xff\xc0\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x01\xff\xc0\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x01\xff\x80\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\xff\x80\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00>\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f'
|
||||
Right=b'P4\n89 64\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x000\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00<\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00&\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00;\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00,\xc0\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00?`\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00/\xb0\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00?\xcc\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00/\xf6\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00?\xfb\x00\x00\x00\x7f\x00\x07\xff\xff\xff\xff\xef\xfc\xc0\x00\x00\x7f\x00\x05UUUU_\xff`\x00\x00\x7f\x00\x07\xff\xff\xff\xff\xff\xff\xb0\x00\x00\x7f\x00\x07\xff\xff\xff\xff\xff\xff\xcc\x00\x00\x7f\x00\x07\xff\xff\xff\xff\xff\xff\xf6\x00\x00\x7f\x00\x07\xff\xff\xff\xff\xff\xff\xfb\x00\x00\x7f\x00\x07\xff\xff\xff\xff\xff\xff\xfc\xc0\x00\x7f\x00\x07\xff\xff\xff\xff\xff\xff\xff`\x00\x7f\x00\x07\xff\xff\xff\xff\xff\xff\xff\xb0\x00\x7f\x00\x07\xff\xff\xff\xff\xff\xff\xff\xb0\x00\x7f\x00\x07\xff\xff\xff\xff\xff\xff\xfe`\x00\x7f\x00\x07\xff\xff\xff\xff\xff\xff\xfc\x80\x00\x7f\x00\x07\xff\xff\xff\xff\xff\xff\xfb\x00\x00\x7f\x00\x07\xff\xff\xff\xff\xff\xff\xf6\x00\x00\x7f\x00\x07\xff\xff\xff\xff\xff\xff\xf8\x00\x00\x7f\x00\x07\xff\xff\xff\xff\xff\xff\xb0\x00\x00\x7f\x00\x07\xff\xff\xff\xff\xff\xff`\x00\x00\x7f\x00\x07\xff\xff\xff\xff\xff\xff\x80\x00\x00\x7f\x00\x00\x00\x00\x00\x00?\xff\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00?\xfc\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00?\xf8\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00?\xf0\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00?\xc0\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00?\x80\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00?\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00<\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x008\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x10\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f'
|
||||
Stop_1=b'P4\n89 64\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\xff\xff\xff\x80\x00\x00\x00\x7f\x00\x00\x00\x01\xfc\x00\x00@\x00\x00\x00\x7f\x00\x00\x00\x03\xff\xff\xff \x00\x00\x00\x7f\x00\x00\x00\x07\x80\x00\x00\xd0\x00\x00\x00\x7f\x00\x00\x00\x0f\x00\x00\x00h\x00\x00\x00\x7f\x00\x00\x00\x1e\x7f\xff\xff4\x00\x00\x00\x7f\x00\x00\x00<\xff\xff\xff\x9a\x00\x00\x00\x7f\x00\x00\x00y\xff\xff\xff\xcd\x00\x00\x00\x7f\x00\x00\x00\xf3\xff\xff\xff\xe6\x80\x00\x00\x7f\x00\x00\x01\xe7\xff\xff\xff\xf3@\x00\x00\x7f\x00\x00\x03\xcf\xff\xff\xff\xf9\xa0\x00\x00\x7f\x00\x00\x07\x9f\xff\xff\xff\xfc\xd0\x00\x00\x7f\x00\x00\x0f?\xff\xff\xff\xfeh\x00\x00\x7f\x00\x00\x1e\x7f\xff\xff\xff\xff4\x00\x00\x7f\x00\x00<\xff\xff\xff\xff\xff\x9a\x00\x00\x7f\x00\x00y\xff\xff\xff\xff\xff\xcd\x00\x00\x7f\x00\x00\xf3\xff\xff\xff\xff\xff\xe6\x80\x00\x7f\x00\x01\xe7\xff\xff\xff\xff\xff\xf3@\x00\x7f\x00\x03\xcf\xff\xff\xff\xff\xff\xf9\xa0\x00\x7f\x00\x03\x9f\xff\xff\xff\xff\xff\xfc\xa0\x00\x7f\x00\x03\x9f\xff\xff\xff\xff\xff\xfc\xa0\x00\x7f\x00\x03\x9e\x0f\x00<\x0f\xc0<\xa0\x00\x7f\x00\x03\x9c\x02\x00\x18\x07\x80\x0c\xa0\x00\x7f\x00\x03\x98\x02\x00\x10\x03\x80\x04\xa0\x00\x7f\x00\x03\x90\xe1\xe0\xf1\xe3\x8f\xc4\xa0\x00\x7f\x00\x03\x91\xf7\xf1\xe3\xf1\x8f\xe4\xa0\x00\x7f\x00\x03\x91\xff\xf1\xe3\xf1\x8f\xe0\xa0\x00\x7f\x00\x03\x98\xff\xf1\xc7\xf9\x8f\xe4\xa0\x00\x7f\x00\x03\x98?\xf1\xc7\xf8\x8f\xc4\xa0\x00\x7f\x00\x03\x9c\x0f\xf1\xc7\xf8\x87\x84\xa0\x00\x7f\x00\x03\x9e\x03\xf1\xc7\xf8\x80\x0c\xa0\x00\x7f\x00\x03\x9f\x81\xf1\xc7\xf8\x80\x1c\xa0\x00\x7f\x00\x03\x9f\xe1\xf1\xc7\xf8\x87\xfc\xa0\x00\x7f\x00\x03\x9f\xf1\xf1\xc7\xf8\x87\xfc\xa0\x00\x7f\x00\x03\x9f\xf8\xf1\xe3\xf1\x87\xfc\xa0\x00\x7f\x00\x03\x9f\xf8\xf1\xe3\xf1\x87\xfc\xa0\x00\x7f\x00\x03\x91\xf1\xf1\xe1\xe1\x87\xfc\xa0\x00\x7f\x00\x03\x90\x01\xf1\xf0\xc3\x87\xfc\xa0\x00\x7f\x00\x03\x98\x01\xf1\xf8\x07\x87\xfc\xa0\x00\x7f\x00\x03\x9c\x07\xf1\xfc\x0f\x87\xfc\xa0\x00\x7f\x00\x03\x9f\x1f\xff\xff?\xff\xfc\xa0\x00\x7f\x00\x03\x9f\xff\xff\xff\xff\xff\xfc\xa0\x00\x7f\x00\x03\xcf\xff\xff\xff\xff\xff\xf9\xa0\x00\x7f\x00\x01\xe7\xff\xff\xff\xff\xff\xf3@\x00\x7f\x00\x00\xf3\xff\xff\xff\xff\xff\xe6\x80\x00\x7f\x00\x00y\xff\xff\xff\xff\xff\xcd\x00\x00\x7f\x00\x00<\xff\xff\xff\xff\xff\x9a\x00\x00\x7f\x00\x00\x1e\x7f\xff\xff\xff\xff4\x00\x00\x7f\x00\x00\x0f?\xff\xff\xff\xfeh\x00\x00\x7f\x00\x00\x07\x9f\xff\xff\xff\xfc\xf0\x00\x00\x7f\x00\x00\x03\xcf\xff\xff\xff\xf9\xe0\x00\x00\x7f\x00\x00\x01\xe7\xff\xff\xff\xf3\xc0\x00\x00\x7f\x00\x00\x00\xf3\xff\xff\xff\xe7\x80\x00\x00\x7f\x00\x00\x00y\xff\xff\xff\xcf\x00\x00\x00\x7f\x00\x00\x00<\xff\xff\xff\x9e\x00\x00\x00\x7f\x00\x00\x00\x1e\x7f\xff\xff<\x00\x00\x00\x7f\x00\x00\x00\x0f\x00\x00\x00x\x00\x00\x00\x7f\x00\x00\x00\x07\x80\x00\x00\xf0\x00\x00\x00\x7f\x00\x00\x00\x03\xff\xff\xff\xe0\x00\x00\x00\x7f\x00\x00\x00\x01\xff\xff\xff\xc0\x00\x00\x00\x7f\x00\x00\x00\x00\xff\xff\xff\x80\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f'
|
||||
Stop_2=b'P4\n89 64\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\xff\xff\xff\x80\x00\x00\x00\x7f\x00\x00\x00\x01\xfc\x00\x00@\x00\x00\x00\x7f\x00\x00\x00\x03\xff\xff\xff \x00\x00\x00\x7f\x00\x00\x00\x07\xc0\x00\x00\xd0\x00\x00\x00\x7f\x00\x00\x00\x0f\x00\x00\x00h\x00\x00\x00\x7f\x00\x00\x00\x1e\x00\x00\x004\x00\x00\x00\x7f\x00\x00\x00<\x00\x00\x00\x1a\x00\x00\x00\x7f\x00\x00\x00x\x00\x00\x00\r\x00\x00\x00\x7f\x00\x00\x00\xf0\x00\x00\x00\x06\x80\x00\x00\x7f\x00\x00\x01\xe0\x00\x00\x00\x03@\x00\x00\x7f\x00\x00\x03\xc0\x00\x00\x00\x01\xa0\x00\x00\x7f\x00\x00\x07\x80\x00\x00\x00\x00\xd0\x00\x00\x7f\x00\x00\x0f\x00\x00\x00\x00\x00h\x00\x00\x7f\x00\x00\x1e\x00\x00\x00\x00\x004\x00\x00\x7f\x00\x00<\x00\x00\x00\x00\x00\x1a\x00\x00\x7f\x00\x00x\x00\x00\x00\x00\x00\r\x00\x00\x7f\x00\x00\xf0\x00\x00\x00\x00\x00\x06\x80\x00\x7f\x00\x01\xe0\x00\x00\x00\x00\x00\x03@\x00\x7f\x00\x03\xc0\x00\x00\x00\x00\x00\x01\xa0\x00\x7f\x00\x03\x80\x00\x00\x00\x00\x00\x00\xa0\x00\x7f\x00\x03\x80\x00\x00\x00\x00\x00\x00\xa0\x00\x7f\x00\x03\x81\xf0\xff\xc3\xf0?\xc0\xa0\x00\x7f\x00\x03\x83\xfd\xff\xe7\xf8\x7f\xf0\xa0\x00\x7f\x00\x03\x87\xff\xff\xef\xfc\x7f\xf8\xa0\x00\x7f\x00\x03\x8f\x1e\x1f\x0e\x1cp8\xa0\x00\x7f\x00\x03\x8e\x08\x0e\x1c\x0ep\x1c\xa0\x00\x7f\x00\x03\x8e\x00\x0e\x1c\x0ep\x1c\xa0\x00\x7f\x00\x03\x87\x00\x0e8\x06p\x1c\xa0\x00\x7f\x00\x03\x87\xc0\x0e8\x07p8\xa0\x00\x7f\x00\x03\x83\xf0\x0e8\x07xx\xa0\x00\x7f\x00\x03\x81\xfc\x0e8\x07\x7f\xf0\xa0\x00\x7f\x00\x03\x80~\x0e8\x07\x7f\xe0\xa0\x00\x7f\x00\x03\x80\x1e\x0e8\x07x\x00\xa0\x00\x7f\x00\x03\x80\x0e\x0e8\x07x\x00\xa0\x00\x7f\x00\x03\x80\x07\x0e\x1c\x0ex\x00\xa0\x00\x7f\x00\x03\x80\x07\x0e\x1c\x0ex\x00\xa0\x00\x7f\x00\x03\x8e\x0e\x0e\x1e\x1ex\x00\xa0\x00\x7f\x00\x03\x8f\xfe\x0e\x0f<x\x00\xa0\x00\x7f\x00\x03\x87\xfe\x0e\x07\xf8x\x00\xa0\x00\x7f\x00\x03\x83\xf8\x0e\x03\xf0x\x00\xa0\x00\x7f\x00\x03\x80\xe0\x00\x00\xc0\x00\x00\xa0\x00\x7f\x00\x03\x80\x00\x00\x00\x00\x00\x00\xa0\x00\x7f\x00\x03\xc0\x00\x00\x00\x00\x00\x01\xa0\x00\x7f\x00\x01\xe0\x00\x00\x00\x00\x00\x03@\x00\x7f\x00\x00\xf0\x00\x00\x00\x00\x00\x06\x80\x00\x7f\x00\x00x\x00\x00\x00\x00\x00\r\x00\x00\x7f\x00\x00<\x00\x00\x00\x00\x00\x1a\x00\x00\x7f\x00\x00\x1e\x00\x00\x00\x00\x004\x00\x00\x7f\x00\x00\x0f\x00\x00\x00\x00\x00h\x00\x00\x7f\x00\x00\x07\x80\x00\x00\x00\x00\xf0\x00\x00\x7f\x00\x00\x03\xc0\x00\x00\x00\x01\xe0\x00\x00\x7f\x00\x00\x01\xe0\x00\x00\x00\x03\xc0\x00\x00\x7f\x00\x00\x00\xf0\x00\x00\x00\x07\x80\x00\x00\x7f\x00\x00\x00x\x00\x00\x00\x0f\x00\x00\x00\x7f\x00\x00\x00<\x00\x00\x00\x1e\x00\x00\x00\x7f\x00\x00\x00\x1e\x00\x00\x00<\x00\x00\x00\x7f\x00\x00\x00\x0f\x00\x00\x00x\x00\x00\x00\x7f\x00\x00\x00\x07\x80\x00\x00\xf0\x00\x00\x00\x7f\x00\x00\x00\x03\xff\xff\xff\xe0\x00\x00\x00\x7f\x00\x00\x00\x01\xff\xff\xff\xc0\x00\x00\x00\x7f\x00\x00\x00\x00\xff\xff\xff\x80\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f'
|
||||
Thumbs_down=b'P4\n89 64\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x07\xff\xc0\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x0f\xff\xc0\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x0c\x00\xc7\xff\xff\xff\x00\x00\x00\x7f\x00\x00\x0e\xaa\xff\xff\xff\xff\xc0\x00\x00\x7f\x00\x00\rT\xff\xff\xff\xff\xc0\x00\x00\x7f\x00\x00\x0c\xaa\xff\xff\xff\xff\xc0\x00\x00\x7f\x00\x00\r\xfe\xff\xff\xff\xff\xc0\x00\x00\x7f\x00\x00\x0f\xff\xff\xff\xff\xff\xe0\x00\x00\x7f\x00\x00\r\xff\xff\xff\xff\xff\xf0\x00\x00\x7f\x00\x00\x0f\xff\xff\xff\xff\xff\xf8\x00\x00\x7f\x00\x00\r\xff\xff\xff\xff\xff\xf8\x00\x00\x7f\x00\x00\x0f\xff\xff\xff\xff\xff\xf8\x00\x00\x7f\x00\x00\r\xff\xff\xff\xff\xff\xf0\x00\x00\x7f\x00\x00\x0f\xff\xff\xff\xff\xea\xa0\x00\x00\x7f\x00\x00\r\xff\xff\xff\xff\xff\xf8\x00\x00\x7f\x00\x00\x0f\xff\xff\xff\xff\xff\xf8\x00\x00\x7f\x00\x00\r\xff\xff\xff\xff\xff\xf8\x00\x00\x7f\x00\x00\x0f\xff\xff\xff\xff\xff\xf8\x00\x00\x7f\x00\x00\r\xff\xff\xff\xff\xff\xf8\x00\x00\x7f\x00\x00\x0f\xff\xff\xff\xff\xff\xf0\x00\x00\x7f\x00\x00\r\xff\xff\xff\xff\xd5@\x00\x00\x7f\x00\x00\x0f\xff\xff\xff\xff\xff\xf0\x00\x00\x7f\x00\x00\r\xff\xff\xff\xff\xff\xf0\x00\x00\x7f\x00\x00\x0f\xff\xff\xff\xff\xff\xf0\x00\x00\x7f\x00\x00\r\xff\xc1\xff\xff\xff\xf0\x00\x00\x7f\x00\x00\x0e\xaa\xc0\x7f\xff\xff\xe0\x00\x00\x7f\x00\x00\x0f\xff\xc0?\xff\xff\xe0\x00\x00\x7f\x00\x00\x07\xff\x80?\xff\xff\x80\x00\x00\x7f\x00\x00\x00\x00\x00\x1f\xff\xc0\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x0f\xfc\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x07\xfc\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x03\xfc\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x01\xfc\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x01\xfe\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\xfe\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\xff\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00?\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00?\x80\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x1f\x80\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x1f\x80\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x1f\x80\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x1f\x80\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x0f\x80\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x0f\x80\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f'
|
||||
Thumbs_up=b'P4\n89 64\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x0f\x80\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x0f\x80\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x1f\x80\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x1f\x80\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x1f\x80\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x1f\x80\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00?\x80\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00?\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\xff\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\xfe\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x01\xfe\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x01\xfc\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x03\xfc\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x07\xfc\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x0f\xfc\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x1f\xff\xc0\x00\x00\x00\x7f\x00\x00\x00\x00\x00?\xff\xff\x80\x00\x00\x7f\x00\x00\x07\xff\xc0?\xff\xff\xe0\x00\x00\x7f\x00\x00\x0f\xff\xc0\x7f\xff\xff\xe0\x00\x00\x7f\x00\x00\x0c\x00\xc1\xff\xff\xff\xf0\x00\x00\x7f\x00\x00\rT\xff\xff\xff\xff\xf0\x00\x00\x7f\x00\x00\x0c\xaa\xff\xff\xff\xff\xf0\x00\x00\x7f\x00\x00\rT\xff\xff\xff\xff\xf0\x00\x00\x7f\x00\x00\r\xfe\xff\xff\xff\xea\xa0\x00\x00\x7f\x00\x00\x0f\xff\xff\xff\xff\xff\xf0\x00\x00\x7f\x00\x00\r\xff\xff\xff\xff\xff\xf8\x00\x00\x7f\x00\x00\x0f\xff\xff\xff\xff\xff\xf8\x00\x00\x7f\x00\x00\r\xff\xff\xff\xff\xff\xf8\x00\x00\x7f\x00\x00\x0f\xff\xff\xff\xff\xff\xf8\x00\x00\x7f\x00\x00\r\xff\xff\xff\xff\xff\xf8\x00\x00\x7f\x00\x00\x0f\xff\xff\xff\xff\xea\xa0\x00\x00\x7f\x00\x00\r\xff\xff\xff\xff\xff\xf0\x00\x00\x7f\x00\x00\x0f\xff\xff\xff\xff\xff\xf8\x00\x00\x7f\x00\x00\r\xff\xff\xff\xff\xff\xf8\x00\x00\x7f\x00\x00\x0f\xff\xff\xff\xff\xff\xf8\x00\x00\x7f\x00\x00\r\xff\xff\xff\xff\xff\xf0\x00\x00\x7f\x00\x00\x0f\xff\xff\xff\xff\xff\xe0\x00\x00\x7f\x00\x00\r\xff\xff\xff\xff\xff\xc0\x00\x00\x7f\x00\x00\x0f\xff\xff\xff\xff\xff\xc0\x00\x00\x7f\x00\x00\r\xff\xff\xff\xff\xff\xc0\x00\x00\x7f\x00\x00\x0f\xff\xff\xff\xff\xff\xc0\x00\x00\x7f\x00\x00\r\xff\xc7\xff\xff\xff\x00\x00\x00\x7f\x00\x00\rT\xc0\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x0f\xff\xc0\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x07\xff\x80\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f'
|
||||
Warning=b'P4\n89 64\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x1e\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x1e\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00=\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00?\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x7f\x80\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\xff@\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\xf3\xc0\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x01\xf3\xa0\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x01\xe1\xf0\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x03\xe1\xd0\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x03\xc0\xf0\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x07\xc0\xe8\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x0f\x80|\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x0f\x80|\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x1f\x00:\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x1f\x00>\x00\x00\x00\x00\x7f\x00\x00\x00\x00>>\x1d\x00\x00\x00\x00\x7f\x00\x00\x00\x00<{\x0f\x00\x00\x00\x00\x7f\x00\x00\x00\x00|y\x0e\x80\x00\x00\x00\x7f\x00\x00\x00\x00\xf8\xfe\x87\xc0\x00\x00\x00\x7f\x00\x00\x00\x00\xf8\xfe\x87\xc0\x00\x00\x00\x7f\x00\x00\x00\x01\xf0\xff\x83\xa0\x00\x00\x00\x7f\x00\x00\x00\x01\xf0\xfe\x83\xe0\x00\x00\x00\x7f\x00\x00\x00\x03\xe0\xff\x81\xd0\x00\x00\x00\x7f\x00\x00\x00\x03\xc0\xff\x80\xf0\x00\x00\x00\x7f\x00\x00\x00\x07\xc0\x7f\x00\xe8\x00\x00\x00\x7f\x00\x00\x00\x0f\x80\x7f\x00|\x00\x00\x00\x7f\x00\x00\x00\x0f\x80\x7f\x00t\x00\x00\x00\x7f\x00\x00\x00\x1f\x00\x7f\x00>\x00\x00\x00\x7f\x00\x00\x00\x1f\x00\x7f\x00>\x00\x00\x00\x7f\x00\x00\x00>\x00\x7f\x00\x1d\x00\x00\x00\x7f\x00\x00\x00>\x00\x7f\x00\x1f\x00\x00\x00\x7f\x00\x00\x00|\x00\x7f\x00\x0e\x80\x00\x00\x7f\x00\x00\x00\xf8\x00\x7f\x00\x07\xc0\x00\x00\x7f\x00\x00\x00\xf8\x00\x7f\x00\x07@\x00\x00\x7f\x00\x00\x01\xf0\x00\x7f\x00\x03\xe0\x00\x00\x7f\x00\x00\x01\xf0\x00\x7f\x00\x03\xe0\x00\x00\x7f\x00\x00\x03\xe0\x00>\x00\x01\xd0\x00\x00\x7f\x00\x00\x03\xe0\x00>\x00\x01\xf0\x00\x00\x7f\x00\x00\x07\xc0\x00>\x00\x00\xe8\x00\x00\x7f\x00\x00\x0f\xc0\x00>\x00\x00\xfc\x00\x00\x7f\x00\x00\x0f\x80\x00\x1c\x00\x00t\x00\x00\x7f\x00\x00\x1f\x00\x00\x00\x00\x00>\x00\x00\x7f\x00\x00\x1f\x00\x00\x00\x00\x00:\x00\x00\x7f\x00\x00>\x00\x00\x00\x00\x00\x1f\x00\x00\x7f\x00\x00>\x00\x00>\x00\x00\x1f\x00\x00\x7f\x00\x00|\x00\x00}\x00\x00\x0e\x80\x00\x7f\x00\x00\xfc\x00\x00~\x80\x00\x0f\xc0\x00\x7f\x00\x00\xf8\x00\x00\x7f\x80\x00\x07@\x00\x7f\x00\x01\xf8\x00\x00\x7f\x80\x00\x07\xe0\x00\x7f\x00\x01\xf0\x00\x00\x7f\x00\x00\x03\xa0\x00\x7f\x00\x03\xe0\x00\x00?\x00\x00\x01\xf0\x00\x7f\x00\x03\xe0\x00\x00\x1e\x00\x00\x01\xf0\x00\x7f\x00\x07\xc0\x00\x00\x00\x00\x00\x00\xe8\x00\x7f\x00\x0f\xc0\x00\x00\x00\x00\x00\x00\xfc\x00\x7f\x00\x0f\x80\x00\x00\x00\x00\x00\x00\xf4\x00\x7f\x00\x1f\xff\xff\xff\xff\xff\xff\xff\xfe\x00\x7f\x00\x1f\xff\xff\xff\xff\xff\xff\xff\xfe\x00\x7f\x00\x1f\xff\xff\xff\xff\xff\xff\xff\xfe\x00\x7f\x00\x07\xff\xff\xff\xff\xff\xff\xff\xf8\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f'
|
||||
229
boards/default/micropython/build/lib/irremote.py
Normal file
229
boards/default/micropython/build/lib/irremote.py
Normal file
@@ -0,0 +1,229 @@
|
||||
"""
|
||||
IR-Remote
|
||||
|
||||
Micropython library for the IR-Remote/Timer(IR_RX&TX)
|
||||
===============================================
|
||||
#Preliminary composition 20240302
|
||||
|
||||
@dahanzimin From the Mixly Team
|
||||
"""
|
||||
import array, time, gc
|
||||
from esp32 import RMT
|
||||
from machine import Pin, Timer
|
||||
|
||||
'''接收部分'''
|
||||
class IR_RX:
|
||||
BADSTART = 'Invalid start pulse'
|
||||
BADDATA = 'Invalid data'
|
||||
def __init__(self, pin, callback=None, timeout=15000, timer_id=1):
|
||||
self._start = 0
|
||||
self._ready = False
|
||||
self._enable = False
|
||||
self._timeout = timeout
|
||||
self._callback = callback
|
||||
self._pulses = array.array('H')
|
||||
self.code = [None, None, None, memoryview(self._pulses)] #存放[cmd, addr, data, pulses]
|
||||
Pin(pin, Pin.IN).irq(handler=self._irq_cb, trigger=(Pin.IRQ_FALLING | Pin.IRQ_RISING))
|
||||
Timer(timer_id).init(period=5, mode=Timer.PERIODIC, callback=self._timer_cb)
|
||||
|
||||
def _irq_cb(self, pin):
|
||||
if not self._enable:
|
||||
_intime = time.ticks_us()
|
||||
if self._start == 0:
|
||||
self._start = _intime
|
||||
return
|
||||
self._pulses.append(time.ticks_diff(_intime, self._start))
|
||||
self._start = _intime
|
||||
else:
|
||||
self._start = 0
|
||||
self._pulses = array.array('H')
|
||||
|
||||
def _timer_cb(self, tim):
|
||||
if len(self._pulses) >= 3 and time.ticks_diff(time.ticks_us(), self._start) > self._timeout:
|
||||
#接收完成,开始解码
|
||||
self.code[3] = memoryview(self._pulses)
|
||||
if self.decode() is None and self._callback:
|
||||
self._callback(self.code[0], self.code[1], self.code[2], self.code[3])
|
||||
self._ready = True
|
||||
self._start = 0
|
||||
self._pulses = array.array('H')
|
||||
gc.collect()
|
||||
|
||||
def recv_cb(self, callback):
|
||||
self._callback = callback
|
||||
|
||||
def timeout(self, timeout=15000):
|
||||
self._timeout = timeout
|
||||
|
||||
def any(self):
|
||||
ready = self._ready
|
||||
self._ready = False
|
||||
return ready
|
||||
|
||||
def enable(self, onoff):
|
||||
self._enable = onoff
|
||||
|
||||
class NEC_RX(IR_RX):
|
||||
def __init__(self, pin, bits=None, callback=None):
|
||||
super().__init__(pin, callback, timeout=15000)
|
||||
self._bits = bits
|
||||
|
||||
def decode(self):
|
||||
pulse_len = len(self._pulses)
|
||||
if pulse_len < 3:
|
||||
print("Warning:", self.BADSTART)
|
||||
return False
|
||||
else:
|
||||
start_i = 0
|
||||
value = 0
|
||||
#跳过帧头(各厂家定义不一)
|
||||
for i in range(pulse_len):
|
||||
if self._pulses[i] <= 2250:
|
||||
start_i = i
|
||||
break
|
||||
val = 1 << ((pulse_len - start_i - 1) // 2) - 1 if (pulse_len - start_i) >= 3 else 0
|
||||
#根据高低脉冲定义转码
|
||||
for edge in range(start_i, pulse_len - 1, 2):
|
||||
value >>= 1
|
||||
if self._pulses[edge + 1] > 1120:
|
||||
value |= val
|
||||
#判读是8、16位解码
|
||||
if self._bits == 8 or self._bits == 16:
|
||||
cmd = value >> 16 & 0xff
|
||||
if cmd != (value >> 24 ^ 0xff) and value != 0x0:
|
||||
print("Warning:", self.BADDATA)
|
||||
return False
|
||||
addr = value & 0xff if self._bits == 8 else value & 0xffff
|
||||
self.code[0:3] = cmd, addr, value
|
||||
#其他未定义直接输出转码
|
||||
else:
|
||||
self.code[0:3] = None, None, value
|
||||
|
||||
class RC5_RX(IR_RX):
|
||||
def __init__(self, pin, callback=None):
|
||||
super().__init__(pin, callback, timeout=15000)
|
||||
|
||||
def decode(self):
|
||||
pulse_len = len(self._pulses)
|
||||
if pulse_len < 3:
|
||||
print("Warning:", self.BADSTART)
|
||||
return False
|
||||
else:
|
||||
bit = 1
|
||||
value = 0
|
||||
num = 0
|
||||
while True:
|
||||
short = self._pulses[num] < 1334
|
||||
if not short:
|
||||
bit ^= 1
|
||||
value <<= 1
|
||||
value |= bit
|
||||
num += 1 + int(short)
|
||||
if num >= pulse_len:
|
||||
value >>= 1
|
||||
break
|
||||
#判读解码
|
||||
cmd = (value & 0x3f) | (0 if ((value >> 12) & 1) else 0x40)
|
||||
addr = (value >> 6) & 0x1f
|
||||
self.code[0:3] = cmd, addr, value
|
||||
|
||||
'''发射部分'''
|
||||
class IR_TX:
|
||||
def __init__(self, pin, cfreq=38000, power=60):
|
||||
self._rmt = RMT(0, pin=Pin(pin), clock_div=80, tx_carrier = (cfreq, round(power * 0.75), 1))
|
||||
self._pulses = array.array('H')
|
||||
self.carrier = False
|
||||
|
||||
def transmit(self, cmd=None, addr=None, toggle=None, pulses=None, raw=None):
|
||||
if pulses is None:
|
||||
self.carrier = False
|
||||
if raw is None:
|
||||
self.tx(cmd, addr, toggle)
|
||||
else:
|
||||
self.tx_raw(raw)
|
||||
self._rmt.write_pulses(tuple(self._pulses))
|
||||
self._pulses = array.array('H')
|
||||
else:
|
||||
self._rmt.write_pulses(tuple(pulses))
|
||||
|
||||
def busy(self):
|
||||
return not self._rmt.wait_done()
|
||||
|
||||
def _append(self, *times):
|
||||
for t in times:
|
||||
self._pulses.append(t)
|
||||
self.carrier = not self.carrier
|
||||
|
||||
def _add(self, t):
|
||||
assert t > 0
|
||||
self._pulses[len(self._pulses)-1] +=t
|
||||
|
||||
class NEC_TX(IR_TX):
|
||||
_TBURST = const(563)
|
||||
_T_ONE = const(1687)
|
||||
def __init__(self, pin, samsung=False, power=60):
|
||||
super().__init__(pin, 38000, power)
|
||||
self._samsung = samsung
|
||||
|
||||
def _bit(self, b):
|
||||
self._append(_TBURST, _T_ONE if b else _TBURST)
|
||||
|
||||
def tx(self, cmd, addr, toggle=0): #cmd:0~0xff, addr:0~0xffff, toggle:0,1
|
||||
if self._samsung:
|
||||
self._append(4500, 4500)
|
||||
else:
|
||||
self._append(9000, 4500)
|
||||
if addr < 256: # Short address: append complement
|
||||
if self._samsung:
|
||||
addr |= addr << 8
|
||||
else:
|
||||
addr |= ((addr ^ 0xff) << 8)
|
||||
for _ in range(16):
|
||||
self._bit(addr & 1)
|
||||
addr >>= 1
|
||||
cmd |= ((cmd ^ 0xff) << 8)
|
||||
for _ in range(16):
|
||||
self._bit(cmd & 1)
|
||||
cmd >>= 1
|
||||
self._append(_TBURST)
|
||||
if toggle == 1:
|
||||
self._append(30000, 9000, 2250, _TBURST)
|
||||
|
||||
def tx_raw(self, raw):
|
||||
self._append(9000, 4500)
|
||||
while raw:
|
||||
self._bit(raw & 1)
|
||||
raw >>= 1
|
||||
self._append(_TBURST)
|
||||
|
||||
class RC5_TX(IR_TX):
|
||||
_T_RC5 = const(889)
|
||||
def __init__(self, pin, power=60):
|
||||
super().__init__(pin, 36000, power)
|
||||
|
||||
def tx(self, cmd, addr, toggle): #cmd:0~0x3f, addr:0~0x1f, toggle:0,1
|
||||
d = (cmd & 0x3f) | ((addr & 0x1f) << 6) | (((cmd & 0x40) ^ 0x40) << 6) | ((toggle & 1) << 11)
|
||||
mask = 0x2000
|
||||
while mask:
|
||||
if mask == 0x2000:
|
||||
self._append(_T_RC5)
|
||||
else:
|
||||
bit = bool(d & mask)
|
||||
if bit ^ self.carrier:
|
||||
self._add(_T_RC5)
|
||||
self._append(_T_RC5)
|
||||
else:
|
||||
self._append(_T_RC5, _T_RC5)
|
||||
mask >>= 1
|
||||
|
||||
def tx_raw(self, raw):
|
||||
self._append(_T_RC5)
|
||||
mask = 1 << len(bin(raw)) - 3
|
||||
while mask:
|
||||
if bool(raw & mask) ^ self.carrier:
|
||||
self._add(_T_RC5)
|
||||
self._append(_T_RC5)
|
||||
else:
|
||||
self._append(_T_RC5, _T_RC5)
|
||||
mask >>= 1
|
||||
self._append(_T_RC5)
|
||||
76
boards/default/micropython/build/lib/ltr308al.py
Normal file
76
boards/default/micropython/build/lib/ltr308al.py
Normal file
@@ -0,0 +1,76 @@
|
||||
"""
|
||||
LTR-308ALS
|
||||
|
||||
Micropython library for the LTR-308ALS
|
||||
=======================================================
|
||||
|
||||
#Changed from circuitpython to micropython 20220211
|
||||
|
||||
dahanzimin From the Mixly Team
|
||||
"""
|
||||
import time
|
||||
from micropython import const
|
||||
|
||||
LTR_308ALS_ADDRESS = const(0x53)
|
||||
|
||||
LTR_308ALS_REG_CTRL = const(0x00)
|
||||
LTR_308ALS_REG_GAIN = const(0x05) #设置增益
|
||||
LTR_308ALS_REG_DEVICE_ID = const(0x06)
|
||||
LTR_308ALS_REG_DATA = const(0x0D)
|
||||
|
||||
#设置增益范围
|
||||
LTR_308ALS_CMD_ALS_Enable = const(0x02)
|
||||
LTR_308ALS_CMD_X1GAIN =const(0x00)
|
||||
LTR_308ALS_CMD_X3GAIN =const(0x01)
|
||||
LTR_308ALS_CMD_X6GAIN =const(0x02)
|
||||
LTR_308ALS_CMD_X9GAIN =const(0x03)
|
||||
LTR_308ALS_CMD_X18GAIN =const(0x04)
|
||||
|
||||
_GAINS = (
|
||||
LTR_308ALS_CMD_X1GAIN, # 1x
|
||||
LTR_308ALS_CMD_X3GAIN, # 3x
|
||||
LTR_308ALS_CMD_X6GAIN, # 6x
|
||||
LTR_308ALS_CMD_X9GAIN, # 9x
|
||||
LTR_308ALS_CMD_X18GAIN # 18x
|
||||
)
|
||||
|
||||
_GAINS_X = (
|
||||
1, # 1x
|
||||
3, # 3x
|
||||
6, # 6x
|
||||
9, # 9x
|
||||
18 # 18x
|
||||
)
|
||||
|
||||
class LTR_308ALS:
|
||||
def __init__(self, i2c_bus,gain=1):
|
||||
self._device = i2c_bus
|
||||
self._address = LTR_308ALS_ADDRESS
|
||||
self._gain = gain
|
||||
|
||||
if self._chip_id() != 0xB1:
|
||||
raise AttributeError("Cannot find a LTR_308ALS")
|
||||
self._Enable() #star
|
||||
time.sleep(0.2)
|
||||
self._wreg(LTR_308ALS_REG_GAIN,_GAINS[self._gain])
|
||||
|
||||
#Write memory address
|
||||
def _wreg(self, reg, val):
|
||||
self._device.writeto_mem(self._address,reg,val.to_bytes(1, 'little'))
|
||||
|
||||
#Read memory address
|
||||
def _rreg(self, reg,nbytes=1):
|
||||
return self._device.readfrom_mem(self._address, reg, nbytes)[0] if nbytes<=1 else self._device.readfrom_mem(self._address, reg, nbytes)[0:nbytes]
|
||||
|
||||
def _chip_id(self):
|
||||
return self._rreg(LTR_308ALS_REG_DEVICE_ID)
|
||||
|
||||
def _Enable(self):
|
||||
self._wreg(LTR_308ALS_REG_CTRL,LTR_308ALS_CMD_ALS_Enable)
|
||||
|
||||
def getdata(self):
|
||||
buffer=self._rreg(LTR_308ALS_REG_DATA,3)
|
||||
als_data= buffer[2]<<16 | buffer[1]<<8| buffer[0]
|
||||
als_lux=float(0.6*als_data/_GAINS_X[self._gain])
|
||||
return als_lux
|
||||
|
||||
78
boards/default/micropython/build/lib/ltr381rgb.py
Normal file
78
boards/default/micropython/build/lib/ltr381rgb.py
Normal file
@@ -0,0 +1,78 @@
|
||||
"""
|
||||
LTR-381RGB-XX
|
||||
|
||||
MicroPython library for the LTR-381RGB-XX (Color sensor)
|
||||
=======================================================
|
||||
|
||||
#Preliminary composition 20230417
|
||||
|
||||
@dahanzimin From the Mixly Team
|
||||
"""
|
||||
import time
|
||||
from micropython import const
|
||||
|
||||
LTR_MAIN_CTRL = const(0x00)
|
||||
LTR_ALS_CS_MEAS_RATE = const(0x04)
|
||||
LTR_ALS_CS_GAIN = const(0x05)
|
||||
LTR_PART_ID = const(0x06)
|
||||
LTR_MAIN_STATUS = const(0x07)
|
||||
LTR_CS_DATA = const(0x0A)
|
||||
#1x 3x 6x 9x 18x
|
||||
_GAINS_X = (1, 3, 6, 9, 18)
|
||||
|
||||
class LTR_381RGB:
|
||||
def __init__(self, i2c_bus, addr=0x53, gain=1):
|
||||
self._device = i2c_bus
|
||||
self._address = addr
|
||||
self._gain = gain
|
||||
self._color = [0, 0, 0]
|
||||
self._ir = 0
|
||||
self._als = 0
|
||||
|
||||
if (self._chip_id() & 0xF0) != 0xC0:
|
||||
raise AttributeError("Cannot find a LTR-381RGB")
|
||||
|
||||
self._configure()
|
||||
time.sleep(0.1)
|
||||
|
||||
def _wreg(self, reg, val):
|
||||
'''Write memory address'''
|
||||
self._device.writeto_mem(self._address,reg,val.to_bytes(1, 'little'))
|
||||
|
||||
def _rreg(self, reg, nbytes=1):
|
||||
'''Read memory address'''
|
||||
return self._device.readfrom_mem(self._address, reg, nbytes)[0] if nbytes<=1 else self._device.readfrom_mem(self._address, reg, nbytes)[0:nbytes]
|
||||
|
||||
def _chip_id(self):
|
||||
'''Proofreading device ID'''
|
||||
return self._rreg(LTR_PART_ID)
|
||||
|
||||
def _configure(self):
|
||||
'''Configuration Register'''
|
||||
self._wreg(LTR_MAIN_CTRL, 0x06) #CS mode & ALS/CS Enable
|
||||
self._wreg(LTR_ALS_CS_MEAS_RATE, 0x22) #Resolution = 18 bit, Meas Rate =100ms
|
||||
self._wreg(LTR_ALS_CS_GAIN, self._gain & 0x07) #CS measurement Gain Range
|
||||
|
||||
def status(self):
|
||||
'''Data conversion status'''
|
||||
return self._rreg(LTR_MAIN_STATUS) & 0x08
|
||||
|
||||
def getdata(self):
|
||||
'''Processing data acquisition'''
|
||||
if self.status():
|
||||
_buf=self._rreg(LTR_CS_DATA, 12)
|
||||
self._ir = _buf[2] << 16 | _buf[1] << 8 | _buf[0]
|
||||
self._color [1] = _buf[5] << 16 | _buf[4] << 8 | _buf[3]
|
||||
self._color [0] = _buf[8] << 16 | _buf[7] << 8 | _buf[6]
|
||||
self._color [2] = _buf[11] << 16 | _buf[10] << 8 | _buf[9]
|
||||
self._als = 0.8 * self._color [1] * (1 - 0.033 * self._ir / self._color [1]) / _GAINS_X[self._gain]
|
||||
return round(self._als, 2), self._ir, self._color
|
||||
|
||||
def color(self):
|
||||
return self.getdata[2]
|
||||
|
||||
def ir(self):
|
||||
return self.getdata[1]
|
||||
|
||||
def als(self):
|
||||
return self.getdata[0]
|
||||
75
boards/default/micropython/build/lib/ltr390uv.py
Normal file
75
boards/default/micropython/build/lib/ltr390uv.py
Normal file
@@ -0,0 +1,75 @@
|
||||
"""
|
||||
LTR-390UV
|
||||
|
||||
Micropython library for the LTR-390UV(ALS+UV)
|
||||
=======================================================
|
||||
|
||||
#Preliminary composition 20240120
|
||||
|
||||
@dahanzimin From the Mixly Team
|
||||
"""
|
||||
import time
|
||||
from micropython import const
|
||||
|
||||
_LTR390_ADDRESS = const(0x53)
|
||||
_LTR390_REG_CTRL = const(0x00)
|
||||
_LTR390_REG_MEAS = const(0x04)
|
||||
_LTR390_REG_GAIN = const(0x05)
|
||||
_LTR390_REG_ID = const(0x06)
|
||||
_LTR390_REG_ALS = const(0x0D)
|
||||
_LTR390_REG_UVS = const(0x10)
|
||||
|
||||
_RATE_DEFAULT = const(0x02) #100ms
|
||||
_RESOLUTION_20BIT = (0<<4, 4)
|
||||
_RESOLUTION_19BIT = (1<<4, 2)
|
||||
_RESOLUTION_18BIT = (2<<4, 1)
|
||||
_RESOLUTION_17BIT = (3<<4, 0.5)
|
||||
_RESOLUTION_16BIT = (4<<4, 0.25)
|
||||
_RESOLUTION_13BIT = (5<<4, 0.125)
|
||||
|
||||
_GAIN_X1 = (0, 1)
|
||||
_GAIN_X3 = (1, 3)
|
||||
_GAIN_X6 = (2, 6)
|
||||
_GAIN_X9 = (3, 9)
|
||||
_GAIN_X18 = (4, 18)
|
||||
|
||||
class ALS_UVS:
|
||||
def __init__(self, i2c_bus, addr=_LTR390_ADDRESS, gain=_GAIN_X1, resolution=_RESOLUTION_17BIT):
|
||||
self._device = i2c_bus
|
||||
self._address = addr
|
||||
self._gain = gain
|
||||
self._reso = resolution
|
||||
self._flaga = False
|
||||
self._flagu = False
|
||||
|
||||
if self._rreg(_LTR390_REG_ID) != 0xB2:
|
||||
raise AttributeError("Cannot find a LTR-390UV")
|
||||
|
||||
self._wreg(_LTR390_REG_MEAS, self._reso[0] | _RATE_DEFAULT)
|
||||
self._wreg(_LTR390_REG_GAIN, self._gain[0])
|
||||
|
||||
def _wreg(self, reg, val):
|
||||
'''Write memory address'''
|
||||
self._device.writeto_mem(self._address,reg,val.to_bytes(1, 'little'))
|
||||
|
||||
def _rreg(self, reg, nbytes=1):
|
||||
'''Read memory address'''
|
||||
return self._device.readfrom_mem(self._address, reg, nbytes)[0] if nbytes<=1 else self._device.readfrom_mem(self._address, reg, nbytes)[0:nbytes]
|
||||
|
||||
def ultraviolet(self):
|
||||
if not self._flagu:
|
||||
self._wreg(_LTR390_REG_CTRL, 0x0A) #UVS in Active Mode
|
||||
time.sleep_ms(int(self._reso[1] * 100))
|
||||
self._flagu = True
|
||||
self._flaga = False
|
||||
buf = self._rreg(_LTR390_REG_UVS, 3)
|
||||
return buf[2] << 16 | buf[1] << 8 | buf[0]
|
||||
|
||||
def ambient_light(self):
|
||||
if not self._flaga:
|
||||
self._wreg(_LTR390_REG_CTRL, 0x02) #ALS in Active Mode
|
||||
time.sleep_ms(int(self._reso[1] * 100))
|
||||
self._flaga = True
|
||||
self._flagu = False
|
||||
buf = self._rreg(_LTR390_REG_ALS, 3)
|
||||
return 0.6 * (buf[2] << 16 | buf[1] << 8 | buf[0]) / (self._gain[1] * self._reso[1])
|
||||
106
boards/default/micropython/build/lib/ltr553als.py
Normal file
106
boards/default/micropython/build/lib/ltr553als.py
Normal file
@@ -0,0 +1,106 @@
|
||||
"""
|
||||
LTR-553ALS-XX
|
||||
|
||||
MicroPython library for the LTR-553ALS-XX(ALS,PS)
|
||||
=======================================================
|
||||
|
||||
#Preliminary composition 20220224
|
||||
#Format unified 20220623
|
||||
|
||||
dahanzimin From the Mixly Team
|
||||
"""
|
||||
|
||||
import time
|
||||
from micropython import const
|
||||
|
||||
LTR_553ALS_ADDRESS = const(0x23)
|
||||
LTR_ALS_REG_CONTR = const(0x80)
|
||||
LTR_PS_REG_CONTR = const(0x81)
|
||||
LTR_PS_REG_LED = const(0x82)
|
||||
LTR_PS_REG_PULSES = const(0x83)
|
||||
LTR_PS_REG_RATE = const(0x84)
|
||||
LTR_ALS_REG_RATE = const(0x85)
|
||||
LTR_553ALS_REG_ID = const(0x87)
|
||||
LTR_ALS_REG_DATA1 = const(0x88)
|
||||
LTR_553ALS_REG_ATATUS = const(0x8C)
|
||||
LTR_PS_REG_DATA1 = const(0x8D)
|
||||
|
||||
_ALS_GAIN={
|
||||
"X1":(1,0x01), # For Gain X1
|
||||
"X2":(2,0x05), # For Gain X2
|
||||
"X4":(4,0x09), # For Gain X4
|
||||
"X8":(8,0x0D), # For Gain X8
|
||||
"X48":(48,0x19), # For Gain X48
|
||||
"X96":(96,0x1D), # For Gain X96
|
||||
}
|
||||
|
||||
class LTR_553ALS:
|
||||
|
||||
def __init__(self, i2c_bus,addr=LTR_553ALS_ADDRESS,ALS_Gain="X1"):
|
||||
self._device = i2c_bus
|
||||
self._address = addr
|
||||
self.ALS_IR = 0
|
||||
self.ALS_VIS = 0
|
||||
self.PS = 0
|
||||
self.ALS_gain = ALS_Gain
|
||||
|
||||
if self._chip_id() != 0x05:
|
||||
raise AttributeError("Cannot find a LTR_553ALS")
|
||||
|
||||
self._configure()
|
||||
#time.sleep(0.1)
|
||||
|
||||
def _wreg(self, reg, val):
|
||||
'''Write memory address'''
|
||||
self._device.writeto_mem(self._address,reg,val.to_bytes(1, 'little'))
|
||||
|
||||
def _rreg(self, reg,nbytes=1):
|
||||
'''Read memory address'''
|
||||
return self._device.readfrom_mem(self._address, reg, nbytes)[0] if nbytes<=1 else self._device.readfrom_mem(self._address, reg, nbytes)[0:nbytes]
|
||||
|
||||
def _chip_id(self):
|
||||
'''校对设备ID'''
|
||||
return self._rreg(LTR_553ALS_REG_ID)
|
||||
|
||||
def _configure(self):
|
||||
'''配置寄存器'''
|
||||
self._wreg(LTR_ALS_REG_CONTR,_ALS_GAIN[self.ALS_gain][1]) # ALS_CONTR: Active mode
|
||||
self._wreg(LTR_PS_REG_CONTR,0x03) # PS_CONTR: Active mode
|
||||
self._wreg(LTR_PS_REG_LED,0x5B) #PS_LED: LED_pulse_period=50khz,DUTY = 100%,LED_pulsed_current_level = 50mA
|
||||
self._wreg(LTR_PS_REG_PULSES,0x0A) #PS_N_Pulses: Number_of_pulses = 10
|
||||
self._wreg(LTR_PS_REG_RATE,0x08) #PS_Measurement_Rate=10ms
|
||||
self._wreg(LTR_ALS_REG_RATE,0x12) #ALS_Measurement_Rate=200ms,ALS_integration_time=200ms
|
||||
|
||||
def _status(self):
|
||||
'''数据转换状态'''
|
||||
status=self._rreg(LTR_553ALS_REG_ATATUS)
|
||||
return status&0x84, status&0x01 #ALS,PS status
|
||||
|
||||
@property
|
||||
def getdata(self):
|
||||
'''处理获取数据'''
|
||||
if self._status()[0]:
|
||||
data_als=self._rreg(LTR_ALS_REG_DATA1,4)
|
||||
als_ch1=data_als[0] | data_als[1]<<8
|
||||
als_ch0=data_als[2] | data_als[3]<<8
|
||||
ratio=als_ch1/(als_ch1+als_ch0) if (als_ch1+als_ch0)>0 else 0
|
||||
self.ALS_IR =als_ch1*ratio/_ALS_GAIN[self.ALS_gain][0]
|
||||
self.ALS_VIS=als_ch0*ratio/_ALS_GAIN[self.ALS_gain][0]
|
||||
|
||||
if self._status()[1]:
|
||||
data_ps=self._rreg(LTR_PS_REG_DATA1,2)
|
||||
self.PS =data_ps[0] | data_ps[1]<<8
|
||||
|
||||
return round(self.ALS_VIS,2),round(self.ALS_IR,2),self.PS
|
||||
|
||||
def als_vis(self):
|
||||
'''可见光Lux'''
|
||||
return self.getdata[0]
|
||||
|
||||
def als_ir(self):
|
||||
'''红外Lux'''
|
||||
return self.getdata[1]
|
||||
|
||||
def ps_nl(self):
|
||||
'''接近距离'''
|
||||
return self.getdata[2]
|
||||
97
boards/default/micropython/build/lib/matcher.py
Normal file
97
boards/default/micropython/build/lib/matcher.py
Normal file
@@ -0,0 +1,97 @@
|
||||
# SPDX-FileCopyrightText: 2017 Yoch <https://github.com/yoch>
|
||||
#
|
||||
# SPDX-License-Identifier: EPL-1.0
|
||||
|
||||
"""
|
||||
`matcher`
|
||||
====================================================================================
|
||||
|
||||
MQTT topic filter matcher from the Eclipse Project's Paho.MQTT.Python
|
||||
https://github.com/eclipse/paho.mqtt.python/blob/master/src/paho/mqtt/matcher.py
|
||||
* Author(s): Yoch (https://github.com/yoch)
|
||||
"""
|
||||
|
||||
|
||||
class MQTTMatcher:
|
||||
"""Intended to manage topic filters including wildcards.
|
||||
|
||||
Internally, MQTTMatcher use a prefix tree (trie) to store
|
||||
values associated with filters, and has an iter_match()
|
||||
method to iterate efficiently over all filters that match
|
||||
some topic name.
|
||||
"""
|
||||
|
||||
# pylint: disable=too-few-public-methods
|
||||
class Node:
|
||||
"""Individual node on the MQTT prefix tree."""
|
||||
|
||||
__slots__ = "children", "content"
|
||||
|
||||
def __init__(self):
|
||||
self.children = {}
|
||||
self.content = None
|
||||
|
||||
def __init__(self):
|
||||
self._root = self.Node()
|
||||
|
||||
def __setitem__(self, key, value):
|
||||
"""Add a topic filter :key to the prefix tree
|
||||
and associate it to :value"""
|
||||
node = self._root
|
||||
for sym in key.split("/"):
|
||||
node = node.children.setdefault(sym, self.Node())
|
||||
node.content = value
|
||||
|
||||
def __getitem__(self, key):
|
||||
"""Retrieve the value associated with some topic filter :key"""
|
||||
try:
|
||||
node = self._root
|
||||
for sym in key.split("/"):
|
||||
node = node.children[sym]
|
||||
if node.content is None:
|
||||
raise KeyError(key)
|
||||
return node.content
|
||||
except KeyError:
|
||||
raise KeyError(key) from None
|
||||
|
||||
def __delitem__(self, key):
|
||||
"""Delete the value associated with some topic filter :key"""
|
||||
lst = []
|
||||
try:
|
||||
parent, node = None, self._root
|
||||
for k in key.split("/"):
|
||||
parent, node = node, node.children[k]
|
||||
lst.append((parent, k, node))
|
||||
node.content = None
|
||||
except KeyError:
|
||||
raise KeyError(key) from None
|
||||
else: # cleanup
|
||||
for parent, k, node in reversed(lst):
|
||||
if node.children or node.content is not None:
|
||||
break
|
||||
del parent.children[k]
|
||||
|
||||
def iter_match(self, topic):
|
||||
"""Return an iterator on all values associated with filters
|
||||
that match the :topic"""
|
||||
lst = topic.split("/")
|
||||
normal = not topic.startswith("$")
|
||||
|
||||
def rec(node, i=0):
|
||||
if i == len(lst):
|
||||
if node.content is not None:
|
||||
yield node.content
|
||||
else:
|
||||
part = lst[i]
|
||||
if part in node.children:
|
||||
for content in rec(node.children[part], i + 1):
|
||||
yield content
|
||||
if "+" in node.children and (normal or i > 0):
|
||||
for content in rec(node.children["+"], i + 1):
|
||||
yield content
|
||||
if "#" in node.children and (normal or i > 0):
|
||||
content = node.children["#"].content
|
||||
if content is not None:
|
||||
yield content
|
||||
|
||||
return rec(self._root)
|
||||
67
boards/default/micropython/build/lib/matrix16x8.py
Normal file
67
boards/default/micropython/build/lib/matrix16x8.py
Normal file
@@ -0,0 +1,67 @@
|
||||
"""
|
||||
Matrix16x8 Displays
|
||||
|
||||
Micropython library for the HT16K33 Matrix16x8 Displays
|
||||
=======================================================
|
||||
|
||||
#Preliminary composition 20230411
|
||||
|
||||
dahanzimin From the Mixly Team
|
||||
"""
|
||||
from ht16k33 import HT16K33
|
||||
|
||||
class Matrix(HT16K33):
|
||||
"""A single matrix."""
|
||||
def __init__(self, i2c, address=0x70, brightness=0.3, font="5x8", width=16, height=8):
|
||||
super().__init__(i2c, address, brightness, width, height)
|
||||
self.font(font)
|
||||
|
||||
"""Graph module"""
|
||||
HEART=b' \x02p\x07\xf8\x0f\xf8\x0f\xf0\x07\xe0\x03\xc0\x01\x80\x00'
|
||||
HEART_SMALL=b'\x00\x00 \x02p\x07\xf0\x07\xe0\x03\xc0\x01\x80\x00\x00\x00'
|
||||
HAPPY=b'\x00\x00\x00\x00\x18\x18\x18\x18\x00\x00 \x04@\x02\x80\x01'
|
||||
SAD=b'\x00\x00\x00\x008\x1c\x04 \x00\x00\x80\x01@\x02 \x04'
|
||||
SMILE=b'\x00\x00\x18\x18$$\x00\x00\x00\x00 \x04@\x02\x80\x01'
|
||||
SILLY=b'\x00\x00\x18\x18$$\x18\x18\x00\x00\xc0\x03@\x02\x80\x01'
|
||||
FABULOUS=b'8\x1cD"|>\x00\x00\x00\x00\xe0\x07 \x04\xc0\x03'
|
||||
SURPRISED=b'\x00\x00\x80\x00\x80\x00\x80\x00\x80\x00\x80\x00\x00\x00\x80\x00'
|
||||
ASLEEP=b'\x00\x00\x00\x00<<\x00\x00\x00\x00\xc0\x03 \x04\xc0\x03'
|
||||
ANGRY=b'D"(\x14\x10\x08\x00\x00\x80\x01@\x02 \x04\x10\x08'
|
||||
CONFUSED=b'\x00\x00\xc0\x01 \x02\x00\x02\x00\x01\x80\x00\x00\x00\x80\x00'
|
||||
NO=b'\x00\x00\x10\x02 \x01\xc0\x00\xc0\x00 \x01\x10\x02\x00\x00'
|
||||
YES=b'\x00\x00\x00\x10\x00\x08\x00\x04\x10\x02 \x01\xc0\x00\x00\x00'
|
||||
LEFT_ARROW=b'\x00\x00 \x00\x10\x00\x08\x00\xf4?\x08\x00\x10\x00 \x00'
|
||||
RIGHT_ARROW=b'\x00\x00\x00\x04\x00\x08\x00\x10\xfc/\x00\x10\x00\x08\x00\x04'
|
||||
DRESS=b' \x02\xf0\x07`\x03\xc0\x01\xa0\x02P\x05\xa8\n\xf0\x07'
|
||||
TRANSFORMERS=b'\x00\x00\x80\x00`\x03\xa0\x02\xa0\x02@\x01@\x01 \x02'
|
||||
SCISSORS=b' \x08`\x0c\xc0\x06\x80\x03\x00\x01\xc0\x06\xa0\n@\x04'
|
||||
EXIT=b'\x00\x0c\x00\x07\x80\x0e@2\x00\x05@\t\x00\x11\x00 '
|
||||
TREE=b'\x80\x00\xc0\x01\xe0\x03\xf0\x07\xf8\x0f\x80\x00\x80\x00\x80\x00'
|
||||
PACMAN=b'\xf0\x03\x18\x04L\x02\x04\x01\x0c\x02\x18\x04\xf0\x03\x00\x00'
|
||||
TARGET=b'\x00\x00\x00\x00\x80\x03@\x04@\x05@\x04\x80\x03\x00\x00'
|
||||
TSHIRT=b' \x04\xd0\x0b\x08\x100\x0c \x04 \x04 \x04\xe0\x07'
|
||||
ROLLERSKATE=b'\xf0\x00\x90\x00\x90\x07\x10\x08\xf0\x0f(\x148\x1c\x00\x00'
|
||||
DUCK=b'\xe0\x00\x90\x01\x08\x01<\x01 \x7f \x10\xe0\x0f'
|
||||
HOUSE=b"\xfc?\x06`\x03\xc0\xe4'$$\xa4$$$$$"
|
||||
TORTOISE=b'\x80\x01\xa0\x05\xe0\x07\xe0\x07\xe0\x07\xc0\x03 \x04\x00\x00'
|
||||
BUTTERFLY=b'\x00\x00`\x0c\x90\x12\xe0\x0f\x80\x03@\x05\xa0\n`\x0c'
|
||||
STICKFIGURE=b'\x80\x00@\x01\x80\x00\xc0\x01\xa0\x02\x80\x00@\x01 \x02'
|
||||
GHOST=b'\xe0\x03\xb0\x06\xb0\x06\xf0\x07\xb0\x06P\x05\xf0\x0f\xf0\x1f'
|
||||
PITCHFORK=b'\x00\xf8\x00\x04\x00\x04\xff\xff\x00\x04\x00\x04\x00\xf8\x00\x00'
|
||||
MUSIC_QUAVERS=b'\x00\x00\x00\x00\x18\x86<O\xf2<a\x18\x00\x00\x00\x00'
|
||||
MUSIC_QUAVER=b'\xfe\x00\x01\x01\xff\x0f\x00\x1e\x00?\x00?\x00>\x00\x1c'
|
||||
MUSIC_CROTCHET=b'\x00\x00\xff\x0f\x00\x1e\x00?\x00?\x00>\x00\x1c\x00\x00'
|
||||
COW=b'\x08\x00\x1e\x00\xfa\x07\xfe\x0f\xfe70F0\x060\x06'
|
||||
RABBIT=b'\xc0?~@\x01Q>\\\x01Q~@\xc0?\x00\x00'
|
||||
SQUARE_SMALL=b'\x00\x00\x00\x00\xc0\x03@\x02@\x02\xc0\x03\x00\x00\x00\x00'
|
||||
SQUARE=b'\xf0\x0f\x10\x08\x10\x08\x10\x08\x10\x08\x10\x08\x10\x08\xf0\x0f'
|
||||
DIAMOND_SMALL=b'\x00\x00\x00\x00\xc0\x01\xa0\x02@\x01\x80\x00\x00\x00\x00\x00'
|
||||
DIAMOND=b'\xf0\x07X\r\xec\x1b\xd8\r\xb0\x06`\x03\xc0\x01\x80\x00'
|
||||
CHESSBOARD=b'\x00\x00\xf8?\xa8*\xf8?\xa8*\xf8?\xa8*\xf8?'
|
||||
TRIANGLE_LEFT=b'\x00\x00\x00\x01\x80\x01\xc0\x01\xe0\x01\xc0\x01\x80\x01\x00\x01'
|
||||
TRIANGLE=b'\x00\x00\x80\x01\xc0\x03\xe0\x07\xf0\x0f\xf8\x1f\xfc?\x00\x00'
|
||||
SNAKE=b'\x00\x0e\x00\n\x00\x0e\xf0\x03\xf8\x03\x1c\x00\x0e\x00\x00\x00'
|
||||
UMBRELLA=b'\x80\x00\xe0\x03\xf0\x07\xf8\x0f\x80\x00\x80\x00\x80\x02\x80\x03'
|
||||
SKULL=b'\xe0\x03\x90\x04\x88\x08x\x0f\xf0\x07 \x02\xa0\x02\xc0\x01'
|
||||
GIRAFFE=b'\x80\x01\x80\x03\x80\x00\x80\x00\x80\x00\xf0\x00\x90\x00\x90\x00'
|
||||
SWORD=b'\x00\x00\x10\x000\x00\xfc\x1f\xfc\x1f0\x00\x10\x00\x00\x00'
|
||||
67
boards/default/micropython/build/lib/matrix32x12.py
Normal file
67
boards/default/micropython/build/lib/matrix32x12.py
Normal file
@@ -0,0 +1,67 @@
|
||||
"""
|
||||
Matrix Displays
|
||||
|
||||
Micropython library for the TM1680 Matrix Displays
|
||||
=======================================================
|
||||
|
||||
#Preliminary composition 20230414
|
||||
|
||||
dahanzimin From the Mixly Team
|
||||
"""
|
||||
from tm1680 import TM1680
|
||||
|
||||
class Matrix(TM1680):
|
||||
"""A single matrix."""
|
||||
def __init__(self, i2c, address=0x72, brightness=0.3, font_address=0x3A0000, width=32, height=12):
|
||||
super().__init__(i2c, address, brightness, width, height)
|
||||
self.font(font_address)
|
||||
|
||||
"""Graph module"""
|
||||
HEART_SMALL=b'\x00\x00\x00\x00\x00\x00\x00\x00\x00 \x02\x00\x00p\x07\x00\x00\xf8\x0f\x00\x00\xf8\x0f\x00\x00\xf0\x07\x00\x00\xe0\x03\x00\x00\xc0\x01\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
|
||||
HEART=b'\x00\x00\x00\x00\x00 \x02\x00\x00p\x07\x00\x00\xf8\x0f\x00\x00\xfc\x1f\x00\x00\xfc\x1f\x00\x00\xf8\x0f\x00\x00\xf0\x07\x00\x00\xe0\x03\x00\x00\xc0\x01\x00\x00\x80\x00\x00\x00\x00\x00\x00'
|
||||
HAPPY=b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04 \x00\x00\x04 \x00\x00\x04 \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x08\x00\x00 \x04\x00\x00@\x02\x00\x00\x80\x01\x00\x00\x00\x00\x00'
|
||||
SAD=b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x1c8\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x01\x00\x00@\x02\x00\x00 \x04\x00\x00\x10\x08\x00\x00\x00\x00\x00'
|
||||
SMILE=b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04 \x00\x00\x0c0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0c0\x00\x008\x1c\x00\x00\xe0\x07\x00\x00\x00\x00\x00'
|
||||
SILLY=b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x04 \x00\x00\x08\x10\x00\x00\x04 \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xe0\x07\x00\x00 \x04\x00\x00@\x02\x00\x00\x80\x01\x00\x00\x00\x00\x00'
|
||||
FABULOUS=b'\x00\x00\x00\x00\x00\x04 \x00\x00\x08\x10\x00\x00\x0c0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf8\x1f\x00\x00\x08\x10\x00\x00\x08\x10\x00\x00\x10\x08\x00\x00\xe0\x07\x00\x00\x00\x00\x00'
|
||||
SURPRISED=b'\x00\x80\x01\x00\x00\x80\x01\x00\x00\x80\x01\x00\x00\x80\x01\x00\x00\x80\x01\x00\x00\x80\x01\x00\x00\x80\x01\x00\x00\x80\x01\x00\x00\x00\x00\x00\x00\x80\x01\x00\x00\x80\x01\x00\x00\x00\x00\x00'
|
||||
ASLEEP=b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x0c0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xe0\x07\x00\x00\x10\x08\x00\x00\xe0\x07\x00\x00\x00\x00\x00'
|
||||
ANGRY=b'\x00\x00\x00\x00\x00 \x04\x00\x00\x10\x08\x00\x00\x08\x10\x00\x00\x04 \x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x01\x00\x00@\x02\x00\x00 \x04\x00\x00\x10\x08\x00\x00\x08\x10\x00'
|
||||
CONFUSED=b'\x00\xc0\x03\x00\x00`\x06\x00\x000\x0c\x00\x000\x0c\x00\x00\x00\x0c\x00\x00\x00\x06\x00\x00\x00\x03\x00\x00\x80\x01\x00\x00\x80\x01\x00\x00\x00\x00\x00\x00\x80\x01\x00\x00\x80\x01\x00'
|
||||
NO=b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x08\x00\x00 \x04\x00\x00@\x02\x00\x00\x80\x01\x00\x00\x80\x01\x00\x00@\x02\x00\x00 \x04\x00\x00\x10\x08\x00\x00\x00\x00\x00\x00\x00\x00\x00'
|
||||
YES=b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x000\x00\x00\x00\x18\x00\x00\x00\x0c\x00\x00\x00\x06\x00\x00\x0c\x03\x00\x00\x98\x01\x00\x00\xf0\x00\x00\x00`\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
|
||||
LEFT_ARROW=b'\x00\x00\x00\x00\x00\x00\x00\x00\x00@\x00\x00\x00 \x00\x00\x00\x10\x00\x00\x00\xe8\x1f\x00\x00\x10\x00\x00\x00 \x00\x00\x00@\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
|
||||
RIGHT_ARROW=b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x04\x00\x00\x00\x08\x00\x00\xf8\x17\x00\x00\x00\x08\x00\x00\x00\x04\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
|
||||
DRESS=b'\x00\x00\x00\x00\x00\x00\x00\x00\x00 \x02\x00\x00\xf0\x07\x00\x00`\x03\x00\x00\xc0\x01\x00\x00\xa0\x02\x00\x00P\x05\x00\x00\xa8\n\x00\x00\xf0\x07\x00\x00\x00\x00\x00\x00\x00\x00\x00'
|
||||
TRANSFORMERS=b'\x00\x00\x00\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\xc0\x06\x00\x00@\x05\x00\x00@\x05\x00\x00@\x05\x00\x00\x80\x02\x00\x00\x80\x02\x00\x00@\x04\x00\x00 \x08\x00\x00\x00\x00\x00'
|
||||
SCISSORS=b'\x00\x00\x00\x00\x00\x04\x10\x00\x00\x0c\x18\x00\x00\x18\x0c\x00\x000\x06\x00\x00`\x03\x00\x00\xc0\x01\x00\x00\x80\x00\x00\x00p\x07\x00\x00H\t\x00\x00H\t\x00\x000\x06\x00'
|
||||
EXIT=b'\x00\x00\x00\x00\x00\x00\x03\x00\x00\x00\x01\x00\x00\xc0\x01\x00\x00\xa0\x03\x00\x00\x90\x0c\x00\x00\x80\x00\x00\x00P\x01\x00\x00@\x02\x00\x00@\x04\x00\x00\x00\x08\x00\x00\x00\x00\x00'
|
||||
TREE=b'\x00\x00\x00\x00\x00\x80\x00\x00\x00\xc0\x01\x00\x00\xe0\x03\x00\x00\xf0\x07\x00\x00\xf8\x0f\x00\x00\xfc\x1f\x00\x00\x80\x00\x00\x00\x80\x00\x00\x00\x80\x00\x00\x00\x80\x00\x00\x00\x00\x00\x00'
|
||||
PACMAN=b'\x00\x00\x00\x00\x00\xf0\x07\x00\x00\x18\x08\x00\x00\x8c\x04\x00\x00\x0c\x02\x00\x00\x04\x01\x00\x00\x0c\x02\x00\x00\x0c\x04\x00\x00\x18\x08\x00\x00\xf0\x07\x00\x00\x00\x00\x00\x00\x00\x00\x00'
|
||||
TARGET=b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc0\x07\x00\x00 \x08\x00\x00 \x08\x00\x00 \t\x00\x00 \x08\x00\x00 \x08\x00\x00\xc0\x07\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
|
||||
TSHIRT=b'\x00@\x04\x00\x00\xa0\x0b\x00\x00\x10\x10\x00\x00\x08 \x00\x000\x18\x00\x00 \x08\x00\x00 \x08\x00\x00 \x08\x00\x00 \x08\x00\x00 \x08\x00\x00\xe0\x0f\x00\x00\x00\x00\x00'
|
||||
ROLLERSKATE=b'\x00\x00\x00\x00\x00\xf8\x00\x00\x00\x88\x00\x00\x00\x88\x00\x00\x00\x88\x0f\x00\x00\x08\x10\x00\x00\x08\x10\x00\x00\xf8\x1f\x00\x00\x14(\x00\x00\x1c8\x00\x00\x00\x00\x00\x00\x00\x00\x00'
|
||||
DUCK=b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\xe0\x00\x00\x00\x90\x00\x00\x00\x08\x01\x00\x00<\x01\x00\x00 ?\x00\x00 \x10\x00\x00 \x08\x00\x00\xe0\x07\x00\x00\x00\x00\x00\x00\x00\x00\x00'
|
||||
HOUSE=b'\x00\x00\x00\x00\x00\xf0\x0f\x00\x00\x18\x18\x00\x00\x0c0\x00\x00\xd0\x0b\x00\x00P\n\x00\x00P\n\x00\x00\xd0\n\x00\x00P\n\x00\x00P\n\x00\x00\x00\x00\x00\x00\x00\x00\x00'
|
||||
TORTOISE=b'\x00\x00\x00\x00\x00\x80\x01\x00\x00\xa0\x05\x00\x00\xe0\x07\x00\x00\xe0\x07\x00\x00\xe0\x07\x00\x00\xe0\x07\x00\x00\xe0\x07\x00\x00\xe0\x07\x00\x00\xc0\x03\x00\x00 \x04\x00\x00\x00\x00\x00'
|
||||
BUTTERFLY=b'\x00\x00\x00\x00\x00\x18\x0c\x00\x00$\x12\x00\x00D\x11\x00\x00\xf8\x0f\x00\x00\xc0\x01\x00\x00\xa0\x02\x00\x00\xd0\x05\x00\x00(\n\x00\x00\x18\x0c\x00\x00\x00\x00\x00\x00\x00\x00\x00'
|
||||
STICKFIGURE=b'\x00\x80\x00\x00\x00@\x01\x00\x00@\x01\x00\x00\x80\x00\x00\x00\x80\x00\x00\x00\xc0\x01\x00\x00\xa0\x02\x00\x00\x90\x04\x00\x00@\x01\x00\x00 \x02\x00\x00\x10\x04\x00\x00\x00\x00\x00'
|
||||
GHOST=b'\x00\x00\x00\x00\x00\xe0\x03\x00\x00\xb0\x06\x00\x00\xb0\x06\x00\x00\xb0\x06\x00\x00\xf0\x07\x00\x00\xb0\x06\x00\x00\xb0\x06\x00\x00P\x05\x00\x00\xf0\x0f\x00\x00\xf0\x1f\x00\x00\x00\x00\x00'
|
||||
PITCHFORK=b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00<\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\xfc?\x00\x00\x00\x02\x00\x00\x00\x02\x00\x00\x00<\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
|
||||
MUSIC_QUAVERS=b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x000\x06\x00\x00x\x0f\x00\x00\xe4=\x00\x00\xc0\x18\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
|
||||
MUSIC_QUAVER=b'\x00\x00\x03\x00\x00\x00\x05\x00\x00\x00\x05\x00\x00\x00\x05\x00\x00\x00\x05\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00`\x01\x00\x00\xf0\x01\x00\x00\xf8\x01\x00\x00\xf8\x00\x00\x00p\x00\x00'
|
||||
MUSIC_CROTCHET=b'\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00`\x01\x00\x00\xf0\x01\x00\x00\xf8\x01\x00\x00\xf8\x00\x00\x00p\x00\x00'
|
||||
COW=b'\x00\x00\x00\x00\x00\x00\x00\x00\x00 \x00\x00\x00x\x00\x00\x00\xe8\x0f\x00\x00\xf8\x1f\x00\x00\xf8/\x00\x00`,\x00\x00`\x0c\x00\x00`\x0c\x00\x00`\x0c\x00\x00\x00\x00\x00'
|
||||
RABBIT=b'\x00@\x01\x00\x00\xa0\x02\x00\x00\xa0\x02\x00\x00\xa0\x02\x00\x00\xa0\x02\x00\x000\x06\x00\x00\x10\x04\x00\x00P\x05\x00\x00\x10\x04\x00\x00\x90\x04\x00\x00\xd0\x05\x00\x00\xe0\x03\x00'
|
||||
SQUARE_SMALL=b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc0\x03\x00\x00@\x02\x00\x00@\x02\x00\x00\xc0\x03\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
|
||||
SQUARE=b'\x00\xfc?\x00\x00\x04 \x00\x00\x04 \x00\x00\x04 \x00\x00\x04 \x00\x00\x04 \x00\x00\x04 \x00\x00\x04 \x00\x00\x04 \x00\x00\x04 \x00\x00\x04 \x00\x00\xfc?\x00'
|
||||
DIAMOND_SMALL=b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xc0\x01\x00\x00\xa0\x02\x00\x00@\x01\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
|
||||
DIAMOND=b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\xf0\x07\x00\x00X\r\x00\x00\xec\x1b\x00\x00\xd8\r\x00\x00\xb0\x06\x00\x00`\x03\x00\x00\xc0\x01\x00\x00\x80\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
|
||||
CHESSBOARD=b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\xfc\x1f\x00\x00T\x15\x00\x00\xfc\x1f\x00\x00T\x15\x00\x00\xfc\x1f\x00\x00T\x15\x00\x00\xfc\x1f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
|
||||
TRIANGLE_LEFT=b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x02\x00\x00\x00\x03\x00\x00\x80\x03\x00\x00\xc0\x03\x00\x00\x80\x03\x00\x00\x00\x03\x00\x00\x00\x02\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
|
||||
TRIANGLE=b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x01\x00\x00\xc0\x03\x00\x00\xe0\x07\x00\x00\xf0\x0f\x00\x00\xf8\x1f\x00\x00\xfc?\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
|
||||
SNAKE=b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x008\x00\x00\x00(\x00\x00\x008\x00\x00\xc0\x0f\x00\x00\xe0\x0f\x00\x00p\x00\x00\x008\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
|
||||
UMBRELLA=b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x80\x00\x00\x00\xe0\x03\x00\x00\xf0\x07\x00\x00\xf8\x0f\x00\x00\x80\x00\x00\x00\x80\x00\x00\x00\x80\x00\x00\x00\x80\x02\x00\x00\x00\x01\x00\x00\x00\x00\x00'
|
||||
SKULL=b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\xe0\x03\x00\x00\x90\x04\x00\x00\x88\x08\x00\x00x\x0f\x00\x00\xf0\x07\x00\x00 \x02\x00\x00 \x02\x00\x00\xa0\x02\x00\x00\xc0\x01\x00\x00\x00\x00\x00'
|
||||
GIRAFFE=b'\x00\x00\x03\x00\x00\x00\x07\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\x00\x01\x00\x00\xe0\x01\x00\x00 \x01\x00\x00 \x01\x00\x00 \x01\x00'
|
||||
SWORD=b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x10\x00\x00\x000\x00\x00\x00\xfc\x1f\x00\x00\xfc\x1f\x00\x000\x00\x00\x00\x10\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
|
||||
67
boards/default/micropython/build/lib/matrix8x5.py
Normal file
67
boards/default/micropython/build/lib/matrix8x5.py
Normal file
@@ -0,0 +1,67 @@
|
||||
"""
|
||||
Matrix8x5 Displays
|
||||
|
||||
Micropython library for the TM1652 Matrix8x5 Displays
|
||||
=======================================================
|
||||
|
||||
#Preliminary compositio 20230411
|
||||
|
||||
dahanzimin From the Mixly Team
|
||||
"""
|
||||
from tm1652 import TM1652
|
||||
|
||||
class Matrix(TM1652):
|
||||
"""A single matrix."""
|
||||
def __init__(self, pin, brightness=0.3, font="4x5", width=8, height=5):
|
||||
super().__init__(pin, brightness, width, height)
|
||||
self.font(font)
|
||||
|
||||
"""Graph module 5x8"""
|
||||
HEART = b'\x14>>\x1c\x08'
|
||||
HEART_SMALL = b'\x00\x14\x1c\x08\x00'
|
||||
HAPPY = b'\x00\x14\x00"\x1c'
|
||||
SAD = b'\x00\x14\x00\x1c"'
|
||||
SMILE = b'\x00\x14\x00"\x1c'
|
||||
SILLY = b'"\x00>(8'
|
||||
FABULOUS = b'>6\x00\x14\x1c'
|
||||
SURPRISED = b'\x14\x00\x08\x14\x08'
|
||||
ASLEEP = b'\x006\x00\x1c\x00'
|
||||
ANGRY = b'"\x14\x00>*'
|
||||
CONFUSED = b'\x00\x14\x00\x14*'
|
||||
NO = b'"\x14\x08\x14"'
|
||||
YES = b'\x00 \x10\n\x04'
|
||||
LEFT_ARROW = b'\x08\x04~\x04\x08'
|
||||
RIGHT_ARROW = b'\x10 ~ \x10'
|
||||
DRESS = b'$f<Z\xbd'
|
||||
TRANSFORMERS = b'\x08\x1c*\x14"'
|
||||
SCISSORS = b'&\x16\x08\x16&'
|
||||
EXIT = b'\x08\x1c*\x16 '
|
||||
TREE = b'\x08\x1c>\x08\x08'
|
||||
PACMAN = b'<\x16\x0e\x1e<'
|
||||
TARGET = b'\x08\x1c6\x1c\x08'
|
||||
TSHIRT = b'6>\x1c\x1c\x1c'
|
||||
ROLLERSKATE = b'00>>\x14'
|
||||
DUCK = b'\x0c\x0e<\x1c\x00'
|
||||
HOUSE = b'\x08\x1c>\x1c\x14'
|
||||
TORTOISE = b'\x00\x1c>\x14\x00'
|
||||
BUTTERFLY = b'6>\x08>6'
|
||||
STICKFIGURE = b'\x08>\x08\x14"'
|
||||
GHOST = b'>*>>*'
|
||||
PITCHFORK = b'**>\x08\x08'
|
||||
MUSIC_QUAVERS = b'<$$66'
|
||||
MUSIC_QUAVER = b'\x08\x18(\x0e\x0e'
|
||||
MUSIC_CROTCHET = b'\x08\x08\x08\x0e\x0e'
|
||||
COW = b'"">\x1c\x08'
|
||||
RABBIT = b'\n\n\x1e\x16\x1e'
|
||||
SQUARE_SMALL = b'\x00\x1c\x14\x1c\x00'
|
||||
SQUARE = b'>""">'
|
||||
DIAMOND_SMALL = b'\x00\x08\x14\x08\x00'
|
||||
DIAMOND = b'\x08\x14"\x14\x08'
|
||||
CHESSBOARD = b'\x14*\x14*\x14'
|
||||
TRIANGLE_LEFT = b'\x02\x06\n\x12>'
|
||||
TRIANGLE = b'\x00\x08\x14>\x00'
|
||||
SNAKE = b'\x066\x14\x1c\x00'
|
||||
UMBRELLA = b'\x1c>\x08\n\x0c'
|
||||
SKULL = b'\x1c*>\x1c\x1c'
|
||||
GIRAFFE = b'\x06\x04\x04\x1c\x14'
|
||||
SWORD = b'\x08\x08\x08\x1c\x08'
|
||||
291
boards/default/micropython/build/lib/max30102.py
Normal file
291
boards/default/micropython/build/lib/max30102.py
Normal file
@@ -0,0 +1,291 @@
|
||||
"""
|
||||
MAX30102
|
||||
|
||||
MicroPython library for the MAX30102(bmp_and_spo2)
|
||||
=======================================================
|
||||
|
||||
#Preliminary composition 20220723
|
||||
#base on https://github.com/doug-burrell/max30102.git 20220723
|
||||
|
||||
dahanzimin From the Mixly Team
|
||||
"""
|
||||
|
||||
import time
|
||||
from micropython import const
|
||||
|
||||
# Address of each register.
|
||||
REG_INTR_STATUS_1 = const(0x00)
|
||||
REG_INTR_STATUS_2 = const(0x01)
|
||||
REG_INTR_ENABLE_1 = const(0x02)
|
||||
REG_INTR_ENABLE_2 = const(0x03)
|
||||
REG_FIFO_WR_PTR = const(0x04)
|
||||
REG_OVF_COUNTER = const(0x05)
|
||||
REG_FIFO_RD_PTR = const(0x06)
|
||||
REG_FIFO_DATA = const(0x07)
|
||||
REG_FIFO_CONFIG = const(0x08)
|
||||
REG_MODE_CONFIG = const(0x09)
|
||||
REG_SPO2_CONFIG = const(0x0A)
|
||||
REG_LED1_PA = const(0x0C)
|
||||
REG_LED2_PA = const(0x0D)
|
||||
REG_PILOT_PA = const(0x10)
|
||||
REG_MULTI_LED_CTRL1 = const(0x11)
|
||||
REG_MULTI_LED_CTRL2 = const(0x12)
|
||||
REG_TEMP_INTR = const(0x1F)
|
||||
REG_TEMP_FRAC = const(0x20)
|
||||
REG_TEMP_CONFIG = const(0x21)
|
||||
REG_PART_ID = const(0xFF)
|
||||
|
||||
class MAX30102:
|
||||
def __init__(self, i2c, address=0x57):
|
||||
"""Initiate MAX30102 class ond each function responsible for correct device start-up"""
|
||||
self._device = i2c
|
||||
self._address = address
|
||||
|
||||
if self._chip_id() != 0x15:
|
||||
raise AttributeError("Cannot find a MAX30102")
|
||||
|
||||
self.reset()
|
||||
time.sleep(1)
|
||||
self.setup()
|
||||
|
||||
def _wreg(self, reg, val):
|
||||
'''Write memory address'''
|
||||
self._device.writeto_mem(self._address,reg,val.to_bytes(1, 'little'))
|
||||
|
||||
def _rreg(self, reg,nbytes=1):
|
||||
'''Read memory address'''
|
||||
return self._device.readfrom_mem(self._address, reg, nbytes)[0] if nbytes<=1 else self._device.readfrom_mem(self._address, reg, nbytes)[0:nbytes]
|
||||
|
||||
def _chip_id(self):
|
||||
return self._rreg(REG_PART_ID)
|
||||
|
||||
def reset(self):
|
||||
"""Set default values of all registers"""
|
||||
self._wreg(REG_MODE_CONFIG, 0x40)
|
||||
|
||||
def shutdown(self):
|
||||
"""Shutdown the device"""
|
||||
self._wreg(mode_config, 0x80) # 0b10000000 = 0x80
|
||||
|
||||
def setup(self,led_mode=0x03):
|
||||
"""Set all registers needed to correct work of sensor"""
|
||||
self._wreg(REG_INTR_ENABLE_1, 0xC0) # 0xc0 : A_FULL_EN and PPG_RDY_EN = Interrupt will be triggered when
|
||||
self._wreg(REG_INTR_ENABLE_2, 0x00) # fifo almost full & new fifo data ready
|
||||
|
||||
self._wreg(REG_FIFO_WR_PTR, 0x00) # FIFO_WR_PTR[4:0]
|
||||
self._wreg(REG_OVF_COUNTER, 0x00) # OVF_COUNTER[4:0]
|
||||
self._wreg(REG_FIFO_RD_PTR, 0x00) # FIFO_RD_PTR[4:0]
|
||||
|
||||
self._wreg(REG_FIFO_CONFIG, 0x4F) # sample avg = 4, fifo rollover = false, fifo almost full = 17
|
||||
self._wreg(REG_MODE_CONFIG, led_mode) # 0x02 for read-only, 0x03 for SpO2 mode, 0x07 multimode LED
|
||||
self._wreg(REG_SPO2_CONFIG, 0x27) # SPO2_ADC range = 4096nA, SPO2 sample rate = 100Hz, LED pulse-width = 411uS
|
||||
|
||||
self._wreg(REG_LED1_PA, 0x40) # choose value for ~7mA for LED1
|
||||
self._wreg(REG_LED2_PA, 0x40) # choose value for ~7mA for LED2
|
||||
self._wreg(REG_PILOT_PA, 0x7F) # choose value fro ~25mA for Pilot LED
|
||||
|
||||
def get_data_present(self):
|
||||
read_ptr = self._rreg(REG_FIFO_RD_PTR)
|
||||
write_ptr = self._rreg(REG_FIFO_WR_PTR)
|
||||
if read_ptr == write_ptr:
|
||||
return 0
|
||||
else:
|
||||
num_samples = write_ptr - read_ptr # account for pointer wrap around
|
||||
if num_samples < 0:
|
||||
num_samples += 32
|
||||
return num_samples
|
||||
|
||||
def read_fifo(self):
|
||||
"""This function will read the data register"""
|
||||
reg_INTR1 = self._rreg(REG_INTR_STATUS_1)
|
||||
reg_INTR2 = self._rreg(REG_INTR_STATUS_2)
|
||||
d = self._rreg(REG_FIFO_DATA, 6)
|
||||
|
||||
red_led = (d[0] << 16 | d[1] << 8 | d[2]) & 0x03FFFF
|
||||
ir_led = (d[3] << 16 | d[4] << 8 | d[5]) & 0x03FFFF
|
||||
return ir_led,red_led
|
||||
|
||||
def read_sequential(self, amount=100):
|
||||
"""This function will read the red-led and ir-led `amount` times"""
|
||||
red_buf = []
|
||||
ir_buf = []
|
||||
count = amount
|
||||
while count > 0:
|
||||
num_bytes = self.get_data_present()
|
||||
while num_bytes > 0:
|
||||
ir, red = self.read_fifo()
|
||||
red_buf.append(red)
|
||||
ir_buf.append(ir)
|
||||
num_bytes -= 1
|
||||
count -= 1
|
||||
return ir_buf,red_buf
|
||||
|
||||
def temperature(self):
|
||||
"""Read temperature as sum of integer and fraction value """
|
||||
self._wreg(REG_TEMP_CONFIG, 0x01)
|
||||
status = self._rreg(REG_INTR_STATUS_2)
|
||||
count = 1
|
||||
while status != 2 and count < 5:
|
||||
status = self._rreg(REG_INTR_STATUS_2)
|
||||
count += 1
|
||||
integer = self._rreg(REG_TEMP_INTR)
|
||||
fraction = self._rreg(REG_TEMP_FRAC)
|
||||
return round(integer + fraction * 0.0625,2)
|
||||
|
||||
def heartrate(self,amount=5):
|
||||
bpms = []
|
||||
sop2 = []
|
||||
for _ in range(amount):
|
||||
ir_data, red_data=self.read_sequential()
|
||||
if get_mean(ir_data) < 50000 and get_mean(red_data) < 50000 :
|
||||
return 0,0
|
||||
raw_bpm, valid_bpm, raw_spo2, valid_spo2 = calc_hr_and_spo2(ir_data, red_data)
|
||||
if valid_bpm:
|
||||
bpms.append(raw_bpm)
|
||||
if valid_spo2:
|
||||
sop2.append(raw_spo2)
|
||||
bpms_len=len(bpms)
|
||||
sop2_len=len(sop2)
|
||||
if bpms_len<=2 or sop2_len<=2:
|
||||
return 0,0
|
||||
else:
|
||||
return sum(sorted(bpms)[1:bpms_len-1])//(bpms_len-2),round(sum(sorted(sop2)[1:sop2_len-1])/(sop2_len-2),2)
|
||||
|
||||
"""-----------以下心率算法-----------"""
|
||||
|
||||
SAMPLE_FREQ = 25 # 25 samples per second
|
||||
MA_SIZE = 4
|
||||
BUFFER_SIZE = 100 # sampling frequency * 4
|
||||
|
||||
def get_mean(ls):
|
||||
return sum(ls)/len(ls)
|
||||
|
||||
def calc_hr_and_spo2(ir_data, red_data):
|
||||
ir_mean = int(get_mean(ir_data))
|
||||
x = []
|
||||
for k in ir_data:
|
||||
x.append((k-ir_mean)*-1)
|
||||
for i in range(len(x) - MA_SIZE):
|
||||
x[i] = sum(x[i:i+MA_SIZE]) / MA_SIZE
|
||||
|
||||
n_th = int(get_mean(x))
|
||||
n_th = 30 if n_th < 30 else n_th # min allowed
|
||||
n_th = 60 if n_th > 60 else n_th # max allowed
|
||||
|
||||
ir_valley_locs, n_peaks = find_peaks(x, BUFFER_SIZE, n_th, 4, 15)
|
||||
peak_interval_sum = 0
|
||||
if n_peaks >= 2:
|
||||
for i in range(1, n_peaks):
|
||||
peak_interval_sum += (ir_valley_locs[i] - ir_valley_locs[i-1])
|
||||
peak_interval_sum = int(peak_interval_sum / (n_peaks - 1))
|
||||
hr = int(SAMPLE_FREQ * 60 / peak_interval_sum)
|
||||
hr_valid = True
|
||||
else:
|
||||
hr = -999
|
||||
hr_valid = False
|
||||
|
||||
exact_ir_valley_locs_count = n_peaks
|
||||
for i in range(exact_ir_valley_locs_count):
|
||||
if ir_valley_locs[i] > BUFFER_SIZE:
|
||||
spo2 = -999
|
||||
spo2_valid = False
|
||||
return hr, hr_valid, spo2, spo2_valid
|
||||
i_ratio_count = 0
|
||||
ratio = []
|
||||
# find max between two valley locations
|
||||
red_dc_max_index = -1
|
||||
ir_dc_max_index = -1
|
||||
for k in range(exact_ir_valley_locs_count-1):
|
||||
red_dc_max = -16777216
|
||||
ir_dc_max = -16777216
|
||||
if ir_valley_locs[k+1] - ir_valley_locs[k] > 3:
|
||||
for i in range(ir_valley_locs[k], ir_valley_locs[k+1]):
|
||||
if ir_data[i] > ir_dc_max:
|
||||
ir_dc_max = ir_data[i]
|
||||
ir_dc_max_index = i
|
||||
if red_data[i] > red_dc_max:
|
||||
red_dc_max = red_data[i]
|
||||
red_dc_max_index = i
|
||||
|
||||
red_ac = int((red_data[ir_valley_locs[k+1]] - red_data[ir_valley_locs[k]]) * (red_dc_max_index - ir_valley_locs[k]))
|
||||
red_ac = red_data[ir_valley_locs[k]] + int(red_ac / (ir_valley_locs[k+1] - ir_valley_locs[k]))
|
||||
red_ac = red_data[red_dc_max_index] - red_ac # subtract linear DC components from raw
|
||||
|
||||
ir_ac = int((ir_data[ir_valley_locs[k+1]] - ir_data[ir_valley_locs[k]]) * (ir_dc_max_index - ir_valley_locs[k]))
|
||||
ir_ac = ir_data[ir_valley_locs[k]] + int(ir_ac / (ir_valley_locs[k+1] - ir_valley_locs[k]))
|
||||
ir_ac = ir_data[ir_dc_max_index] - ir_ac # subtract linear DC components from raw
|
||||
|
||||
nume = red_ac * ir_dc_max
|
||||
denom = ir_ac * red_dc_max
|
||||
if (denom > 0 and i_ratio_count < 5) and nume != 0:
|
||||
ratio.append(int(((nume * 100) & 0xffffffff) / denom))
|
||||
i_ratio_count += 1
|
||||
# choose median value since PPG signal may vary from beat to beat
|
||||
ratio = sorted(ratio) # sort to ascending order
|
||||
mid_index = int(i_ratio_count / 2)
|
||||
|
||||
ratio_ave = 0
|
||||
if mid_index > 1:
|
||||
ratio_ave = int((ratio[mid_index-1] + ratio[mid_index])/2)
|
||||
else:
|
||||
if len(ratio) != 0:
|
||||
ratio_ave = ratio[mid_index]
|
||||
|
||||
if ratio_ave > 2 and ratio_ave < 184:
|
||||
# -45.060 * ratioAverage * ratioAverage / 10000 + 30.354 * ratioAverage / 100 + 94.845
|
||||
spo2 = -45.060 * (ratio_ave**2) / 10000.0 + 30.054 * ratio_ave / 100.0 + 94.845
|
||||
spo2_valid = True
|
||||
else:
|
||||
spo2 = -999
|
||||
spo2_valid = False
|
||||
|
||||
return hr, hr_valid, spo2, spo2_valid
|
||||
|
||||
def find_peaks(x, size, min_height, min_dist, max_num):
|
||||
""" Find at most MAX_NUM peaks above MIN_HEIGHT separated by at least MIN_DISTANCE"""
|
||||
ir_valley_locs, n_peaks = find_peaks_above_min_height(x, size, min_height, max_num)
|
||||
ir_valley_locs, n_peaks = remove_close_peaks(n_peaks, ir_valley_locs, x, min_dist)
|
||||
n_peaks = min([n_peaks, max_num])
|
||||
return ir_valley_locs, n_peaks
|
||||
|
||||
def find_peaks_above_min_height(x, size, min_height, max_num):
|
||||
"""Find all peaks above MIN_HEIGHT """
|
||||
i = 0
|
||||
n_peaks = 0
|
||||
ir_valley_locs = [] # [0 for i in range(max_num)]
|
||||
while i < size - 1:
|
||||
if x[i] > min_height and x[i] > x[i-1]: # find the left edge of potential peaks
|
||||
n_width = 1
|
||||
while i + n_width < size - 1 and x[i] == x[i+n_width]: # find flat peaks
|
||||
n_width += 1
|
||||
if x[i] > x[i+n_width] and n_peaks < max_num: # find the right edge of peaks
|
||||
ir_valley_locs.append(i)
|
||||
n_peaks += 1 # original uses post increment
|
||||
i += n_width + 1
|
||||
else:
|
||||
i += n_width
|
||||
else:
|
||||
i += 1
|
||||
|
||||
return ir_valley_locs, n_peaks
|
||||
|
||||
def remove_close_peaks(n_peaks, ir_valley_locs, x, min_dist):
|
||||
""" Remove peaks separated by less than MIN_DISTANCE"""
|
||||
sorted_indices = sorted(ir_valley_locs, key=lambda i: x[i])
|
||||
sorted_indices.reverse()
|
||||
|
||||
i = -1
|
||||
while i < n_peaks:
|
||||
old_n_peaks = n_peaks
|
||||
n_peaks = i + 1
|
||||
j = i + 1
|
||||
while j < old_n_peaks:
|
||||
n_dist = (sorted_indices[j] - sorted_indices[i]) if i != -1 else (sorted_indices[j] + 1) # lag-zero peak of autocorr is at index -1
|
||||
if n_dist > min_dist or n_dist < -1 * min_dist:
|
||||
sorted_indices[n_peaks] = sorted_indices[j]
|
||||
n_peaks += 1 # original uses post increment
|
||||
j += 1
|
||||
i += 1
|
||||
|
||||
sorted_indices[:n_peaks] = sorted(sorted_indices[:n_peaks])
|
||||
return sorted_indices, n_peaks
|
||||
206
boards/default/micropython/build/lib/mixgo_ai.py
Normal file
206
boards/default/micropython/build/lib/mixgo_ai.py
Normal file
@@ -0,0 +1,206 @@
|
||||
"""
|
||||
AI COM
|
||||
|
||||
MicroPython library for the AI COM ( for MixGo AI)
|
||||
=======================================================
|
||||
|
||||
#Preliminary composition 20220905
|
||||
|
||||
dahanzimin From the Mixly Team
|
||||
"""
|
||||
|
||||
import time,gc
|
||||
|
||||
|
||||
class INFO:
|
||||
def __init__(self, info1,info2,rect):
|
||||
self.info1=info1
|
||||
self.info2=info2
|
||||
self.rect=rect
|
||||
self.x=None
|
||||
self.y=None
|
||||
self.w=None
|
||||
self.h=None
|
||||
self.xc=None
|
||||
self.yc=None
|
||||
if type(rect) in [tuple,list]:
|
||||
self.x=rect[0]
|
||||
self.y=rect[1]
|
||||
self.w=rect[2]
|
||||
self.h=rect[3]
|
||||
self.xc=rect[0]+rect[2]//2
|
||||
self.yc=rect[1]+rect[3]//2
|
||||
self.type="info"
|
||||
|
||||
class AI:
|
||||
def __init__(self, uart, quick=False):
|
||||
self._uart=uart
|
||||
self._uart.init(baudrate=115200)
|
||||
self._info=[]
|
||||
self._sdata=[]
|
||||
self._removal=quick
|
||||
if not self._chip_id():
|
||||
raise AttributeError("Cannot find a MixGo AI")
|
||||
|
||||
def send(self,data):
|
||||
eec=0
|
||||
buffer=str(data).encode()
|
||||
for i in range(len(buffer)):
|
||||
eec^=int(buffer[i])
|
||||
eec=0 if eec==10 else eec
|
||||
self._uart.write(buffer+chr(eec)+b'\n')
|
||||
|
||||
def recv(self,timeout=500,warn=True):
|
||||
t_star=time.ticks_ms()
|
||||
while not self._uart.any():
|
||||
if time.ticks_diff(time.ticks_ms(), t_star) >timeout:
|
||||
if warn:
|
||||
print("Warning: MixGo AI timeout not responding")
|
||||
return False
|
||||
buffer = self._uart.readline()
|
||||
if buffer:
|
||||
eec=0
|
||||
if len(buffer)>=3:
|
||||
for i in range(len(buffer)-2):
|
||||
eec^=int(buffer[i])
|
||||
if eec==buffer[-2] or buffer[-2]==0:
|
||||
try:
|
||||
return eval(buffer[:-2].decode())
|
||||
except:
|
||||
return None
|
||||
def _chip_id(self):
|
||||
for _ in range(10):
|
||||
self.send(["ok",[[],'']])
|
||||
if self.recv(1000,False):
|
||||
return True
|
||||
|
||||
def request(self,func='', para=[], name=None, timeout=1000):
|
||||
if self._sdata != para:
|
||||
self._sdata=para if self._removal else None
|
||||
self.send([func,[para,name]])
|
||||
else:
|
||||
self.send([func,[[],name]])
|
||||
|
||||
#print(func)
|
||||
if func in ['ailr','ailt','play','record','asr']: #不需要警告提醒
|
||||
data=self.recv(timeout,False)
|
||||
else:
|
||||
data=self.recv(timeout,True)
|
||||
|
||||
self._info=[]
|
||||
if data:
|
||||
#报错处理
|
||||
if "err" in data[0] and type(data[1])==list:
|
||||
if type(data[1][0]) == IndexError or "Missing parameter" == data[1][0]:
|
||||
self.send(["ok",[[],name]]) #恢复出厂
|
||||
self.send([func,[para,name]]) #在发送参数
|
||||
else:
|
||||
raise RuntimeError("Error from MixGo AI",data[1][0])
|
||||
else:
|
||||
_len=max(len(data[0]),len(data[1]))
|
||||
for i in range(_len):
|
||||
if type(data[0][i]) == list:
|
||||
info1=data[0][i][0]
|
||||
info2=data[0][i][1]
|
||||
else:
|
||||
info1=data[0][i]
|
||||
info2=None
|
||||
|
||||
if data[1]:
|
||||
rect=data[1][i]
|
||||
else:
|
||||
rect=None
|
||||
self._info.append(INFO(info1,info2,rect))
|
||||
return self._info
|
||||
|
||||
def info_len(self):
|
||||
return len(self._info)
|
||||
|
||||
def info_number(self,number):
|
||||
if self.info_len() > number:
|
||||
return self._info[number]
|
||||
|
||||
def configure(self, tx_pin, rx_pin, restart=False):
|
||||
info=self.request('start',para=[["uart",tx_pin,rx_pin],restart])
|
||||
return info[0].info1 if info else False
|
||||
|
||||
def find_qrcode(self):
|
||||
info=self.request('qr')
|
||||
return (info[0].info1,info[0].rect) if info else (None,None)
|
||||
|
||||
def find_barcode(self):
|
||||
info=self.request('bar')
|
||||
return (info[0].info1,info[0].rect) if info else (None,None)
|
||||
|
||||
def find_apriltag(self):
|
||||
info=self.request('tag')
|
||||
return (info[0].info1,info[0].rect) if info else (None,None)
|
||||
|
||||
def find_qrcodes(self):
|
||||
return self.request('qr')
|
||||
|
||||
def find_barcodes(self):
|
||||
return self.request('bar')
|
||||
|
||||
def find_apriltags(self):
|
||||
return self.request('tag')
|
||||
|
||||
def find_lines(self, threshold=2500, theta_margin=25, rho_margin=25):
|
||||
return self.request('line', para=[threshold, theta_margin, rho_margin])
|
||||
|
||||
def find_circles(self, threshold=2500, r_min=2, r_max=100):
|
||||
return self.request('circle', para=[threshold, r_min, r_max])
|
||||
|
||||
def find_rects(self, threshold=2500):
|
||||
return self.request('rect', para=[threshold])
|
||||
|
||||
def find_colors(self, scale=2):
|
||||
info=self.request('color', para=[scale])
|
||||
if info:
|
||||
return info[0].info1,info[0].info2
|
||||
else:
|
||||
return None,None
|
||||
|
||||
def color_track(self, lab=[0, 100, 0, 100, 0, 0], pixels_threshold=10, margin=1):
|
||||
return self.request('ctrace', para=[lab, pixels_threshold, margin])
|
||||
|
||||
def ailocal_train(self, lsit_names, path="mixgo", number=5, disname='自模型训练'):
|
||||
info= self.request('ailt', para=[lsit_names, path, number], name=disname)
|
||||
return info[0].info1 if info else False
|
||||
|
||||
def ailocal_class(self, lsit_names, path="mixgo", disname='自模型识别'):
|
||||
return self.request('ailr', para=[lsit_names, path], name=disname)
|
||||
|
||||
def yolo_recognize(self, anchor, path, disname='物品识别'):
|
||||
return self.request('aild', para=[anchor, path], name=disname)
|
||||
|
||||
def led_rgb(self, rgb1=(0,0,0), rgb2=(0,0,0)):
|
||||
info= self.request('rgb', para=[rgb1, rgb2])
|
||||
return info[0].info1 if info else False
|
||||
|
||||
def audio_play(self, bck_pin=12, ws_pin=13, dat_pin=14, path="mixgo.wav", volume=80):
|
||||
info= self.request('play', para=[[bck_pin, ws_pin, dat_pin], path, volume])
|
||||
return info[0].info1 if info else False
|
||||
|
||||
def audio_record(self, sample_rate=16000, path="mixgo.wav", times=5):
|
||||
info= self.request('record', para=[sample_rate, path, times])
|
||||
return info[0].info1 if info else False
|
||||
|
||||
def asr_recognize(self, corpus,threshold=0.1):
|
||||
clist=[]
|
||||
for cor in corpus:
|
||||
clist.append([cor,threshold])
|
||||
info=self.request('asr', para=[dict(clist)])
|
||||
if info:
|
||||
return info[0].info1,info[0].info2
|
||||
else:
|
||||
return None,None
|
||||
|
||||
def find_licenseplate(self):
|
||||
return self.request('alpr')
|
||||
|
||||
def find_20object(self):
|
||||
return self.request('voc20')
|
||||
|
||||
def face_detect(self):
|
||||
return self.request('face_d')
|
||||
325
boards/default/micropython/build/lib/mixiot.py
Normal file
325
boards/default/micropython/build/lib/mixiot.py
Normal file
@@ -0,0 +1,325 @@
|
||||
import time
|
||||
import usocket as socket
|
||||
import ustruct as struct
|
||||
from machine import unique_id
|
||||
from ubinascii import hexlify
|
||||
from matcher import MQTTMatcher
|
||||
|
||||
ADDITIONAL_TOPIC = 'b640a0ce465fa2a4150c36b305c1c11b'
|
||||
WILL_TOPIC = '9d634e1a156dc0c1611eb4c3cff57276'
|
||||
|
||||
|
||||
def wlan_connect(ssid='MYSSID', password='MYPASS'):
|
||||
import network
|
||||
wlan = network.WLAN(network.STA_IF)
|
||||
if not wlan.active() or not wlan.isconnected():
|
||||
wlan.active(True)
|
||||
print('connecting to:', ssid)
|
||||
wlan.connect(ssid, password)
|
||||
while not wlan.isconnected():
|
||||
pass
|
||||
print('network config:', wlan.ifconfig())
|
||||
return wlan
|
||||
|
||||
def ntp(url='mixio.mixly.cn'):
|
||||
import urequests
|
||||
try:
|
||||
results=eval(urequests.get('http://{}/time.php'.format(url)).text)
|
||||
except Exception as e:
|
||||
raise RuntimeError("API request failed or WiFi is not connected",e)
|
||||
return results
|
||||
|
||||
def init_MQTT_client(address, username, password,MQTT_USR_PRJ):
|
||||
client = MQTTClient(hexlify(unique_id()), address, 1883, username, password)
|
||||
client.set_last_will(topic=MQTT_USR_PRJ+WILL_TOPIC, msg=client.client_id, qos=2)
|
||||
if client.connect()==0:
|
||||
client.publish(MQTT_USR_PRJ+ADDITIONAL_TOPIC, client.client_id, qos=0)
|
||||
time.sleep_ms(200)
|
||||
return client
|
||||
|
||||
# Add by Mixly Team
|
||||
def str_len(object):
|
||||
if isinstance(object, str):
|
||||
return len(object.encode('utf-8'))
|
||||
else:
|
||||
return len(object)
|
||||
#####################################################
|
||||
|
||||
class MQTTException(Exception):
|
||||
pass
|
||||
|
||||
class MQTTClient:
|
||||
def __init__(self, client_id, server, port=0, username=None, password=None, keepalive=60, ssl=False, ssl_params={}):
|
||||
if port == 0:
|
||||
port = 8883 if ssl else 1883
|
||||
self.client_id = client_id
|
||||
self.sock = None
|
||||
self.addr = socket.getaddrinfo(server, port)[0][-1]
|
||||
self.ssl = ssl
|
||||
self.ssl_params = ssl_params
|
||||
self.pid = 0
|
||||
self._on_message = None
|
||||
self.username = username
|
||||
self.password = password
|
||||
self.keepalive = keepalive
|
||||
self.lw_topic = None
|
||||
self.lw_msg = None
|
||||
self.lw_qos = 0
|
||||
self.lw_retain = False
|
||||
self._on_message_filtered = MQTTMatcher()
|
||||
self._star_time = time.ticks_ms()
|
||||
|
||||
def _send_str(self, s):
|
||||
self.sock.write(struct.pack("!H", str_len(s)))
|
||||
self.sock.write(s)
|
||||
|
||||
def _recv_len(self):
|
||||
n = 0
|
||||
sh = 0
|
||||
while 1:
|
||||
b = self.sock.read(1)[0]
|
||||
n |= (b & 0x7f) << sh
|
||||
if not b & 0x80:
|
||||
return n
|
||||
sh += 7
|
||||
|
||||
def set_callback(self, mqtt_topic, callback_method, MQTT_USR_PRJ):
|
||||
"""Registers a callback_method for a specific MQTT topic"""
|
||||
if mqtt_topic is None or callback_method is None:
|
||||
raise ValueError("MQTT topic and callback method must both be defined.")
|
||||
self._on_message_filtered[MQTT_USR_PRJ+mqtt_topic] = callback_method
|
||||
|
||||
def remove_callback(self, mqtt_topic):
|
||||
"""Removes a registered callback method"""
|
||||
if mqtt_topic is None:
|
||||
raise ValueError("MQTT Topic must be defined.")
|
||||
try:
|
||||
del self._on_message_filtered[mqtt_topic]
|
||||
except KeyError:
|
||||
raise KeyError(
|
||||
"MQTT topic callback not added with add_topic_callback."
|
||||
) from None
|
||||
|
||||
@property
|
||||
def on_message(self):
|
||||
"""Called when a new message has been received on a subscribed topic"""
|
||||
return self._on_message
|
||||
|
||||
@on_message.setter
|
||||
def on_message(self, method):
|
||||
self._on_message = method
|
||||
|
||||
def _handle_on_message(self, client, topic, message):
|
||||
matched = False
|
||||
if topic is not None:
|
||||
for callback in self._on_message_filtered.iter_match(topic):
|
||||
callback(client, topic.split("/")[-1], message) # on_msg with callback
|
||||
matched = True
|
||||
|
||||
if not matched and self.on_message: # regular on_message
|
||||
self.on_message(client, topic.split("/")[-1], message)
|
||||
|
||||
def set_last_will(self, topic, msg, retain=False, qos=0):
|
||||
assert 0 <= qos <= 2
|
||||
assert topic
|
||||
self.lw_topic = topic
|
||||
self.lw_msg = msg
|
||||
self.lw_qos = qos
|
||||
self.lw_retain = retain
|
||||
|
||||
def connect(self, clean_session=True):
|
||||
self.sock = socket.socket()
|
||||
self.sock.connect(self.addr)
|
||||
print(self.addr)
|
||||
if self.ssl:
|
||||
import ussl
|
||||
self.sock = ussl.wrap_socket(self.sock, **self.ssl_params)
|
||||
msg_header=bytearray([0x10])
|
||||
msg = bytearray(b"\x04MQTT\x04\x02\0\0")
|
||||
msg_length = 12 + str_len(self.client_id)
|
||||
msg[6] = clean_session << 1
|
||||
|
||||
if self.username is not None:
|
||||
msg_length += 2 + str_len(self.username) + 2 + str_len(self.password)
|
||||
msg[6] |= 0xC0
|
||||
if self.keepalive:
|
||||
assert self.keepalive < 65536
|
||||
msg[7] |= self.keepalive >> 8
|
||||
msg[8] |= self.keepalive & 0x00FF
|
||||
if self.lw_topic:
|
||||
msg_length += 2 + str_len(self.lw_topic) + 2 + str_len(self.lw_msg)
|
||||
msg[6] |= 0x4 | (self.lw_qos & 0x1) << 3 | (self.lw_qos & 0x2) << 3
|
||||
msg[6] |= self.lw_retain << 5
|
||||
|
||||
if msg_length > 0x7F:
|
||||
while msg_length>0:
|
||||
encoded_byte = msg_length % 0x80
|
||||
msg_length = msg_length // 0x80
|
||||
if msg_length > 0:
|
||||
encoded_byte |= 0x80
|
||||
msg_header.append(encoded_byte)
|
||||
msg_header.append(0x00)
|
||||
else:
|
||||
msg_header.append(msg_length)
|
||||
msg_header.append(0x00)
|
||||
|
||||
self.sock.write(msg_header)
|
||||
self.sock.write(msg)
|
||||
#print(hexlify(msg_header, ":"), hexlify(msg, ":"))
|
||||
self._send_str(self.client_id)
|
||||
if self.lw_topic:
|
||||
self._send_str(self.lw_topic)
|
||||
self._send_str(self.lw_msg)
|
||||
if self.username is not None:
|
||||
self._send_str(self.username)
|
||||
self._send_str(self.password)
|
||||
resp = self.sock.read(4)
|
||||
assert resp[0] == 0x20 and resp[1] == 0x02
|
||||
if resp[3] != 0:
|
||||
if resp[3] == 1:
|
||||
raise MQTTException("Unsupported Protocol")
|
||||
elif resp[3] == 2:
|
||||
raise MQTTException("Illegal ClientID")
|
||||
elif resp[3] == 3:
|
||||
raise MQTTException("Server Unavailable")
|
||||
elif resp[3] == 4:
|
||||
raise MQTTException("Invalid username and password format")
|
||||
elif resp[3] == 5:
|
||||
raise MQTTException("Unauthorized")
|
||||
else:
|
||||
raise MQTTException(resp[3])
|
||||
return resp[2] & 1
|
||||
|
||||
|
||||
def disconnect(self,MQTT_USR_PRJ):
|
||||
#MQTT_USR_PRJ = "{}/{}/".format(self.username,self.project)
|
||||
self.publish(MQTT_USR_PRJ+WILL_TOPIC, self.client_id, qos=1)
|
||||
self.sock.write(b"\xe0\0")
|
||||
self.sock.close()
|
||||
|
||||
def ping(self):
|
||||
self.sock.write(b"\xc0\0")
|
||||
|
||||
def pingSync(self):
|
||||
self.ping()
|
||||
for i in range(0,10):
|
||||
msg = self.check_msg()
|
||||
if msg == "PINGRESP":
|
||||
return True
|
||||
time.sleep_ms(100)
|
||||
return False
|
||||
|
||||
def publish(self, topic, msg, retain=False, qos=0):
|
||||
# msg = pubData(msg)
|
||||
if "+" in topic or "#" in topic:
|
||||
raise MQTTException("Publish topic can not contain wildcards.")
|
||||
# check msg/qos kwargs
|
||||
if msg is None:
|
||||
raise MQTTException("Message can not be None.")
|
||||
if isinstance(msg, (int, float)):
|
||||
msg = str(msg).encode("ascii")
|
||||
elif isinstance(msg, str):
|
||||
msg = str(msg).encode("utf-8")
|
||||
elif isinstance(msg, bytes):
|
||||
pass
|
||||
else:
|
||||
raise MQTTException("Invalid message data type.")
|
||||
pkt = bytearray(b"\x30\0\0\0")
|
||||
pkt[0] |= qos << 1 | retain
|
||||
sz = 2 + str_len(topic) + str_len(msg)
|
||||
if qos > 0:
|
||||
sz += 2
|
||||
assert sz < 2097152
|
||||
i = 1
|
||||
while sz > 0x7f:
|
||||
pkt[i] = (sz & 0x7f) | 0x80
|
||||
sz >>= 7
|
||||
i += 1
|
||||
pkt[i] = sz
|
||||
#print(hex(str_len(pkt)), hexlify(pkt, ":"))
|
||||
self.sock.settimeout(0.05)
|
||||
#self.sock.setblocking(True)
|
||||
self.sock.write(pkt, i + 1)
|
||||
self._send_str(topic)
|
||||
if qos > 0:
|
||||
self.pid += 1
|
||||
pid = self.pid
|
||||
struct.pack_into("!H", pkt, 0, pid)
|
||||
self.sock.write(pkt, 2)
|
||||
self.sock.write(msg)
|
||||
if qos == 1:
|
||||
while 1:
|
||||
op = self.wait_msg()
|
||||
if op == 0x40:
|
||||
sz = self.sock.read(1)
|
||||
assert sz == b"\x02"
|
||||
rcv_pid = self.sock.read(2)
|
||||
rcv_pid = rcv_pid[0] << 8 | rcv_pid[1]
|
||||
if pid == rcv_pid:
|
||||
return
|
||||
elif qos == 2:
|
||||
assert 0
|
||||
|
||||
def subscribe(self, topic, qos=0):
|
||||
#assert self.cb is not None, "Subscribe callback is not set"
|
||||
pkt = bytearray(b"\x82\0\0\0")
|
||||
self.pid += 1
|
||||
if isinstance(topic, str):
|
||||
topic=topic.encode()
|
||||
struct.pack_into("!BH", pkt, 1, 2 + 2 + str_len(topic) + 1, self.pid)
|
||||
#print(hex(str_len(pkt)), hexlify(pkt, ":"))
|
||||
self.sock.write(pkt)
|
||||
self._send_str(topic)
|
||||
self.sock.write(qos.to_bytes(1, "little"))
|
||||
while 1:
|
||||
op = self.wait_msg()
|
||||
if op == 0x90:
|
||||
resp = self.sock.read(4)
|
||||
#print(resp)
|
||||
assert resp[1] == pkt[2] and resp[2] == pkt[3]
|
||||
if resp[3] == 0x80:
|
||||
raise MQTTException(resp[3])
|
||||
return
|
||||
|
||||
# Wait for a single incoming MQTT message and process it.
|
||||
def wait_msg(self):
|
||||
res = self.sock.read(1)
|
||||
time.sleep_ms(50)
|
||||
self.sock.settimeout(0.05)
|
||||
#self.sock.setblocking(True)
|
||||
if res is None:
|
||||
return None
|
||||
if res == b"":
|
||||
raise OSError(-1)
|
||||
if res == b"\xd0": # PINGRESP
|
||||
sz = self.sock.read(1)[0]
|
||||
assert sz == 0
|
||||
return "PINGRESP"
|
||||
op = res[0]
|
||||
if op & 0xf0 != 0x30:
|
||||
return op
|
||||
sz = self._recv_len()
|
||||
topic_len = self.sock.read(2)
|
||||
topic_len = (topic_len[0] << 8) | topic_len[1]
|
||||
topic = self.sock.read(topic_len)
|
||||
sz -= topic_len + 2
|
||||
if op & 6:
|
||||
pid = self.sock.read(2)
|
||||
pid = pid[0] << 8 | pid[1]
|
||||
sz -= 2
|
||||
msg = self.sock.read(sz)
|
||||
self._handle_on_message(self, str(topic, "utf-8"), str(msg, "utf-8"))
|
||||
if op & 6 == 2:
|
||||
pkt = bytearray(b"\x40\x02\0\0")
|
||||
struct.pack_into("!H", pkt, 2, pid)
|
||||
self.sock.write(pkt)
|
||||
elif op & 6 == 4:
|
||||
assert 0
|
||||
|
||||
# Checks whether a pending message from server is available.
|
||||
def check_msg(self):
|
||||
self.sock.settimeout(0.05)
|
||||
if time.ticks_diff(time.ticks_ms(), self._star_time) >60000:
|
||||
self._star_time = time.ticks_ms()
|
||||
self.ping()
|
||||
return self.wait_msg()
|
||||
94
boards/default/micropython/build/lib/mixpy.py
Normal file
94
boards/default/micropython/build/lib/mixpy.py
Normal file
@@ -0,0 +1,94 @@
|
||||
#coding=utf-8
|
||||
import math
|
||||
|
||||
def math_map(v, al, ah, bl, bh):
|
||||
if al==ah:
|
||||
return bl
|
||||
if al < ah:
|
||||
v = max(min(ah,v),al)
|
||||
if al > ah:
|
||||
v = max(min(al,v),ah)
|
||||
return bl + (bh - bl) * (v - al) / (ah - al)
|
||||
|
||||
def math_mean(myList):
|
||||
localList = [e for e in myList if type(e) == int or type(e) == float]
|
||||
if not localList: return
|
||||
return float(sum(localList)) / len(localList)
|
||||
|
||||
def math_median(myList):
|
||||
localList = sorted([e for e in myList if type(e) == int or type(e) == float])
|
||||
if not localList: return
|
||||
if len(localList) % 2 == 0:
|
||||
return (localList[len(localList) // 2 - 1] + localList[len(localList) // 2]) / 2.0
|
||||
else:
|
||||
return localList[(len(localList) - 1) // 2]
|
||||
|
||||
def math_modes(some_list):
|
||||
modes = []
|
||||
# Using a lists of [item, count] to keep count rather than dict
|
||||
# to avoid "unhashable" errors when the counted item is itself a list or dict.
|
||||
counts = []
|
||||
maxCount = 1
|
||||
for item in some_list:
|
||||
found = False
|
||||
for count in counts:
|
||||
if count[0] == item:
|
||||
count[1] += 1
|
||||
maxCount = max(maxCount, count[1])
|
||||
found = True
|
||||
if not found:
|
||||
counts.append([item, 1])
|
||||
for counted_item, item_count in counts:
|
||||
if item_count == maxCount:
|
||||
modes.append(counted_item)
|
||||
return modes
|
||||
|
||||
def math_standard_deviation(numbers):
|
||||
n = len(numbers)
|
||||
if n == 0: return
|
||||
mean = float(sum(numbers)) / n
|
||||
variance = sum((x - mean) ** 2 for x in numbers) / n
|
||||
return math.sqrt(variance)
|
||||
|
||||
def lists_sort(my_list, type, reverse):
|
||||
def try_float(s):
|
||||
try:
|
||||
return float(s)
|
||||
except:
|
||||
return 0
|
||||
key_funcs = {
|
||||
"NUMERIC": try_float,
|
||||
"TEXT": str,
|
||||
"IGNORE_CASE": lambda s: str(s).lower()
|
||||
}
|
||||
key_func = key_funcs[type]
|
||||
list_cpy = list(my_list)
|
||||
return sorted(list_cpy, key=key_func, reverse=reverse)
|
||||
|
||||
def format_content(mydict, cid):
|
||||
if 'lat' in mydict and 'long' in mydict:
|
||||
res = '{'+'"lat": "{}", "long": "{}", "clientid": "{}"'.format(mydict.pop('lat'),mydict.pop('long'),cid)
|
||||
if len(mydict)>0:
|
||||
res += ', "message": ['
|
||||
for d in mydict:
|
||||
res += '{{"label": "{}", "value": "{}"}},'.format(d,mydict[d])
|
||||
res = res[:-1] + "]"
|
||||
res += '}'
|
||||
return res
|
||||
else:
|
||||
print('Invalid Input')
|
||||
|
||||
def format_str(d):
|
||||
return str(d).replace("'",'"')
|
||||
|
||||
|
||||
def analyse_sharekey(url):
|
||||
import urequests
|
||||
import json
|
||||
response = urequests.get(url)
|
||||
|
||||
if response.text == '-1':
|
||||
raise AttributeError('Invalid share key')
|
||||
else:
|
||||
result = json.loads(response.text)
|
||||
return (result['0'], result['1'], result['2'])
|
||||
149
boards/default/micropython/build/lib/mmc5603.py
Normal file
149
boards/default/micropython/build/lib/mmc5603.py
Normal file
@@ -0,0 +1,149 @@
|
||||
"""
|
||||
MMC5603
|
||||
|
||||
Micropython library for the MMC5603NJ(Magnetic)
|
||||
=======================================================
|
||||
|
||||
#Preliminary composition 20221017
|
||||
|
||||
dahanzimin From the Mixly Team
|
||||
"""
|
||||
import time,math
|
||||
from micropython import const
|
||||
|
||||
MMC5603_ADDRESS = const(0x30)
|
||||
|
||||
MMC5603_REG_DATA = const(0x00)
|
||||
MMC5603_REG_TMP = const(0x09)
|
||||
MMC5603_REG_ODR = const(0x1A)
|
||||
MMC5603_REG_CTRL0 = const(0x1B)
|
||||
MMC5603_REG_CTRL1 = const(0x1C)
|
||||
MMC5603_REG_CTRL2 = const(0x1D)
|
||||
|
||||
MMC5603_REG_X_THD = const(0x1E)
|
||||
MMC5603_REG_Y_THD = const(0x1F)
|
||||
MMC5603_REG_Z_THD = const(0x20)
|
||||
MMC5603_REG_ST_X_VAL = const(0x27)
|
||||
MMC5603_REG_DEVICE_ID = const(0x39)
|
||||
|
||||
class MMC5603:
|
||||
def __init__(self, i2c_bus):
|
||||
self._device = i2c_bus
|
||||
self._address = MMC5603_ADDRESS
|
||||
self.raw_x = 0.0
|
||||
self.raw_y = 0.0
|
||||
self.raw_z = 0.0
|
||||
|
||||
if self._chip_id() != 0x10: #Check product ID
|
||||
raise AttributeError("Cannot find a MMC5603")
|
||||
try: #Read calibration file
|
||||
import magnetic_cal
|
||||
self._offset_x = magnetic_cal._offset_x
|
||||
self._offset_y = magnetic_cal._offset_y
|
||||
self._offset_z = magnetic_cal._offset_z
|
||||
except:
|
||||
self._offset_x = 524288
|
||||
self._offset_y = 524288
|
||||
self._offset_z = 524288
|
||||
#print("offset:",self._offset_x ,self._offset_y,self._offset_z)
|
||||
|
||||
self._auto_selftest() #Auto self-test registers configuration
|
||||
self._set()
|
||||
self._continuous_mode(0x00, 50) #Work mode setting
|
||||
time.sleep(0.05)
|
||||
|
||||
def _wreg(self, reg, val):
|
||||
'''Write memory address'''
|
||||
self._device.writeto_mem(self._address,reg,val.to_bytes(1, 'little'))
|
||||
|
||||
def _rreg(self, reg,nbytes=1):
|
||||
'''Read memory address'''
|
||||
return self._device.readfrom_mem(self._address, reg, nbytes)[0] if nbytes<=1 else self._device.readfrom_mem(self._address, reg, nbytes)[0:nbytes]
|
||||
|
||||
def _chip_id(self):
|
||||
return self._rreg(MMC5603_REG_DEVICE_ID)
|
||||
|
||||
def _auto_selftest(self):
|
||||
'''Auto self-test registers configuration'''
|
||||
st_thd_reg=[0,0,0]
|
||||
st_thr_data=[0,0,0]
|
||||
#/* Read trim data from reg 0x27-0x29 */
|
||||
_buffer=self._rreg(MMC5603_REG_ST_X_VAL,3)
|
||||
for i in range(0, 3, 1):
|
||||
st_thr_data[i]=(_buffer[i]-128)*32
|
||||
if st_thr_data[i] < 0:
|
||||
st_thr_data[i]=-st_thr_data[i]
|
||||
st_thd=(st_thr_data[i]-st_thr_data[i]//5)//8
|
||||
if st_thd > 255:
|
||||
st_thd_reg[i]=0xFF
|
||||
else:
|
||||
st_thd_reg[i]=st_thd
|
||||
#/* Write threshold into the reg 0x1E-0x20 */
|
||||
self._wreg(MMC5603_REG_X_THD, st_thd_reg[0])
|
||||
self._wreg(MMC5603_REG_Y_THD, st_thd_reg[1])
|
||||
self._wreg(MMC5603_REG_Z_THD, st_thd_reg[2])
|
||||
|
||||
def _set(self):
|
||||
'''Do SET operation'''
|
||||
self._wreg(MMC5603_REG_CTRL0, 0X08)
|
||||
time.sleep(0.005)
|
||||
|
||||
def _continuous_mode(self,bandwith,sampling_rate):
|
||||
'''Work mode setting'''
|
||||
self._wreg(MMC5603_REG_CTRL1, bandwith)
|
||||
self._wreg(MMC5603_REG_ODR, sampling_rate)
|
||||
self._wreg(MMC5603_REG_CTRL0, 0X80|0X20)
|
||||
self._wreg(MMC5603_REG_CTRL2, 0x10)
|
||||
|
||||
def getdata(self):
|
||||
_buf=self._rreg( MMC5603_REG_DATA,9)
|
||||
#/* Transform to unit Gauss */
|
||||
self.raw_x=(_buf[0] << 12) | (_buf[1] << 4) | (_buf[6] >> 4)
|
||||
self.raw_y=(_buf[2] << 12) | (_buf[3] << 4) | (_buf[7] >> 4)
|
||||
self.raw_z=(_buf[4] << 12) | (_buf[5] << 4) | (_buf[8] >> 4)
|
||||
return (-0.0625*(self.raw_x-self._offset_x), -0.0625*(self.raw_y-self._offset_y), -0.0625*(self.raw_z-self._offset_z))
|
||||
|
||||
def calibrate(self):
|
||||
print("The magnetic field will be calibrated")
|
||||
print("Please pick up the board and rotate the '8' shape in the air")
|
||||
time.sleep(2)
|
||||
self.getdata()
|
||||
min_x = max_x = self.raw_x
|
||||
min_y = max_y = self.raw_y
|
||||
min_z = max_z = self.raw_z
|
||||
ticks_start = time.ticks_ms()
|
||||
while (time.ticks_diff(time.ticks_ms(), ticks_start) < 20000) :
|
||||
self.getdata()
|
||||
min_x = min(self.raw_x, min_x)
|
||||
max_x = max(self.raw_x, max_x)
|
||||
min_y = min(self.raw_y, min_y)
|
||||
max_y = max(self.raw_y, max_y)
|
||||
min_z = min(self.raw_z, min_z)
|
||||
max_z = max(self.raw_z, max_z)
|
||||
time.sleep_ms(20)
|
||||
if time.ticks_diff(time.ticks_ms(), ticks_start) % 20 ==0:
|
||||
print("=",end ="")
|
||||
print(" 100%")
|
||||
self._offset_x = (max_x + min_x) / 2
|
||||
self._offset_y = (max_y + min_y) / 2
|
||||
self._offset_z = (max_z + min_z) / 2
|
||||
print("Save x_offset:{}, y_offset:{}, z_offset:{}".format(self._offset_x,self._offset_y,self._offset_z))
|
||||
s_f = open("magnetic_cal.py", "w+")
|
||||
s_f.write("_offset_x="+str(self._offset_x)+"\n")
|
||||
s_f.write("_offset_y="+str(self._offset_y)+"\n")
|
||||
s_f.write("_offset_z="+str(self._offset_z)+"\n")
|
||||
s_f.close()
|
||||
time.sleep(2)
|
||||
|
||||
def getstrength(self):
|
||||
_x,_y,_z=self.getdata()
|
||||
return (math.sqrt(math.pow(_x, 2) + pow(_y, 2) + pow(_z, 2)))
|
||||
|
||||
def getangle(self,upright=False):
|
||||
_x,_y,_z=self.getdata()
|
||||
if upright: #vertical
|
||||
angle=math.atan2(_z, -_x)*(180 / math.pi) + 180 + 3
|
||||
return angle if angle<360 else angle-360
|
||||
else: #horizontal
|
||||
angle=math.atan2(_y, -_x)*(180 / math.pi) + 180 + 3
|
||||
return angle if angle<360 else angle-360
|
||||
585
boards/default/micropython/build/lib/mpu9250.py
Normal file
585
boards/default/micropython/build/lib/mpu9250.py
Normal file
@@ -0,0 +1,585 @@
|
||||
"""
|
||||
MicroPython I2C driver for MPU9250 9-axis motion tracking device
|
||||
"""
|
||||
from micropython import const
|
||||
import ustruct
|
||||
import time
|
||||
import math
|
||||
from machine import Pin,SoftI2C
|
||||
|
||||
_GYRO_CONFIG = const(0x1b)
|
||||
_ACCEL_CONFIG = const(0x1c)
|
||||
_ACCEL_CONFIG2 = const(0x1d)
|
||||
_INT_PIN_CFG = const(0x37)
|
||||
_ACCEL_XOUT_H = const(0x3b)
|
||||
_ACCEL_XOUT_L = const(0x3c)
|
||||
_ACCEL_YOUT_H = const(0x3d)
|
||||
_ACCEL_YOUT_L = const(0x3e)
|
||||
_ACCEL_ZOUT_H = const(0x3f)
|
||||
_ACCEL_ZOUT_L= const(0x40)
|
||||
_TEMP_OUT_H = const(0x41)
|
||||
_TEMP_OUT_L = const(0x42)
|
||||
_GYRO_XOUT_H = const(0x43)
|
||||
_GYRO_XOUT_L = const(0x44)
|
||||
_GYRO_YOUT_H = const(0x45)
|
||||
_GYRO_YOUT_L = const(0x46)
|
||||
_GYRO_ZOUT_H = const(0x47)
|
||||
_GYRO_ZOUT_L = const(0x48)
|
||||
_WHO_AM_I = const(0x75)
|
||||
|
||||
#_ACCEL_FS_MASK = const(0b00011000)
|
||||
ACCEL_FS_SEL_2G = const(0b00000000)
|
||||
ACCEL_FS_SEL_4G = const(0b00001000)
|
||||
ACCEL_FS_SEL_8G = const(0b00010000)
|
||||
ACCEL_FS_SEL_16G = const(0b00011000)
|
||||
|
||||
_ACCEL_SO_2G = 16384 # 1 / 16384 ie. 0.061 mg / digit
|
||||
_ACCEL_SO_4G = 8192 # 1 / 8192 ie. 0.122 mg / digit
|
||||
_ACCEL_SO_8G = 4096 # 1 / 4096 ie. 0.244 mg / digit
|
||||
_ACCEL_SO_16G = 2048 # 1 / 2048 ie. 0.488 mg / digit
|
||||
|
||||
#_GYRO_FS_MASK = const(0b00011000)
|
||||
GYRO_FS_SEL_250DPS = const(0b00000000)
|
||||
GYRO_FS_SEL_500DPS = const(0b00001000)
|
||||
GYRO_FS_SEL_1000DPS = const(0b00010000)
|
||||
GYRO_FS_SEL_2000DPS = const(0b00011000)
|
||||
|
||||
_GYRO_SO_250DPS = 131
|
||||
_GYRO_SO_500DPS = 62.5
|
||||
_GYRO_SO_1000DPS = 32.8
|
||||
_GYRO_SO_2000DPS = 16.4
|
||||
|
||||
# Used for enablind and disabling the i2c bypass access
|
||||
_I2C_BYPASS_MASK = const(0b00000010)
|
||||
_I2C_BYPASS_EN = const(0b00000010)
|
||||
_I2C_BYPASS_DIS = const(0b00000000)
|
||||
|
||||
SF_G = 1
|
||||
SF_M_S2 = 9.80665 # 1 g = 9.80665 m/s2 ie. standard gravity
|
||||
SF_DEG_S = 1
|
||||
SF_RAD_S = 57.295779578552 # 1 rad/s is 57.295779578552 deg/s
|
||||
|
||||
|
||||
_WIA = const(0x00)
|
||||
_HXL = const(0x03)
|
||||
_HXH = const(0x04)
|
||||
_HYL = const(0x05)
|
||||
_HYH = const(0x06)
|
||||
_HZL = const(0x07)
|
||||
_HZH = const(0x08)
|
||||
_ST2 = const(0x09)
|
||||
_CNTL1 = const(0x0a)
|
||||
_ASAX = const(0x10)
|
||||
_ASAY = const(0x11)
|
||||
_ASAZ = const(0x12)
|
||||
|
||||
_MODE_POWER_DOWN = 0b00000000
|
||||
MODE_SINGLE_MEASURE = 0b00000001
|
||||
MODE_CONTINOUS_MEASURE_1 = 0b00000010 # 8Hz
|
||||
MODE_CONTINOUS_MEASURE_2 = 0b00000110 # 100Hz
|
||||
MODE_EXTERNAL_TRIGGER_MEASURE = 0b00000100
|
||||
_MODE_SELF_TEST = 0b00001000
|
||||
_MODE_FUSE_ROM_ACCESS = 0b00001111
|
||||
|
||||
OUTPUT_14_BIT = 0b00000000
|
||||
OUTPUT_16_BIT = 0b00010000
|
||||
|
||||
_SO_14BIT = 0.6 # per digit when 14bit mode
|
||||
_SO_16BIT = 0.15 # per digit when 16bit mode
|
||||
|
||||
class MPU6500:
|
||||
"""Class which provides interface to MPU6500 6-axis motion tracking device."""
|
||||
def __init__(
|
||||
self, i2c, address=0x68,
|
||||
accel_fs=ACCEL_FS_SEL_2G, gyro_fs=GYRO_FS_SEL_250DPS,
|
||||
accel_sf=SF_M_S2, gyro_sf=SF_RAD_S
|
||||
):
|
||||
self.i2c = i2c
|
||||
self.address = address
|
||||
|
||||
if 0x71 != self.whoami:
|
||||
raise RuntimeError("MPU9250 not found in I2C bus.")
|
||||
|
||||
self._accel_so = self._accel_fs(accel_fs)
|
||||
self._gyro_so = self._gyro_fs(gyro_fs)
|
||||
self._accel_sf = accel_sf
|
||||
self._gyro_sf = gyro_sf
|
||||
|
||||
# Enable I2C bypass to access for MPU9250 magnetometer access.
|
||||
char = self._register_char(_INT_PIN_CFG)
|
||||
char &= ~_I2C_BYPASS_MASK # clear I2C bits
|
||||
char |= _I2C_BYPASS_EN
|
||||
self._register_char(_INT_PIN_CFG, char)
|
||||
|
||||
@property
|
||||
def temperature(self):
|
||||
tempbuf=self._register_short(0x41)
|
||||
return tempbuf/333.87 + 21 # I think
|
||||
|
||||
# @property
|
||||
def acceleration(self):
|
||||
so = self._accel_so
|
||||
sf = self._accel_sf
|
||||
|
||||
xyz = self._register_three_shorts(_ACCEL_XOUT_H)
|
||||
return tuple([value / so * sf for value in xyz])
|
||||
|
||||
@property
|
||||
def gyro(self):
|
||||
""" X, Y, Z radians per second as floats."""
|
||||
so = self._gyro_so
|
||||
sf = self._gyro_sf
|
||||
|
||||
xyz = self._register_three_shorts(_GYRO_XOUT_H)
|
||||
return tuple([value / so * sf for value in xyz])
|
||||
|
||||
@property
|
||||
def whoami(self):
|
||||
""" Value of the whoami register. """
|
||||
return self._register_char(_WHO_AM_I)
|
||||
|
||||
def _register_short(self, register, value=None, buf=bytearray(2)):
|
||||
if value is None:
|
||||
self.i2c.readfrom_mem_into(self.address, register, buf)
|
||||
return ustruct.unpack(">h", buf)[0]
|
||||
|
||||
ustruct.pack_into(">h", buf, 0, value)
|
||||
return self.i2c.writeto_mem(self.address, register, buf)
|
||||
|
||||
def _register_three_shorts(self, register, buf=bytearray(6)):
|
||||
self.i2c.readfrom_mem_into(self.address, register, buf)
|
||||
return ustruct.unpack(">hhh", buf)
|
||||
|
||||
def _register_char(self, register, value=None, buf=bytearray(1)):
|
||||
if value is None:
|
||||
self.i2c.readfrom_mem_into(self.address, register, buf)
|
||||
return buf[0]
|
||||
|
||||
ustruct.pack_into("<b", buf, 0, value)
|
||||
return self.i2c.writeto_mem(self.address, register, buf)
|
||||
|
||||
def _accel_fs(self, value):
|
||||
self._register_char(_ACCEL_CONFIG, value)
|
||||
|
||||
# Return the sensitivity divider
|
||||
if ACCEL_FS_SEL_2G == value:
|
||||
return _ACCEL_SO_2G
|
||||
elif ACCEL_FS_SEL_4G == value:
|
||||
return _ACCEL_SO_4G
|
||||
elif ACCEL_FS_SEL_8G == value:
|
||||
return _ACCEL_SO_8G
|
||||
elif ACCEL_FS_SEL_16G == value:
|
||||
return _ACCEL_SO_16G
|
||||
|
||||
def _gyro_fs(self, value):
|
||||
self._register_char(_GYRO_CONFIG, value)
|
||||
|
||||
# Return the sensitivity divider
|
||||
if GYRO_FS_SEL_250DPS == value:
|
||||
return _GYRO_SO_250DPS
|
||||
elif GYRO_FS_SEL_500DPS == value:
|
||||
return _GYRO_SO_500DPS
|
||||
elif GYRO_FS_SEL_1000DPS == value:
|
||||
return _GYRO_SO_1000DPS
|
||||
elif GYRO_FS_SEL_2000DPS == value:
|
||||
return _GYRO_SO_2000DPS
|
||||
|
||||
def __enter__(self):
|
||||
return self
|
||||
|
||||
def __exit__(self, exception_type, exception_value, traceback):
|
||||
pass
|
||||
|
||||
class AK8963:
|
||||
"""Class which provides interface to AK8963 magnetometer."""
|
||||
def __init__(
|
||||
self, i2c, address=0x0c,
|
||||
mode=MODE_CONTINOUS_MEASURE_1, output=OUTPUT_16_BIT,
|
||||
offset=(0, 0, 0), scale=(1, 1, 1)
|
||||
):
|
||||
self.i2c = i2c
|
||||
self.address = address
|
||||
self._offset = offset
|
||||
self._scale = scale
|
||||
|
||||
if 0x48 != self.whoami:
|
||||
raise RuntimeError("MPU9250 not found in I2C bus.")
|
||||
|
||||
# Sensitivity adjustement values
|
||||
self._register_char(_CNTL1, _MODE_FUSE_ROM_ACCESS)
|
||||
asax = self._register_char(_ASAX)
|
||||
asay = self._register_char(_ASAY)
|
||||
asaz = self._register_char(_ASAZ)
|
||||
self._register_char(_CNTL1, _MODE_POWER_DOWN)
|
||||
|
||||
# Should wait atleast 100us before next mode
|
||||
self._adjustement = (
|
||||
(0.5 * (asax - 128)) / 128 + 1,
|
||||
(0.5 * (asay - 128)) / 128 + 1,
|
||||
(0.5 * (asaz - 128)) / 128 + 1
|
||||
)
|
||||
|
||||
# Power on
|
||||
self._register_char(_CNTL1, (mode | output))
|
||||
|
||||
if output is OUTPUT_16_BIT:
|
||||
self._so = _SO_16BIT
|
||||
else:
|
||||
self._so = _SO_14BIT
|
||||
|
||||
|
||||
@property
|
||||
def magnetic(self):
|
||||
"""
|
||||
X, Y, Z axis micro-Tesla (uT) as floats.
|
||||
"""
|
||||
xyz = list(self._register_three_shorts(_HXL))
|
||||
self._register_char(_ST2) # Enable updating readings again
|
||||
|
||||
# Apply factory axial sensitivy adjustements
|
||||
xyz[0] *= self._adjustement[0]
|
||||
xyz[1] *= self._adjustement[1]
|
||||
xyz[2] *= self._adjustement[2]
|
||||
|
||||
# Apply output scale determined in constructor
|
||||
so = self._so
|
||||
xyz[0] *= so
|
||||
xyz[1] *= so
|
||||
xyz[2] *= so
|
||||
|
||||
# Apply hard iron ie. offset bias from calibration
|
||||
xyz[0] -= self._offset[0]
|
||||
xyz[1] -= self._offset[1]
|
||||
xyz[2] -= self._offset[2]
|
||||
|
||||
# Apply soft iron ie. scale bias from calibration
|
||||
xyz[0] *= self._scale[0]
|
||||
xyz[1] *= self._scale[1]
|
||||
xyz[2] *= self._scale[2]
|
||||
|
||||
return tuple(xyz)
|
||||
|
||||
@property
|
||||
def adjustement(self):
|
||||
return self._adjustement
|
||||
|
||||
@property
|
||||
def whoami(self):
|
||||
""" Value of the whoami register. """
|
||||
return self._register_char(_WIA)
|
||||
|
||||
def calibrate(self, count=3, delay=200):
|
||||
self._offset = (0, 0, 0)
|
||||
self._scale = (1, 1, 1)
|
||||
|
||||
reading = self.magnetic
|
||||
minx = maxx = reading[0]
|
||||
miny = maxy = reading[1]
|
||||
minz = maxz = reading[2]
|
||||
|
||||
while count:
|
||||
time.sleep_ms(delay)
|
||||
reading = self.magnetic
|
||||
minx = min(minx, reading[0])
|
||||
maxx = max(maxx, reading[0])
|
||||
miny = min(miny, reading[1])
|
||||
maxy = max(maxy, reading[1])
|
||||
minz = min(minz, reading[2])
|
||||
maxz = max(maxz, reading[2])
|
||||
count -= 1
|
||||
|
||||
|
||||
# Hard iron correction
|
||||
offset_x = (maxx + minx) / 2
|
||||
offset_y = (maxy + miny) / 2
|
||||
offset_z = (maxz + minz) / 2
|
||||
|
||||
self._offset = (offset_x, offset_y, offset_z)
|
||||
|
||||
# Soft iron correction
|
||||
avg_delta_x = (maxx - minx) / 2
|
||||
avg_delta_y = (maxy - miny) / 2
|
||||
avg_delta_z = (maxz - minz) / 2
|
||||
|
||||
avg_delta = (avg_delta_x + avg_delta_y + avg_delta_z) / 3
|
||||
|
||||
scale_x = avg_delta / avg_delta_x
|
||||
scale_y = avg_delta / avg_delta_y
|
||||
scale_z = avg_delta / avg_delta_z
|
||||
|
||||
self._scale = (scale_x, scale_y, scale_z)
|
||||
|
||||
return self._offset, self._scale
|
||||
|
||||
def _register_short(self, register, value=None, buf=bytearray(2)):
|
||||
if value is None:
|
||||
self.i2c.readfrom_mem_into(self.address, register, buf)
|
||||
return ustruct.unpack("<h", buf)[0]
|
||||
|
||||
ustruct.pack_into("<h", buf, 0, value)
|
||||
return self.i2c.writeto_mem(self.address, register, buf)
|
||||
|
||||
def _register_three_shorts(self, register, buf=bytearray(6)):
|
||||
self.i2c.readfrom_mem_into(self.address, register, buf)
|
||||
return ustruct.unpack("<hhh", buf)
|
||||
|
||||
def _register_char(self, register, value=None, buf=bytearray(1)):
|
||||
if value is None:
|
||||
self.i2c.readfrom_mem_into(self.address, register, buf)
|
||||
return buf[0]
|
||||
|
||||
ustruct.pack_into("<b", buf, 0, value)
|
||||
return self.i2c.writeto_mem(self.address, register, buf)
|
||||
|
||||
def __enter__(self):
|
||||
return self
|
||||
|
||||
def __exit__(self, exception_type, exception_value, traceback):
|
||||
pass
|
||||
|
||||
|
||||
class MPU9250:
|
||||
"""Class which provides interface to MPU9250 9-axis motion tracking device."""
|
||||
def __init__(self, i2c, mpu6500 = None, ak8963 = None):
|
||||
if mpu6500 is None:
|
||||
self.mpu6500 = MPU6500(i2c)
|
||||
else:
|
||||
self.mpu6500 = mpu6500
|
||||
|
||||
if ak8963 is None:
|
||||
self.ak8963 = AK8963(i2c)
|
||||
else:
|
||||
self.ak8963 = ak8963
|
||||
|
||||
def mpu9250_get_temperature(self):
|
||||
return self.mpu6500.temperature
|
||||
|
||||
def mpu9250_get_values(self):
|
||||
g = self.mpu6500.acceleration()
|
||||
a = [round(x/9.8, 2) for x in g]
|
||||
return tuple(a)
|
||||
|
||||
def mpu9250_get_x(self):
|
||||
return round(self.mpu6500.acceleration()[0]/9.8, 2)
|
||||
|
||||
def mpu9250_get_y(self):
|
||||
return round(self.mpu6500.acceleration()[1]/9.8, 2)
|
||||
|
||||
def mpu9250_get_z(self):
|
||||
return round(self.mpu6500.acceleration()[2]/9.8, 2)
|
||||
|
||||
|
||||
def mpu9250_is_gesture(self,choice):
|
||||
if choice == 'face up':
|
||||
if self.mpu6500.acceleration()[2] <= -9:
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
if choice == 'face down':
|
||||
if self.mpu6500.acceleration()[2] >= 9:
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
if choice == 'shake':
|
||||
if abs(self.mpu6500.acceleration()[0]) >= 9 and abs(self.mpu6500.acceleration()[1]) >= 9 :
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
if choice == 'up':
|
||||
if self.mpu6500.acceleration()[1] >= 9:
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
if choice == 'down':
|
||||
if self.mpu6500.acceleration()[1] <= -9:
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
if choice == 'right':
|
||||
if self.mpu6500.acceleration()[0] <= -9:
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
if choice == 'left':
|
||||
if self.mpu6500.acceleration()[0] >= 9:
|
||||
return True
|
||||
else:
|
||||
return False
|
||||
|
||||
@property
|
||||
def mpu9250_gyro(self):
|
||||
return self.mpu6500.gyro
|
||||
|
||||
def mpu9250_gyro_x(self):
|
||||
return self.mpu6500.gyro[0]
|
||||
|
||||
def mpu9250_gyro_y(self):
|
||||
return self.mpu6500.gyro[1]
|
||||
|
||||
def mpu9250_gyro_z(self):
|
||||
return self.mpu6500.gyro[2]
|
||||
|
||||
def mpu9250_gyro_values(self):
|
||||
return self.mpu6500.gyro
|
||||
|
||||
@property
|
||||
def mpu9250_magnetic(self):
|
||||
"""X, Y, Z axis micro-Tesla (uT) as floats."""
|
||||
return self.ak8963.magnetic
|
||||
|
||||
def mpu9250_magnetic_x(self):
|
||||
return self.mpu9250_magnetic[0]
|
||||
|
||||
def mpu9250_magnetic_y(self):
|
||||
return self.mpu9250_magnetic[1]
|
||||
|
||||
def mpu9250_magnetic_z(self):
|
||||
return self.mpu9250_magnetic[2]
|
||||
|
||||
def mpu9250_magnetic_values(self):
|
||||
return self.mpu9250_magnetic
|
||||
|
||||
# @property
|
||||
def mpu9250_get_field_strength(self):
|
||||
x=self.mpu9250_magnetic[0]
|
||||
y=self.mpu9250_magnetic[1]
|
||||
z=self.mpu9250_magnetic[2]
|
||||
return (x**2+y**2+z**2)**0.5*1000
|
||||
|
||||
def mpu9250_heading(self):
|
||||
x=self.mpu9250_magnetic[0]
|
||||
y=self.mpu9250_magnetic[1]
|
||||
z=self.mpu9250_magnetic[2]
|
||||
a=math.atan(z/x)
|
||||
b=math.atan(z/y)
|
||||
xr=x*math.cos(a)+y*math.sin(a)*math.sin(b)-z*math.cos(b)*math.sin(a)
|
||||
yr=x*math.cos(b)+z*math.sin(b)
|
||||
return 60*math.atan(yr/xr)
|
||||
|
||||
@property
|
||||
def whoami(self):
|
||||
return self.mpu6500.whoami
|
||||
|
||||
def __enter__(self):
|
||||
return self
|
||||
|
||||
def __exit__(self, exception_type, exception_value, traceback):
|
||||
pass
|
||||
|
||||
class Compass:
|
||||
RAD_TO_DEG = 57.295779513082320876798154814105
|
||||
|
||||
def __init__(self, sensor):
|
||||
self.sensor = sensor
|
||||
|
||||
def get_x(self):
|
||||
return self.sensor.mpu9250_magnetic[0]
|
||||
|
||||
def get_y(self):
|
||||
return self.sensor.mpu9250_magnetic[1]
|
||||
|
||||
def get_z(self):
|
||||
return self.sensor.mpu9250_magnetic[2]
|
||||
|
||||
def get_field_strength(self):
|
||||
return self.sensor.mpu9250_get_field_strength()
|
||||
|
||||
def heading(self):
|
||||
from math import atan2
|
||||
xyz = self.sensor.mpu9250_magnetic
|
||||
return int(((atan2(xyz[1], xyz[0]) * Compass.RAD_TO_DEG) + 180) % 360)
|
||||
|
||||
def calibrate(self):
|
||||
import matrix16x8
|
||||
mp_i2c=SoftI2C(scl = Pin(7), sda = Pin(6), freq = 400000)
|
||||
mp_matrix = matrix32x12.Matrix(mp_i2c)
|
||||
if self.is_calibrate() is False:
|
||||
# print('The calibration need to shaking in the air (e.g. 8 or 0) and waiting for a moment')
|
||||
print('First write 8 or 0 in the air with the board about 30 seconds, and then try to rotate the board in different direnctions several times.')
|
||||
mp_matrix.pixel(7, 3, 1)
|
||||
#mp_matrix.blink_rate(2)
|
||||
l1=0
|
||||
l2=0
|
||||
l3=0
|
||||
l4=0
|
||||
l5=0
|
||||
l6=0
|
||||
l7=0
|
||||
l8=0
|
||||
while True:
|
||||
x = self.sensor.mpu6500.acceleration()[0]
|
||||
y = self.sensor.mpu6500.acceleration()[1]
|
||||
z = self.sensor.mpu6500.acceleration()[2]
|
||||
a=(x**2+y**2+z**2)**0.5
|
||||
if z > 0:
|
||||
if x > 0 and y > 0 and a >= 12:
|
||||
l1=l1 + 1
|
||||
if x > 0 and y < 0 and a >= 12:
|
||||
l2=l2 + 1
|
||||
if x < 0 and y > 0 and a >= 12:
|
||||
l3=l3 + 1
|
||||
if x < 0 and y < 0 and a >= 12:
|
||||
l4=l4 + 1
|
||||
if z < 0:
|
||||
if x > 0 and y > 0 and a >= 12:
|
||||
l5=l5 + 1
|
||||
if x > 0 and y < 0 and a >= 12:
|
||||
l6=l6 + 1
|
||||
if x < 0 and y > 0 and a >= 12:
|
||||
l7=l7 + 1
|
||||
if x < 0 and y < 0 and a >= 12:
|
||||
l8=l8 + 1
|
||||
if l1 >= 2:
|
||||
mp_matrix.pixel(7, 0, 1)
|
||||
mp_matrix.pixel(8, 0, 1)
|
||||
mp_matrix.pixel(9, 1, 1)
|
||||
if l2 >= 2:
|
||||
mp_matrix.pixel(10, 2, 1)
|
||||
mp_matrix.pixel(10, 3, 1)
|
||||
if l3 >= 2:
|
||||
mp_matrix.pixel(10, 4, 1)
|
||||
mp_matrix.pixel(10, 5, 1)
|
||||
if l4 >= 2:
|
||||
mp_matrix.pixel(9, 6, 1)
|
||||
mp_matrix.pixel(8, 7, 1)
|
||||
if l5 >= 2:
|
||||
mp_matrix.pixel(7, 7, 1)
|
||||
mp_matrix.pixel(6, 7, 1)
|
||||
if l6 >= 2:
|
||||
mp_matrix.pixel(5, 6, 1)
|
||||
mp_matrix.pixel(4, 5, 1)
|
||||
if l7 >= 2:
|
||||
mp_matrix.pixel(4, 4, 1)
|
||||
mp_matrix.pixel(4, 3, 1)
|
||||
if l8 >= 2:
|
||||
mp_matrix.pixel(4, 2, 1)
|
||||
mp_matrix.pixel(5, 1, 1)
|
||||
mp_matrix.pixel(6, 0, 1)
|
||||
if l1>=2 and l2>=2 and l3>=2 and l4>=2 and l5>=2 and l6>=2 and l7>=2 and l8>=2:
|
||||
break
|
||||
else:
|
||||
self.sensor.ak8963.calibrate()
|
||||
with open("compass_cfg.py", "w") as f:
|
||||
f.write('\n_offset = ' + str(self.sensor.ak8963._offset) + '\n_scale = ' + str(self.sensor.ak8963._offset))
|
||||
else:
|
||||
print('The calibration configuration already exists. If you need to recalibrate, enter os.remove("compass_cfg.py") in repl and restart')
|
||||
try:
|
||||
import compass_cfg
|
||||
self.sensor.ak8963._offset = compass_cfg._offset
|
||||
self.sensor.ak8963._scale = compass_cfg._scale
|
||||
except Exception as e:
|
||||
print('compass_cfg error! delete it, please.')
|
||||
with open("compass_cfg.py") as f:
|
||||
for line in f:
|
||||
print(line)
|
||||
|
||||
def is_calibrate(self):
|
||||
try:
|
||||
import compass_cfg
|
||||
return True
|
||||
except Exception as e:
|
||||
return False
|
||||
|
||||
def reset_calibrate(self):
|
||||
import os
|
||||
os.remove("compass_cfg.py")
|
||||
137
boards/default/micropython/build/lib/ms32006.py
Normal file
137
boards/default/micropython/build/lib/ms32006.py
Normal file
@@ -0,0 +1,137 @@
|
||||
"""
|
||||
MS32006
|
||||
|
||||
Micropython library for the MS32006 step diever
|
||||
=======================================================
|
||||
#Changed from circuitpython to micropython 20211206
|
||||
#Fix register read / write bug 20211215
|
||||
dahanzimin From the Mixly Team
|
||||
|
||||
"""
|
||||
import time
|
||||
from micropython import const
|
||||
|
||||
|
||||
MS32006_REG_RESET = const(0x00) #复位
|
||||
MS32006_FCLK = const(25000000) #芯片输入时钟选择,此参数与运动速度有关。 范围是:5-30MHZ
|
||||
|
||||
ADDRESS_A = 0x10
|
||||
ADDRESS_B = 0x18
|
||||
MOT_FULL = 0
|
||||
MOT_HALF = 1
|
||||
MOT_A = 0
|
||||
MOT_B = 4
|
||||
MOT_N = 0
|
||||
MOT_CW = 1
|
||||
MOT_CCW = 2
|
||||
MOT_P = 3
|
||||
class MS32006:
|
||||
|
||||
_buffer = bytearray(2)
|
||||
|
||||
def __init__(self, i2c_bus,addr=ADDRESS_A,mode=MOT_FULL):
|
||||
self._device = i2c_bus
|
||||
self._address = addr
|
||||
self.reset()
|
||||
self.mode=mode
|
||||
|
||||
|
||||
def _read_u8(self, reg):
|
||||
return self._device.readfrom_mem(self._address, reg, 1)[0]
|
||||
|
||||
def _write_u8(self, reg, val):
|
||||
self._device.writeto_mem(self._address,reg,val.to_bytes(1, 'little'))
|
||||
|
||||
def reset(self):
|
||||
self._write_u8(MS32006_REG_RESET,0x00)
|
||||
time.sleep(0.1)
|
||||
self._write_u8(MS32006_REG_RESET,0xC1)
|
||||
|
||||
def move(self,moto,mot_dir,mot_pps,mot_step):
|
||||
readstate_0H = self._read_u8(0x00)
|
||||
readstate_9H = self._read_u8(0x09)
|
||||
speed_data=MS32006_FCLK//mot_pps//128 #设置速度 xx pps 128是固定参数
|
||||
|
||||
if speed_data<32: #限定转速
|
||||
speed_data=32
|
||||
elif speed_data>16383:
|
||||
speed_data=16383
|
||||
|
||||
mot_speed_l=speed_data&0x00ff #取低8位
|
||||
mot_speed_h=speed_data//0x100 #取高6位
|
||||
|
||||
if self.mode==MOT_FULL: #设置整步、半步驱动模式
|
||||
mot_speed_h|=0x80
|
||||
else:
|
||||
mot_speed_h&=0x7f
|
||||
|
||||
if mot_step>2047:
|
||||
raise AttributeError("Reach the set upper limit, up to 2047 step")
|
||||
|
||||
mot_step_l=mot_step&0x00ff
|
||||
mot_step_h=mot_step//0x100
|
||||
mot_step_h|=0x80
|
||||
|
||||
if mot_dir==MOT_CW:
|
||||
mot_step_h&=0xBF
|
||||
else:
|
||||
mot_step_h|=0x40
|
||||
self._write_u8(0x01+moto,mot_speed_l)
|
||||
self._write_u8(0x02+moto,mot_speed_h)
|
||||
self._write_u8(0x03+moto,mot_step_l)
|
||||
self._write_u8(0x04+moto,mot_step_h)
|
||||
|
||||
if moto==MOT_A:
|
||||
self._write_u8(0x00, readstate_0H&0xfb)
|
||||
self._write_u8(0x09, readstate_9H|0x80)
|
||||
else:
|
||||
self._write_u8(0x00, readstate_0H&0xfd)
|
||||
self._write_u8(0x09, readstate_9H|0x40)
|
||||
|
||||
def close(self,moto): #停止并关闭输出
|
||||
if moto==MOT_A:
|
||||
self._write_u8(0x04,0x00)
|
||||
else:
|
||||
self._write_u8(0x08,0x00)
|
||||
|
||||
def stop(self,moto): #此停止函数,强制让电机停止
|
||||
readstate = self._read_u8(0x00)
|
||||
if moto==MOT_A:
|
||||
self._write_u8(0x00,readstate|0x04)
|
||||
else:
|
||||
self._write_u8(0x00,readstate|0x02)
|
||||
|
||||
def readstep(self,moto): #读取电机运动步数
|
||||
if moto==MOT_A:
|
||||
rdb =self._read_u8(0x0b)
|
||||
rdc =self._read_u8(0x0c)
|
||||
else:
|
||||
rdb =self._read_u8(0x0d)
|
||||
rdc =self._read_u8(0x0e)
|
||||
return (rdb*0x100+rdc)&0xfff
|
||||
|
||||
def readbusy(self,moto): #读取电机缓存是否有数据
|
||||
if moto==MOT_A:
|
||||
busy =(self._read_u8(0x0b)>>6)&1
|
||||
else:
|
||||
busy =(self._read_u8(0x0d)>>6)&1
|
||||
return bool(busy)
|
||||
|
||||
def readwork(self,moto): #读取电机是否在运行
|
||||
if moto==MOT_A:
|
||||
busy =(self._read_u8(0x0b)>>4)&1
|
||||
else:
|
||||
busy =(self._read_u8(0x0d)>>4)&1
|
||||
return bool(busy)
|
||||
|
||||
def dc_motor(self,state,speed=100): #直流电机驱动
|
||||
if (state==MOT_CW) | (state==MOT_CCW) :
|
||||
speed_st=speed*127//100 |0x80
|
||||
self._write_u8(0x0A,speed_st)
|
||||
|
||||
readstate = self._read_u8(0x09) & 0xA0
|
||||
state_st=(state<<2) | 0X03 | readstate
|
||||
self._write_u8(0x09,state_st)
|
||||
|
||||
|
||||
|
||||
57
boards/default/micropython/build/lib/msa301.py
Normal file
57
boards/default/micropython/build/lib/msa301.py
Normal file
@@ -0,0 +1,57 @@
|
||||
"""
|
||||
MSA301
|
||||
|
||||
Micropython library for the MSA301 Accelerometer
|
||||
=======================================================
|
||||
#Preliminary composition 20220817
|
||||
|
||||
dahanzimin From the Mixly Team
|
||||
"""
|
||||
import time
|
||||
from micropython import const
|
||||
|
||||
MSA301_ADDRESS = const(0x26)
|
||||
MSA301_REG_DEVICE_ID = const(0x01)
|
||||
MSA301_REG_DATA = const(0x02)
|
||||
MSA301_REG_ODR = const(0x10)
|
||||
MSA301_REG_POWERMODE = const(0x11)
|
||||
MSA301_REG_RESRANGE = const(0x0F)
|
||||
|
||||
class MSA301:
|
||||
def __init__(self, i2c_bus, front=False):
|
||||
self._device = i2c_bus
|
||||
self._address = MSA301_ADDRESS
|
||||
self._front = front
|
||||
if self._chip_id() != 0x13:
|
||||
raise AttributeError("Cannot find a MSA301")
|
||||
|
||||
self._wreg(MSA301_REG_ODR,0X09) #RATE_500_HZ
|
||||
self._wreg(MSA301_REG_POWERMODE,0X12) #NORMAL & WIDTH_250_HZ
|
||||
self._wreg(MSA301_REG_RESRANGE,0X02) #RESOLUTION_14_BIT & RANGE_8_G
|
||||
|
||||
def _rreg(self, reg,nbytes=1):
|
||||
'''Read memory address'''
|
||||
return self._device.readfrom_mem(self._address, reg, nbytes)[0] if nbytes<=1 else self._device.readfrom_mem(self._address, reg, nbytes)[0:nbytes]
|
||||
|
||||
def _wreg(self, reg, val):
|
||||
'''Write memory address'''
|
||||
self._device.writeto_mem(self._address,reg,val.to_bytes(1, 'little'))
|
||||
|
||||
def _chip_id(self):
|
||||
return self._rreg(MSA301_REG_DEVICE_ID)
|
||||
|
||||
def u2s(self,n):
|
||||
return n if n < (1 << 7) else n - (1 << 8)
|
||||
|
||||
def acceleration(self):
|
||||
data_reg=self._rreg(MSA301_REG_DATA,6)
|
||||
x_acc=((self.u2s(data_reg[1])<<8|data_reg[0])>>2)/1024.0
|
||||
y_acc=((self.u2s(data_reg[3])<<8|data_reg[2])>>2)/1024.0
|
||||
z_acc=((self.u2s(data_reg[5])<<8|data_reg[4])>>2)/1024.0
|
||||
return (-y_acc,-x_acc,z_acc) if self._front else (y_acc,-x_acc,z_acc)
|
||||
|
||||
def eulerangles(self,upright=False):
|
||||
x,y,z=self.acceleration()
|
||||
pitch = degrees(atan(z / sqrt(x ** 2 + y ** 2))) if upright else degrees(atan(y / sqrt(x ** 2 + z ** 2)))
|
||||
roll = degrees(atan(x / sqrt(y ** 2 + z ** 2)))
|
||||
return round(pitch,2),round(roll,2)
|
||||
156
boards/default/micropython/build/lib/music.py
Normal file
156
boards/default/micropython/build/lib/music.py
Normal file
@@ -0,0 +1,156 @@
|
||||
"""
|
||||
Music buzzer
|
||||
|
||||
Micropython library for the Music buzzer
|
||||
=======================================================
|
||||
|
||||
#Based on Author: qiren123(MIDI Music) 20220618
|
||||
#Make changes to instantiation 20220622
|
||||
#Increase level reversal selection 20220716
|
||||
|
||||
dahanzimin From the Mixly Team
|
||||
"""
|
||||
|
||||
from time import sleep_ms
|
||||
from machine import Pin, PWM
|
||||
|
||||
normal_tone = {
|
||||
'A1': 55, 'B1': 62, 'C1': 33, 'D1': 37, 'E1': 41, 'F1': 44, 'G1': 49,
|
||||
'A2': 110, 'B2': 123, 'C2': 65, 'D2': 73, 'E2': 82, 'F2': 87, 'G2': 98,
|
||||
'A3': 220, 'B3': 247, 'C3': 131, 'D3': 147, 'E3': 165, 'F3': 175, 'G3': 196,
|
||||
'A4': 440, 'B4': 494, 'C4': 262, 'D4': 294, 'E4': 330, 'F4': 349, 'G4': 392,
|
||||
'A5': 880, 'B5': 988, 'C5': 523, 'D5': 587, 'E5': 659, 'F5': 698, 'G5': 784,
|
||||
'A6': 1760, 'B6': 1976, 'C6': 1047, 'D6': 1175, 'E6': 1319, 'F6': 1397, 'G6': 1568,
|
||||
'A7': 3520, 'B7': 3951, 'C7': 2093, 'D7': 2349, 'E7': 2637, 'F7': 2794, 'G7': 3135,
|
||||
'A8': 7040, 'B8': 7902, 'C8': 4186, 'D8': 4699, 'E8': 5274, 'F8': 5588, 'G8': 6271,
|
||||
'A9': 14080, 'B9': 15804 }
|
||||
|
||||
Letter = 'ABCDEFG#R'
|
||||
|
||||
class MIDI():
|
||||
def __init__(self,pin,volume=100,invert=0):
|
||||
self.reset()
|
||||
self._invert=invert
|
||||
self._pin = pin
|
||||
self._volume = volume
|
||||
self._pwm = None
|
||||
|
||||
def set_volume(self,volume):
|
||||
if not 0 <= volume <= 100:
|
||||
raise ValueError("Volume value is in the range: 0-100")
|
||||
self._volume=volume
|
||||
|
||||
def set_tempo(self, ticks=4, bpm=120):
|
||||
self.ticks = ticks
|
||||
self.bpm = bpm
|
||||
self.beat = 60000 / self.bpm / self.ticks
|
||||
|
||||
def set_octave(self, octave=4):
|
||||
self.octave = octave
|
||||
|
||||
def set_duration(self, duration=4):
|
||||
self.duration = duration
|
||||
|
||||
def get_tempo(self):
|
||||
return (self.ticks, self.bpm)
|
||||
|
||||
def get_octave(self):
|
||||
return self.octave
|
||||
|
||||
def get_duration(self):
|
||||
return self.duration
|
||||
|
||||
def reset(self):
|
||||
self.set_duration()
|
||||
self.set_octave()
|
||||
self.set_tempo()
|
||||
|
||||
def parse(self, tone, dict):
|
||||
time = self.beat * self.duration
|
||||
pos = tone.find(':')
|
||||
if pos != -1:
|
||||
time = self.beat * int(tone[(pos + 1):])
|
||||
tone = tone[:pos]
|
||||
freq, tone_size = 1, len(tone)
|
||||
if 'R' in tone:
|
||||
freq = 400000
|
||||
elif tone_size == 1:
|
||||
freq = dict[tone[0] + str(self.octave)]
|
||||
elif tone_size == 2:
|
||||
freq = dict[tone]
|
||||
self.set_octave(tone[1:])
|
||||
return int(freq), int(time)
|
||||
|
||||
def midi(self, tone):
|
||||
pos = tone.find('#')
|
||||
if pos != -1:
|
||||
return self.parse(tone.replace('#', ''), normal_tone)
|
||||
pos = tone.find('B')
|
||||
if pos != -1 and pos != 0:
|
||||
return self.parse(tone.replace('B', ''), normal_tone)
|
||||
return self.parse(tone, normal_tone)
|
||||
|
||||
def set_default(self, tone):
|
||||
pos = tone.find(':')
|
||||
if pos != -1:
|
||||
self.set_duration(int(tone[(pos + 1):]))
|
||||
tone = tone[:pos]
|
||||
|
||||
def play(self, tune, duration=None):
|
||||
self._pwm = PWM(Pin(self._pin), duty=1023 if self._invert else 0)
|
||||
if duration is None:
|
||||
self.set_default(tune[0])
|
||||
else:
|
||||
self.set_duration(duration)
|
||||
for tone in tune:
|
||||
tone = tone.upper()
|
||||
if tone[0] not in Letter:
|
||||
continue
|
||||
midi = self.midi(tone)
|
||||
self._pwm.duty(1023-self._volume) if self._invert else self._pwm.duty(self._volume)
|
||||
self._pwm.freq(midi[0])
|
||||
sleep_ms(midi[1])
|
||||
self._pwm.freq(400000)
|
||||
sleep_ms(1)
|
||||
self._pwm.deinit()
|
||||
sleep_ms(10)
|
||||
|
||||
def pitch(self, freq):
|
||||
self._pwm = PWM(Pin(self._pin))
|
||||
self._pwm.duty(1023-self._volume) if self._invert else self._pwm.duty(self._volume)
|
||||
self._pwm.freq(int(freq))
|
||||
|
||||
def pitch_time(self, freq, delay):
|
||||
self._pwm = PWM(Pin(self._pin))
|
||||
self._pwm.duty(1023-self._volume) if self._invert else self._pwm.duty(self._volume)
|
||||
self._pwm.freq(int(freq))
|
||||
sleep_ms(delay)
|
||||
self._pwm.deinit()
|
||||
sleep_ms(10)
|
||||
|
||||
def stop(self):
|
||||
if self._pwm:
|
||||
self._pwm.deinit()
|
||||
sleep_ms(10)
|
||||
|
||||
DADADADUM=['r4:2','g','g','g','eb:8','r:2','f','f','f','d:8']
|
||||
ENTERTAINER=['d4:1','d#','e','c5:2','e4:1','c5:2','e4:1','c5:3','c:1','d','d#','e','c','d','e:2','b4:1','d5:2','c:4']
|
||||
PRELUDE=['c4:1','e','g','c5','e','g4','c5','e','c4','e','g','c5','e','g4','c5','e','c4','d','g','d5','f','g4','d5','f','c4','d','g','d5','f','g4','d5','f','b3','d4','g','d5','f','g4','d5','f','b3','d4','g','d5','f','g4','d5','f','c4','e','g','c5','e','g4','c5','e','c4','e','g','c5','e','g4','c5','e']
|
||||
ODE=['e4','e','f','g','g','f','e','d','c','c','d','e','e:6','d:2','d:8','e:4','e','f','g','g','f','e','d','c','c','d','e','d:6','c:2','c:8']
|
||||
NYAN=['f#5:1','g#','c#:1','d#:2','b4:1','d5:1','c#','b4:2','b','c#5','d','d:1','c#','b4:1','c#5:1','d#','f#','g#','d#','f#','c#','d','b4','c#5','b4','d#5:2','f#','g#:1','d#','f#','c#','d#','b4','d5','d#','d','c#','b4','c#5','d:2','b4:1','c#5','d#','f#','c#','d','c#','b4','c#5:2','b4','c#5','b4','f#:1','g#','b:2','f#:1','g#','b','c#5','d#','b4','e5','d#','e','f#','b4:2','b','f#:1','g#','b','f#','e5','d#','c#','b4','f#','d#','e','f#','b:2','f#:1','g#','b:2','f#:1','g#','b','b','c#5','d#','b4','f#','g#','f#','b:2','b:1','a#','b','f#','g#','b','e5','d#','e','f#','b4:2','c#5']
|
||||
RINGTONE=['c4:1','d','e:2','g','d:1','e','f:2','a','e:1','f','g:2','b','c5:4']
|
||||
FUNK=['c2:2','c','d#','c:1','f:2','c:1','f:2','f#','g','c','c','g','c:1','f#:2','c:1','f#:2','f','d#']
|
||||
BLUES=['c2:2','e','g','a','a#','a','g','e','c2:2','e','g','a','a#','a','g','e','f','a','c3','d','d#','d','c','a2','c2:2','e','g','a','a#','a','g','e','g','b','d3','f','f2','a','c3','d#','c2:2','e','g','e','g','f','e','d']
|
||||
BIRTHDAY=['c4:4','c:1','d:4','c:4','f','e:8','c:3','c:1','d:4','c:4','g','f:8','c:3','c:1','c5:4','a4','f','e','d','a#:3','a#:1','a:4','f','g','f:8']
|
||||
WEDDING=['c4:4','f:3','f:1','f:8','c:4','g:3','e:1','f:8','c:4','f:3','a:1','c5:4','a4:3','f:1','f:4','e:3','f:1','g:8']
|
||||
FUNERAL=['c3:4','c:3','c:1','c:4','d#:3','d:1','d:3','c:1','c:3','b2:1','c3:4']
|
||||
PUNCHLINE=['c4:3','g3:1','f#','g','g#:3','g','r','b','c4']
|
||||
PYTHON=['d5:1','b4','r','b','b','a#','b','g5','r','d','d','r','b4','c5','r','c','c','r','d','e:5','c:1','a4','r','a','a','g#','a','f#5','r','e','e','r','c','b4','r','b','b','r','c5','d:5','d:1','b4','r','b','b','a#','b','b5','r','g','g','r','d','c#','r','a','a','r','a','a:5','g:1','f#:2','a:1','a','g#','a','e:2','a:1','a','g#','a','d','r','c#','d','r','c#','d:2','r:3']
|
||||
BADDY=['c3:3','r','d:2','d#','r','c','r','f#:8']
|
||||
CHASE=['a4:1','b','c5','b4','a:2','r','a:1','b','c5','b4','a:2','r','a:2','e5','d#','e','f','e','d#','e','b4:1','c5','d','c','b4:2','r','b:1','c5','d','c','b4:2','r','b:2','e5','d#','e','f','e','d#','e']
|
||||
BA_DING=['b5:1','e6:3']
|
||||
WAWAWAWAA=['e3:3','r:1','d#:3','r:1','d:4','r:1','c#:8']
|
||||
JUMP_UP=['c5:1','d','e','f','g']
|
||||
JUMP_DOWN=['g5:1','f','e','d','c']
|
||||
POWER_UP=['g4:1','c5','e4','g5:2','e5:1','g5:3']
|
||||
POWER_DOWN=['g5:1','d#','c','g4:2','b:1','c5:3']
|
||||
91
boards/default/micropython/build/lib/mxc6655xa.py
Normal file
91
boards/default/micropython/build/lib/mxc6655xa.py
Normal file
@@ -0,0 +1,91 @@
|
||||
"""
|
||||
MXC6655XA
|
||||
|
||||
Micropython library for the MXC6655XA Accelerometer
|
||||
=======================================================
|
||||
#Changed from circuitpython to micropython 20220224
|
||||
#Format unified 20220623
|
||||
|
||||
dahanzimin From the Mixly Team
|
||||
"""
|
||||
import time
|
||||
from math import atan,sqrt,degrees
|
||||
from micropython import const
|
||||
|
||||
MXC6655XA_ADDRESS = const(0x15)
|
||||
MXC6655XA_REG_DATA = const(0x03)
|
||||
MXC6655XA_REG_CTRL = const(0x0D)
|
||||
MXC6655XA_REG_DEVICE_ID = const(0x0E)
|
||||
MXC6655XA_CMD_8G_POWER_ON = const(0x40)
|
||||
MXC6655XA_CMD_4G_POWER_ON = const(0x20)
|
||||
MXC6655XA_CMD_2G_POWER_ON = const(0x00)
|
||||
|
||||
_Range = (
|
||||
MXC6655XA_CMD_2G_POWER_ON, # 2g
|
||||
MXC6655XA_CMD_4G_POWER_ON, # 4g
|
||||
MXC6655XA_CMD_8G_POWER_ON, # 8g
|
||||
)
|
||||
|
||||
_Range_X = (
|
||||
1024, # 2g
|
||||
512, # 4g
|
||||
256, # 8g
|
||||
)
|
||||
|
||||
MXC6655XA_T_ZERO =25
|
||||
MXC6655XA_T_SENSITIVITY =0.586
|
||||
|
||||
class MXC6655XA:
|
||||
|
||||
def __init__(self,i2c_bus,set_range=2, front=False):
|
||||
self._device = i2c_bus
|
||||
self._address = MXC6655XA_ADDRESS
|
||||
self._range = set_range #default 8g range
|
||||
self._front = front
|
||||
|
||||
if self._chip_id() != 0x02:
|
||||
raise AttributeError("Cannot find a MXC6655XA")
|
||||
self._Enable() #star
|
||||
#time.sleep(0.3)
|
||||
|
||||
def _wreg(self, reg, val):
|
||||
'''Write memory address'''
|
||||
self._device.writeto_mem(self._address,reg,val.to_bytes(1, 'little'))
|
||||
|
||||
def _rreg(self, reg,nbytes=1):
|
||||
'''Read memory address'''
|
||||
return self._device.readfrom_mem(self._address, reg, nbytes)[0] if nbytes<=1 else self._device.readfrom_mem(self._address, reg, nbytes)[0:nbytes]
|
||||
|
||||
def _chip_id(self):
|
||||
return self._rreg(MXC6655XA_REG_DEVICE_ID)
|
||||
|
||||
def _Enable(self):
|
||||
self._wreg(MXC6655XA_REG_CTRL,_Range[self._range])
|
||||
|
||||
def u2s(self,n):
|
||||
return n if n < (1 << 7) else n - (1 << 8)
|
||||
|
||||
@property
|
||||
def getdata(self):
|
||||
data_reg=self._rreg(MXC6655XA_REG_DATA,7)
|
||||
x_acc=float((self.u2s(data_reg[0])<<8|data_reg[1])>>4)/_Range_X[self._range]
|
||||
y_acc=float((self.u2s(data_reg[2])<<8|data_reg[3])>>4)/_Range_X[self._range]
|
||||
z_acc=float((self.u2s(data_reg[4])<<8|data_reg[5])>>4)/_Range_X[self._range]
|
||||
t_acc=float(self.u2s(data_reg[6]))*MXC6655XA_T_SENSITIVITY + MXC6655XA_T_ZERO
|
||||
return (-y_acc,-x_acc,z_acc,round(t_acc,1)) if self._front else (y_acc,-x_acc,z_acc,round(t_acc,1))
|
||||
|
||||
def acceleration(self):
|
||||
return self.getdata[0:3]
|
||||
|
||||
def strength(self):
|
||||
from math import sqrt
|
||||
return sqrt(self.getdata[0]**2+self.getdata[1]**2+self.getdata[2]**2)
|
||||
|
||||
def temperature(self):
|
||||
return self.getdata[3]
|
||||
|
||||
def eulerangles(self,upright=False):
|
||||
x,y,z=self.acceleration()
|
||||
pitch = degrees(atan(z / sqrt(x ** 2 + y ** 2))) if upright else degrees(atan(y / sqrt(x ** 2 + z ** 2)))
|
||||
roll = degrees(atan(x / sqrt(y ** 2 + z ** 2)))
|
||||
return round(pitch,2),round(roll,2)
|
||||
40
boards/default/micropython/build/lib/ntptime.py
Normal file
40
boards/default/micropython/build/lib/ntptime.py
Normal file
@@ -0,0 +1,40 @@
|
||||
import utime,gc
|
||||
from machine import RTC
|
||||
import usocket as socket
|
||||
import ustruct as struct
|
||||
|
||||
# NTP_DELTA (date(2000, 1, 1) - date(1900, 1, 1)).days * 24*60*60
|
||||
NTP_DELTA=3155673600
|
||||
|
||||
def time(host="pool.ntp.org", utc=28800):
|
||||
NTP_QUERY = bytearray(48)
|
||||
NTP_QUERY[0] = 0x1B
|
||||
addr = socket.getaddrinfo(host, 123)[0][-1]
|
||||
s = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
|
||||
try:
|
||||
s.settimeout(1)
|
||||
res = s.sendto(NTP_QUERY, addr)
|
||||
msg = s.recv(48)
|
||||
finally:
|
||||
del addr
|
||||
s.close()
|
||||
gc.collect()
|
||||
val = struct.unpack("!I", msg[40:44])[0]
|
||||
return utime.gmtime(val - NTP_DELTA + utc)
|
||||
|
||||
# There's currently no timezone support in MicroPython, and the RTC is set in UTC time.
|
||||
def settime(times):
|
||||
if isinstance(times, str):
|
||||
try:
|
||||
val = eval(times)
|
||||
if len(val) >= 6:
|
||||
times=(val[0], val[1], val[2], 0, val[3], val[4], val[5], 0)
|
||||
else:
|
||||
raise ValueError("Clock information format error")
|
||||
except:
|
||||
raise ValueError("Clock information format error, use ',' to separate at least 6 numerical values")
|
||||
if isinstance(times, tuple):
|
||||
if 6 <= len(times) <= 8:
|
||||
RTC().datetime((times[0], times[1], times[2], 0, times[3], times[4], times[5], 0))
|
||||
else:
|
||||
raise ValueError("Settime needs a tuple of length 6~8")
|
||||
15
boards/default/micropython/build/lib/object_picture.py
Normal file
15
boards/default/micropython/build/lib/object_picture.py
Normal file
@@ -0,0 +1,15 @@
|
||||
#Take the picture bytes in object_picture.py
|
||||
#--dahanzimin From the Mixly Team
|
||||
|
||||
Bomb=b'P4\n89 64\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x0e\x00\xc0\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x02\x00\x80\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x03\x00\x80\x18\x00\x00\x00\x00\x00\x7f\x00\x00\x01\x80\x800\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x80\x80`\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x80\x80\xc0\x00\x00\x00\x00\x00\x7f\x00\x00\x00A\x01\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00 \x02\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00 \x04\x00\x00\x00\x00\x00\x00\x7f\x00\x00@\x11\x18\x00\x00\x00\x00\x00\x00\x7f\x00\x00p\x000\x00\x00\x00\x00\x00\x00\x7f\x00\x00<\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x02\x80\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00#\xfe\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x01\xe0\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x008\x00\x00\x00\x00\x00\x7f\x00\x00\x00@\x00\x06\x00\x00\x00\x00\x00\x7f\x00\x00\x01\x00\x00\x03\xf8\x00\x00\x00\x00\x7f\x00\x00\x06\x00\x00\x01\xf8\x00\x00\x00\x00\x7f\x00\x000\x08\x00\x03\xfc\x00\x00\x00\x00\x7f\x00\x01\xe0\x10\x00\x07\xfc\x00\x00\x00\x00\x7f\x00\x03\x00\x00\x80\x03\xff\xfe\x00\x00\x00\x7f\x00\x00\x000\x00\x03\xff\xff\xc0\x00\x00\x7f\x00\x00\x00 @\x01\xff\xfcp\x00\x00\x7f\x00\x00\x00@@\x03\xff\xff\x18\x00\x00\x7f\x00\x00\x00@@\x03\xff\xff\xcc\x00\x00\x7f\x00\x00\x00\xc0@\x07\xff\xff\xe6\x00\x00\x7f\x00\x00\x00\x00`\x0f\xff\xff\xf3\x00\x00\x7f\x00\x00\x00\x00 \x1f\xff\xff\xf1\x80\x00\x7f\x00\x00\x00\x00 ?\xff\xff\xf9\x80\x00\x7f\x00\x00\x00\x000?\xff\xff\xff\xc0\x00\x7f\x00\x00\x00\x000\x7f\xff\xff\xff\xc0\x00\x7f\x00\x00\x00\x00\x10\x7f\xff\xff\xff\xe0\x00\x7f\x00\x00\x00\x00\x00\xff\xff\xff\xff\xe0\x00\x7f\x00\x00\x00\x00\x00\xff\xff\xff\xff\xe0\x00\x7f\x00\x00\x00\x00\x00\xff\xff\xff\xff\xe0\x00\x7f\x00\x00\x00\x00\x00\xff\xff\xff\xff\xf0\x00\x7f\x00\x00\x00\x00\x00\xff\xff\xff\xff\xf0\x00\x7f\x00\x00\x00\x00\x00\xff\xff\xff\xff\xf0\x00\x7f\x00\x00\x00\x00\x00\xff\xff\xff\xff\xf0\x00\x7f\x00\x00\x00\x00\x00\xff\xff\xff\xff\xf0\x00\x7f\x00\x00\x00\x00\x00\xff\xff\xff\xff\xe0\x00\x7f\x00\x00\x00\x00\x00\xff\xff\xff\xff\xe0\x00\x7f\x00\x00\x00\x00\x00\xff\xff\xff\xff\xe0\x00\x7f\x00\x00\x00\x00\x00\x7f\xff\xff\xff\xe0\x00\x7f\x00\x00\x00\x00\x00\x7f\xff\xff\xff\xc0\x00\x7f\x00\x00\x00\x00\x00?\xff\xff\xff\xc0\x00\x7f\x00\x00\x00\x00\x00?\xff\xff\xff\x80\x00\x7f\x00\x00\x00\x00\x00\x1f\xff\xff\xff\x80\x00\x7f\x00\x00\x00\x00\x00\x1f\xff\xff\xff\x00\x00\x7f\x00\x00\x00\x00\x00\x0f\xff\xff\xfe\x00\x00\x7f\x00\x00\x00\x00\x00\x07\xff\xff\xfc\x00\x00\x7f\x00\x00\x00\x00\x00\x03\xff\xff\xf8\x00\x00\x7f\x00\x00\x00\x00\x00\x00\xff\xff\xe0\x00\x00\x7f\x00\x00\x00\x00\x00\x00?\xff\xc0\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x0f\xfe\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f'
|
||||
Boom=b'P4\n89 64\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00`\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00p\x00\x06\x00\x00\x00\x00\x7f\x00\x00\x00\x00X\x00\x0e\x00\x00\x00\x00\x7f\x00\x00\x00\x00x\x00\x16\x00\x00\x00\x00\x7f\x00\x00\x00\x00\xcc\x00:\x00\x00\x00\x00\x7f\x00\x00\x00\x00\xae\x00g\x00\x00\x00\x00\x7f\x00\x00\x80\x01\x96\x00k\x00\x00\x00\x00\x7f\x00\x00\xc0\x01\xab\x81\xd5\x00\x00\x00\x00\x7f\x00\x00|\x03U\xff\xa5\x80\x00\x00\x00\x7f\x00\x00v\x06\xaa\xffU\x80\x00\x00\x00\x7f\x00\x00;\xfe\xa9~\xaa\xc3\x02\x00\x00\x7f\x00\x005\xfdU\x02U`\x0c\x00\x00\x7f\x00\x00\x1a\xaa\xaa\xaa\xaa\xb8x\x00\x04\x7f\x01\x00\x15T\xaa\xaa\xa9_\xf0\x00\x04\x7f\x00\x00\x19URT\xa6\xa2\xb0\x00\x00\x7f\x00\x00\x1a\xaa\xa9J\x95\x15`\x00\x00\x7f\x00\x00\x1a\xaa^\xb5n\xea`\x00\x00\x7f\x00\x009U_\x85\x1e\x15\xc0\x00\x00\x7f\x00\x00:\xaa\xae\xf8{\xea\xc0\x00\x00\x7f\x00\x00z\xaa\xad\x7f\xea\xea\xc0\x00\x00\x7f\x00\x01\xf5U.\xaf\xd5u\x80\x00\x00\x7f\x00\x01\xea\xaa\xadj\xaa\xeb\x80\x00\x00\x7f\x00\x0f\xea\xaa\xae\x95UU\x80\x00\x00\x7f\x07\xff\xaaUUe\xaa\xd5\xc0\x00\x00\x7f\x01\xfe\xaa\xa0\x0e\x9auj\xc0\x00\x00\x7f\x00:\xa9_\xf5\xe3\xea\xd5\xc0\x00\x00\x7f\x00\x0e*\xaf\xea\xdeuU`\x00\x00\x7f\x00\x03\x95V\xaa\x80j\xea\xb0\x00\x00\x7f\x00\x01\xea\xabU\x80j\xb5x\x00\x00\x7f\x00\x00\xea\xa9\xaa\x80*\xba\x9c\x00\x00\x7f\x00\x009U\xd5\x00:\xadW\x00\x00\x7f\x00\x00\x1dT\xd5\x00\x1a\xadW\xe0\x00\x7f\x00\x00\x1c\xa5\xd7\x00\x0e\xb7T\x1e\x00\x7f\x00\x00\x0fU\xdd\xc3\xfdOU\xf8\x00\x7f\x00\x00\x06\xaa\xa2\xe5V\xba\xa5\x80\x00\x7f\x00\x00\x03\xa9\xbe\xba\xaa\xb2W\x00\x00\x7f\x00\x00\x03U\xc1ZUj\xac\x00\x00\x7f\x10\x0c\x03\xab\xbfU\xaaj\xac\x00\x00\x7f\x00\x08\x03\xa5\xfb\xaaU\xaa\xa8\x00\x00\x7f\x00\x00\x03\xd5\xd4\xd5\xaar\x98\x00\x00\x7f\x00\x00\x03\x97UtU\xfdX\x1c\x00\x7f\x00\x00\x03\xa8\xaa{\x97\x92\xa8\x0c\x00\x7f\x00\x00\x03UUW\xf5UX\x00\x00\x7f\x00\x00\x07\xaa\xaa\xbd>\xaaL\x00\x00\x7f\x00\x00\x06>\x95YOS\xec\x00\x00\x7f\x00\x00\r\xff\xca\xba\xaa\xaf\xfa\x00\x00\x7f\x00\x00\x1f\x81\xf5Z\xab_\x0e\x00\x00\x7f\x00\x00\x1e\x00uIT\x9c\x03\x00\x00\x7f\x00\xc00\x00:\xaa\xaa\xb8\x00\x00\x00\x7f\x00\x00@\x00\x1a\xaa\xa2\x98\x00\x00\x04\x7f\x00\x00\x00\x00\tH\xfc\x98\x00\x00\x00\x7f\x00\x00\x00\x10\x0e\xab\xffp\x000\x00\x7f\x00\x00\x00\x00\x05O\x83P@\x10\x00\x7f\x00\x00\x00\x80\x06\xbe\x00\xd0 \x00\x00\x7f\x00\x04\x00\x00\x06\xb8\x00p\x00\x00\x00\x7f\x00\x10\x00\x00\x03p\x000\x00\x00\x00\x7f\x00\x00\x00\x00\x03\xe0\x00\x10\x00\x00\x00\x7f\x00\x00\x00\x00\x01\xc0\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x01\x80\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f'
|
||||
Fire=b'P4\n89 64\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x18\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x0e\x00\x00\x00\x00\x00\x7f\x00\x00\x01\x00\x00\x0f\x00\x00\x00\x00\x00\x7f\x00\x00\x03\x00\x00\x0f\x80\x00\x00\x01\x80\x7f\x00\x00\x03\x80\x00\x0f\x80\x00\x00\x03\x80\x7f\x00\x00\x03\xc0\x00\x0f\xc0\x00\x00\x07\x80\x7f\x00\x00\x07\xe0\x00\x1f\xc0\x00\x00\x07\x80\x7f\x00\x00\x07\xf0\x00\x1f\xc0\x00\x00\x07\xc0\x7f\x00\x00\x0f\xf0\x00?\xc0\x00\x00\x03\xc0\x7f\x00\x00\x0f\xf0\x00\x7f\xc0\x00\x00\x03\xe0\x7f\x00\x00\x1f\xf0\x00\xff\xc0\x00\x00\x03\xe0\x7f\x00\x00\x1f\xf0\x01\xff\xc0\x00\x00\x03\xf0\x7f\x00\x00\x1f\xf0\x07\xff\xc0\x00\x00\x03\xf8\x7f\x00\x00\x1f\xe0\x07\xff\xc0\x00\x00\x03\xfc\x7f\x00\x00\x1f\xe0\x0f\xff\xc0\x00\x00\x03\xfc\x7f\x00\x00\x1f\xe0\x0f\xff\xc0|\x00\x07\xfc\x7f\x00\x00\x0f\xe0\x1f\xff\xc3\xfe\x00\x07\xfc\x7f\x00\x00\x07\xc0\x1f\xff\x87\xfc\x00\x0f\xfc\x7f\x00\x00\x01\xc1\x1f\xff\x8f\xf8\x00?\xfc\x7f\x00\x00\x00\xe3\xbf\xef\x9f\xf8\x00\xff\xfc\x7f\x00\x00\x007\xbf\xef\xdf\xf8\x01\xff\xf8\x7f\x00\x00\x00\x0f\xbf\xdf\xff\xf0\x03\xff\xf8\x7f\x00\x00\x00\x1f\xdf\xdf\xfe\xf0\x07\xff\xf0\x7f\x10\x00\x00\x1f\xff\xdf\xff\xf0\x07\xff\x80\x7f\x18\x00\x00\x1f\xff\xaf\xfd\xf0\x0f\x80\x00\x7f\x1c\x00\x04\x1f\xff\xbf\xfb\xe0\x08\x00\x00\x7f\x1e\x00\x1e\x1f\xff\xdf\xfb\xe0\x00\x00\x00\x7f\x1f\x00>\x1f\xff\xaf\xfb\xe0\x00\x00\x00\x7f\x1f\x80~\x1f\xff\xaf\xf7\xe0\x00\x00\x00\x7f\x1f\xc0\x7f\x1f\xff\xaf\xeb\xe0~\x00\x00\x7f\x1f\xf0\x7f\x1f\xff\xd7\xf7\xe1\xfe\x00\x00\x7f\x1f\xf0\xff\x9f\xff\xab\xeb\xe7\xfc\x00\x00\x7f\x0f\xf8\xff\x8f\xbf\xab\xd7\xef\xf8\x00\x00\x7f\x0f\xf8\xff\xcf\xcf\xd5\xd7\xff\xf8\x0e\x00\x7f\x0f\xf8\xff\xef\xf5\xaa\xab\xffp\x7f\x00\x7f\x07\xfc\xff\xff\xf5UW\xfd\xf1\xfe\x00\x7f\x07\xfc\x7f\xff\xf5J\xab\xfe\xe3\xfc\x00\x7f\x03\xfc\x7f\xff\xfa\xf5U\xfd\xe7\xf8\x00\x7f\x01\xfc\x7f\xff\xfe\x9dU\xf5\xef\xf0\x00\x7f\x00\xfc\x7f\xff\xfdF\xaa\xea\xef\xf0\x00\x7f\x00<?\xff\xfdCUu\xff\xe0\x00\x7f\x00\x01?\xbf\xf5CUU\xfd\xe0\x00\x7f\x00\x01?\xab\xd5AUU\xfd\xc0\x00\x7f\x00\x01\x9f\xd5U`\xaa\xaa\xfb\xc0\x00\x7f\x00\x03\xcf\xea\xaa\xa0\xaa\xaa\xf7\x80\x00\x7f\x00\x03\xcf\xd5]`UU\xeb\x80\x00\x7f\x00\x03\xe7\xea\xb5@j\xd5w\x80\x00\x7f\x00\x03\xfb\xea\xa6\xc0+\xaa\xef\x80\x00\x7f\x00\x03\xff\xea\xa3@jUO\x80\x00\x7f\x00\x03\xff\xf5B\xc0J\xaa\xbf\x80\x00\x7f\x00\x03\xff\xfa\xa2\x804\xd5O\x80\x00\x7f\x00\x01\xff\xfda\x80,\xaa\xbf\x80\x00\x7f\x00\x01\xfe\xfa\xa1\x00(\xd5_\x80\x00\x7f\x00\x01\xfe\xad \x00p\xaa\xbf\x80\x00\x7f\x00\x00\xff\xaa\xe0\x00@\xd7_\x80\x00\x7f\x00\x00\x7fU \x00\x00\xaa\xbf\x00\x00\x7f\x00\x00\x7f\xd5\xf0\x00\x01\xb2\xbf\x00\x00\x7f\x00\x00?\xd5\xb8\x00\x01b\xbf\x00\x00\x7f\x00\x00\x0f\xf5@\x00\x03\x82\xbe\x00\x00\x7f\x00\x00\x03\xfa\xa0\x00\x00\x05~\x00\x00\x7f\x00\x00\x00\xfa\xb0\x00\x00\x06\xfc\x00\x00\x7f\x00\x00\x00}P\x00\x00\x05x\x00\x00\x7f'
|
||||
Flowers=b'P4\n89 64\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x07\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x0f\x80\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x1f\xc0\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00?\xc3\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00?\xcf\xc0\x7f\x00\x00\x00\x00\x00\x00\x00\x0f\x7f\xdf\xc0\x7f\x00\x00\x00\x00\x00\x00\x00\x1f\xff\xdf\xe0\x7f\x00\x00\x00\x00\x00\x00\x00?\x7f\xff\xe0\x7f\x00\x00\x00\x00\x00\x00\x00\x7f\xff\xdf\xc0\x7f\x00\x00\x0c\x00\x00\x00\x00\x7f\x7f\xff\x90\x7f\x00\x00\x1c\x00\x00\x00\x00\xff\x7f\xfe|\x7f\x00\x06\x1c\x00\x00\x00\x00\xff\x7f\xbc\xfe\x7f\x00\x07\x1c\x00\x00\x00\x00\xffw9\xfe\x7f\x01\xc7\x1c\x18\x00\x00\x00\xffR{\xfe\x7f\x01\xe3\x9c\x1c\x00\x00\x00\x7f\x0co\xfe\x7f\x00\xf3\x9c8\x00\x00\x00}\x7f\x0f\xfc\x7f\x10y\x8cp\x00\x00\x00~\xff\x9f\xf0\x7f<<\xccq\x80\x00\x0f\xbc\xff\xc7\x80\x7f?\x1c\xcc\xe7\xc0\x00\x1f\xcc\xff\xc0\x00\x7f\x1f\xceH\xcf\x80\x00?\xe0\xff\xdf\x00\x7f\x07\xe6I\x9e\x00\x00?\xfc\xff\xaf\xf8\x7f\x00\xf9\t<\x00\x00?\xfb\x7f7\xfe\x7f<\x1c"p\x00\x00?\xff\x00\x1f\xfe\x7f?\xc0\xd1\x87\xe0\x00?\xfe\x01\x9f\xff\x7f?\xfd\xb8?\x80\x00\x1f\xfc)\xcf\xff\x7f\x00\x01\xf9\xfc\x00\x00\x07\xf1g\xef\xff\x7f\x00\x01\xec\x00\x00\x00\x00\x03\xdf\xf7\xfe\x7f\x07\xf0\xf8\x00\x00\x00\x00\x0f\xd7\xf3\xfc\x7f\x1f\xc20\xff\xe0\x00\x00\x7f\xef\xf9\xf8\x7f?\x07\x0b?\xe0\x00\x03\xff\xef\xf8@\x7f<\ri\x80\xc0\x00\x03\xff\xef\xf8\x00\x7f\x00\x1fm\xc0\x00\x00\x03\xff\xcf\xf8\x00\x7f\x00?l\xe0\x00\x00\x03\xff\x8f\xf8\x00\x7f\x00~\xeep\x00\x00\x01\xff\x0f\xf8\x00\x7f\x01\xee\xeex\x00\x00\x00\xfc\x0f\xf0\x00\x7f\x03\xde\xef<\x00\x00\x00\x00\x07\xf0\x00\x7f\x03\x9c\xe7\x1c\x06\x00\x00\x00\x07\xe4\x00\x7f\x00\x1d\xf7\x00\xce\x00\x00\x00\x03\xcc\x00\x7f\x00=\xd7\x04f \x00\x00\x00\x04\x00\x7f\x00\x19\xd6\x07fp\x00\x00\x00\x06\x00\x7f\x00\x00\x80\x03$`\x00\x00\x00\x02\x00\x7f\x00\x00 9\x94\xcc\x00\x0f\x00\x03\x00\x7f\x00\x00 <\xd4\x9c\x00?\x80\x01\x00\x7f\x00\x00 \x0fEp\x1e\x7f\x80\x01\x00\x7f\x03\x00 0\x81@?\xbb\xb0\x01\x80\x7f\x03`@\x7f\x9c>\x1d\x7f\xb8\x00\x80\x7f\x00\xe0@\x00<\xf0\x1e\xef\xf8\x00\x80\x7f\x00x@\x07=\x00\x1f\xd7\xdc\x00\xc0\x7f\x000\xc0<H\xfe\x1fw\xfc\x00@\x7f\x00\x1c\x80x\xd3\x0e\x1d\xef\xf8\x00@\x7f\x00\x1c\x80\x01\xd5\x80\x1f\xab\xb8\x00`\x7f\x00\x0c\x80\x03\xd6\xc0=\xef\xe0\x00 \x7f\x00\x05\x80\x07\xf6`\x7f}\xe0\x00 \x7f\x00\x01\x00\r\xbb0\x7f\xbf\xe0\x000\x7f\x00\x01\x01\xc1\xbb\x00\x87\xff\xc0\x000\x7f\x00\x01\x03\x81\xb3\x00\x03\xbf\x80\x00\x10\x7f\x00\x01\x0f\xc0\x00\x00\x01\xdb\x80\x00\x10\x7f\x00\x03\x0f\xe0\x08\x00\x00<\x00\x00\x18\x7f\x00\x02\x1f\x00\x08\x00\x00\x0c\x00\x00\x18\x7f\x00\x02?\x00\x10\x00\x00\x0c\x00\x00\x18\x7f\x00\x02>\x00\x10\x00\x00\x04\x00\x00\x08\x7f\x00\x02p\x00\x10\x00\x00\x04\x00\x00\x08\x7f'
|
||||
Forest=b"P4\n89 64\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00 \x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00 \x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00 \x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00 \x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00p\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\xf8\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x01\xfc\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00~\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00z\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\xf8\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x01\xfe\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x07\xff\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x0f\xff\xc0\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\xff\xc0\x00\x00\x00\x00\x06\x00\x00\x7f\x00\x00\xfe\x00\x00\x00\x08\x00\x06\x00\x00\x7f\x00\x03\xff\x00\x00\x00\x0c\x89\x9d\x83\x00\x7f\x00\x0f\xff\x80\x00\x00\x07\x8d\x8b\x0e\x00\x7f\x00\x1f\xff\xc0\x00\x19a\xb0\x04\xc9\x80\x7f\x00?\xff\xf0\x00\x1b\x1aV\x1a\xb3\x90\x7f\x00\x7f\xff\xf0\x00\x06\xef\x84A\x14\x10\x7f\x00\xff\xff\xf8\x00\x1a`\xbb\x14\x8b\x10\x7f\x00\x01\xff\x04\x00P\x1b\x89d\xf4\x06\x7f\x00\x03\xff\x80\x00f\xe2\x91 d\x9e\x7f\x00\x0f\xff\xc0\x00\x018\xeb\xc7\xe0`\x7f\x00\x1f\xff\xf0\x00\xc4\xc1\xa8\xcc\xe1\xa8\x7f\x00?\xff\xf8\x04\xd6}\xb1\x15aL\x7f\x00\x7f\xff\xfe\x0e!/A\xe5`\xb0\x7f\x00\xff\xff\xff\x80\xd4'\x06 o0\x7f\x01\xfd\xff\xc1\xc35[\x06\xb0{\x00\x7f\x03\xe1\xff\xe0\x02\xb1\x13\xc1\xa0\xe10\x7f\x03\x87\xff\xf0\x01\xb0\x01\xe0\x03\xe6\xcc\x7f\x04\x1f\xff\xfc\x000\x03\xf8?\xc4Y\x7f\x00?\xff\xff\x80\x98\x07\xfc\xff\x81\x8b\xff\x00\x7f\xff\xff\xe3d\x1f\xfd\xfc\x01h\x7f\x01\xff\xff\xff\xc0\xe7\xfe?\xc0\x88L\x7f\x07\xff\xff\xfc\x0e\xa1\xf0\x0f\x84\x98\x0c\x7f\x1f\xf7\xff\xf0\x06X\xc0\x0f\x86\n\x00\x7f\x1f\xe7\xff\xf0\x03I\x80\x07\x81\x17\x00\x7f\x00\x07\xff\xf8\x03/@\x07\x81 0\x7f\x00\x0f\xff\xfc\x00\xb4@\x0f\x80\xcd\xe0\x7f\x00?\xff\xfe\x03\xe4\x80\x0f\x86\xc0(\x7f\x00\xff\xff\xff\x02c\x00?\x82\x87\xdc\x7f\x03\xff\xff\xff\x80\xc5\x07\xff\xfd\x8d@\x7f\x07\xe7\xff\xc7\xf0\x16?\xff\xff\xf9\xe0\x7f\x1c\x0f\xff\xe0x\x12\x7f\xfe\x0f\xf8\x80\x7f\x00?\xff\xf0\x00\x11\xff\xf8\x02\x84@\x7f\x00\x7f\xff\xfc\x00\x01\xff\xe0\x02D\xc0\x7f\x00\xff\xff\xfe\x00\x03\xff\x00\x02\xca\x80\x7f\x01\xff?\xff\x80\x07\xfe\x00\x00\x19p\x7f\x03\xfc;\xff\xe0\x07\xfc\x00\x00\x13 \x7f\x0f\xf08\xff\xf8\x0f\xf8\x00\x00\x02\xc0\x7f\x7f\x008\x0f\xff\x1f\xf8\x00\x00\x02\xc0\x7f\x00\x008\x00\x00\x1f\xf8\x00\x00\x00\x00\x7f\x00\x008\x00\x00?\xf8\x00\x00\x00\x00\x7f\x00\x008\x00\x0e\x7f\xf9\x00\x00\x00\x00\x7f\x00\x008\x00\xff\xff\xff\x80\x00\x00\x00\x7f\x00\x008\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x008\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x000\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f"
|
||||
Lightning=b'P4\n89 64\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x01\xff\xff\xf8\x00\x00\x00\x7f\x00\x00\x00\x00\x01\xff\xf0\x18\x00\x00\x00\x7f\x00\x00\x00\x00\x01\xff\xff\x90\x00\x00\x00\x7f\x00\x00\x00\x00\x03\xff\xff\xa0\x00\x00\x00\x7f\x00\x00\x00\x00\x03\xff\xff@\x00\x00\x00\x7f\x00\x00\x00\x00\x03\xff\xfe\xc0\x00\x00\x00\x7f\x00\x00\x00\x00\x07\xff\xfe\x80\x00\x00\x00\x7f\x00\x00\x00\x00\x07\xff\xfd\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x0f\xff\xfb\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x0f\xff\xfa\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x0f\xff\xf4\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x1f\xff\xfc\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x1f\xff\xe8\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x1f\xff\xf0\x00\x00\x00\x00\x7f\x00\x00\x00\x00?\xff\xa0\x00\x00\x00\x00\x7f\x00\x00\x00\x00?\xff\xe0\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x7f\xff\xc0\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x7f\xff\x80\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x7f\xff\x80\x00\x00\x00\x00\x7f\x00\x00\x00\x00\xff\xff\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\xff\xff\xff\xf8\x00\x00\x00\x7f\x00\x00\x00\x00\xff\xff\xff\x90\x00\x00\x00\x7f\x00\x00\x00\x01\xff\xff\xff\xb0\x00\x00\x00\x7f\x00\x00\x00\x01\xff\xff\xff`\x00\x00\x00\x7f\x00\x00\x00\x03\xff\xff\xfe\xc0\x00\x00\x00\x7f\x00\x00\x00\x03\xff\xff\xfc\x80\x00\x00\x00\x7f\x00\x00\x00\x03\xff\xff\xf9\x00\x00\x00\x00\x7f\x00\x00\x00\x07\xff\xff\xfa\x00\x00\x00\x00\x7f\x00\x00\x00\x07\xff\xff\xf4\x00\x00\x00\x00\x7f\x00\x00\x00\x07\xff\xff\xec\x00\x00\x00\x00\x7f\x00\x00\x00\x0f\xff\xff\xd8\x00\x00\x00\x00\x7f\x00\x00\x00\x0f\xff\xff\xf0\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x03\xff \x00\x00\x00\x00\x7f\x00\x00\x00\x00\x03\xff\xc0\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x03\xfe\x80\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x07\xff\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x07\xff\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x0f\xfe\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x0f\xfc\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x0f\xf8\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x1f\xf0\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x1f\xe0\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00?\xc0\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00?\xc0\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00?\x80\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00~\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\xfc\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\xf8\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x01\xf0\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x01\xf0\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x01\xe0\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x03\xc0\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x03\x80\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x07\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x06\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x04\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x08\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f'
|
||||
Light_off=b'P4\n89 64\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x1e\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\xff\xc0\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x03\xd5p\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x07J\xb8\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x1c\xb5\\\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x1bEV\x00\x00\x00\x00\x7f\x00\x00\x00\x004\n\xab\x00\x00\x00\x00\x7f\x00\x00\x00\x00tUU\x00\x00\x00\x00\x7f\x00\x00\x00\x00h\xaa\xab\x80\x00\x00\x00\x7f\x00\x00\x00\x00\xd1UU\x80\x00\x00\x00\x7f\x00\x00\x00\x00\xd2\xaa\xaa\xc0\x00\x00\x00\x7f\x00\x00\x00\x00\xa2\xaa\xaa\xc0\x00\x00\x00\x7f\x00\x00\x00\x01\xa5UU@\x00\x00\x00\x7f\x00\x00\x00\x01\xd2\xaa\xaa\xc0\x00\x00\x00\x7f\x00\x00\x00\x01\xa5UU@\x00\x00\x00\x7f\x00\x00\x00\x01\xaa\xaa\xaa\xc0\x00\x00\x00\x7f\x00\x00\x00\x00\xd5UU\xc0\x00\x00\x00\x7f\x00\x00\x00\x00\xd5UT\x80\x00\x00\x00\x7f\x00\x00\x00\x00\xd5UW\x80\x00\x00\x00\x7f\x00\x00\x00\x00j\xaa\xa9\x80\x00\x00\x00\x7f\x00\x00\x00\x00eUW\x00\x00\x00\x00\x7f\x00\x00\x00\x00=US\x00\x00\x00\x00\x7f\x00\x00\x00\x002\xaa\xae\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x1dUV\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x1a\xaa\xac\x00\x00\x00\x00\x7f\x00\x00\x00\x00\rU\\\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x0e\xaa\xa8\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x05UX\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x06\xaa\xb8\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x06\xaa\x90\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x06Up\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x03\xaa\xb0\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x03U`\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x03\xaa\xa0\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x03U`\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x01\xff\xe0\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\xff\x80\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x7f\x80\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x01\xff\xc0\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x80\xc0\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\xff\xc0\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\xff\xc0\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x83\x80\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x01\xff\xc0\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\xff\x80\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00>\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x1e\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f'
|
||||
Light_on=b'P4\n89 64\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x04\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x0c\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x0c\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x0c\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x0c\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x0c\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x0c\x00\x00\x00\x00\x00\x7f\x00\x00\x00\xc0\x00\x0c\x00\x02\x00\x00\x00\x7f\x00\x00\x00`\x00\x00\x00\x06\x00\x00\x00\x7f\x00\x00\x000\x00\x00\x00\x0c\x00\x00\x00\x7f\x00\x00\x00\x18\x00\x00\x00\x18\x00\x00\x00\x7f\x00\x00\x00\x0c\x00\x1e\x000\x00\x00\x00\x7f\x00\x00\x00\x06\x00\xff\xc0`\x00\x00\x00\x7f\x00\x00\x00\x02\x03\x80p\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x06\x00\x18\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x18\x00\x0c\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x100\x06\x00\x00\x00\x00\x7f\x00\x00\x00\x000\xe0\x03\x00\x00\x00\x00\x7f\x00\x00\x00\x00a\x80\x01\x00\x00\x00\x00\x7f\x00\x00\x00\x00B\x00\x01\x80\x00\x00\x00\x7f\x00\x00\x00\x00\xc6\x00\x00\x80\x00\x00\x00\x7f\x00\x00\x00\x00\x84\x00\x00\xc0\x00\x00\x00\x7f\x00\x00\x00\x00\x8c\x00\x00\xc0\x00\x00\x00\x7f\x00\x00\x00\x01\x8c\x00\x00@\x00\x00\x00\x7f\x00\x00\x00\x01\x88\x00\x00@\x00\x00\x00\x7f\x00\x00\x00\x01\x80\x00\x00@\xfe\x00\x00\x7f\x00\x00\x7f\xc1\x80\x00\x00A\xfe\x00\x00\x7f\x00\x00\x00\x00\x80\x00\x00\xc0\x00\x00\x00\x7f\x00\x00\x00\x00\xc0\x00\x00\x80\x00\x00\x00\x7f\x00\x00\x00\x00\xc0\x00\x00\x80\x00\x00\x00\x7f\x00\x00\x00\x00@\x00\x01\x80\x00\x00\x00\x7f\x00\x00\x00\x00`\x00\x01\x00\x00\x00\x00\x7f\x00\x00\x00\x00 \x00\x03\x00\x00\x00\x00\x7f\x00\x00\x00\x000\x00\x02\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x10\x00\x06\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x18\x00\x04\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x08\x00\x0c\x0c\x00\x00\x00\x7f\x00\x00\x00\x18\x0c\x00\x08\x06\x00\x00\x00\x7f\x00\x00\x000\x04\x00\x08\x03\x00\x00\x00\x7f\x00\x00\x00`\x04\x00\x18\x01\x80\x00\x00\x7f\x00\x00\x00\xc0\x06\x00\x10\x00\xc0\x00\x00\x7f\x00\x00\x01\x80\x06\x00\x10\x00`\x00\x00\x7f\x00\x00\x01\x00\x02\x000\x00 \x00\x00\x7f\x00\x00\x00\x00\x02\x00 \x00\x00\x00\x00\x7f\x00\x00\x00\x00\x03\x00 \x00\x00\x00\x00\x7f\x00\x00\x00\x00\x03\x00 \x00\x00\x00\x00\x7f\x00\x00\x00\x00\x01\xff\xe0\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\xff\x80\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x7f\x80\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x01\xff\xc0\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x80\xc0\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\xff\xc0\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\xff\xc0\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x83\x80\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x01\xff\xc0\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\xff\x80\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00>\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x1e\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f'
|
||||
Night=b'P4\n89 64\n\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfd\x7f\xff\xff\xff\xfe\x00\x7f\xff\xdf\xff\xff\xf7\xdf\xff\xff\xff\xe0\x00?\xff\xff\xff\xff\xef\xff\xff\xff\xff\x80\x01\xff\xff\xff\xff\x7f\xff\xef\xff\xff\xfe\x00\x07\xff\xff\xff\xff?\xdf\xff\xff\xff\xfc\x00\x0f\xff\xff\xff\xfe\x1f\xff\xff\xff\xff\xf8\x00?\xff\x87\xff\xfe?\xdf\xff\xff\xff\xf0\x00\x7f\xff\xcf\xff\xfe?\xff\xef\xff\xff\xe0\x00\xff\xff\xcf\xff\xff\xff\xef\xdf\xff\xff\xc0\x01\xff\xff\xff\xff\xff\xff\xfb\xbf\xff\xff\x80\x01\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x80\x03\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x07\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x07\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\x00\x0f\xff\xff\xff\xfd\xff\xff\xff\xff\xff\xfe\x00\x0f\xff\xff\xff\xf9\xff\xff\xff\xff\xff\xfc\x00\x0f\xff\xff\xff\xe0?\xff\xcf\xff\xff\xfc\x00\x1f\xff\xff\xff\xe0?\xff\x87\xff\xff\xfc\x00\x1f\xff\xff\xff\xf0\x7f\xff\x8f\xff\xff\xfc\x00\x1f\xff\xff\xff\xf0\x7f\xff\xcf\xff\xff\xfc\x00\x1f\xff\xff\xff\xf2\x7f\xbf\xff\xff\xff\xf8\x00?\xff\xff\xff\xff\xff\xbf\xff\xff\xff\xf8\x00?\xfd\xff\xff\xff\xff\xff\xff\xff\xff\xf8\x00?\xff\xff\xff\xff\xff\xff\xff\xff\xff\xf8\x00?\xff\xff\xff\xff\xff\xff\xff\xff\xff\xf8\x00?\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfc\x00\x1f\xff\xf5\xfb\xff\xff\xff\xf9\xff\xff\xfc\x00\x1f\xff\xee\xfb\xff\xff\xff\xff\xff\xff\xfc\x00\x1f\xff\xee\xff\xff\xff\xff\xff\xff\xff\xfc\x00\x1f\xff\xf5\xff\xff\xff\xff\xff\xff\xff\xfe\x00\x1f\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\x00\x0f\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\x00\x0f\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x07\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x00\x07\xff\xff\xff\xff\xff\xff\xfd\xff\xff\xff\x80\x03\xff\xef\xff\xff\xff\xff\xff\xff\xff\xff\xc0\x03\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc0\x01\xff\xff\xfe\x7f\xff\xff\xff\xff\xff\xff\xe0\x00\xff\xff\xfe\x7f\xff\xff\xff\xff\xff\xff\xf0\x00\x7f\xff\xfc?\xff\xff\xff\xff\xff\xff\xf8\x00?\xff\xe0\x07\xff\xff\xff\xff\xff\xff\xfe\x00\x1f\xff\xc0\x03\xff\xff\xff\xff\xff\xff\xff\x00\x0f\xff\xe0\x07\xff\xff\xff\xbf\xff\xff\xff\xc0\x03\xff\xf0\x0f\xff\xf7\xff\x0f\xff\xff\xff\xf8\x00\x7f\xf8\x0f\xff\xff\xff\x1f\xff\xff\xff\xff\x83\xff\xf0\x0f\xff\xff\xff\x1f\xff\xff\xff\xff\xff\xff\xf0\x0f\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xf3\xcf\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x7f\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe\x7f\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xf8\x0f\xff\xff\xfd\x7f\xff\xf1\xff\xff\xff\xff\xf8\x1f\xff\xff\xfb\xbf\xff\xf9\xff\xff\xff\xff\xfc?\xff\xff\xfb\xbf?\xff\xff\xff\xff\xff\xfc\x1f\xff\xff\xfd\x7f?\xff\xff\xff\xff\xff\xfd\x9f\xff\xff\xff\xff?\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff'
|
||||
Pirate=b'P4\n89 64\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\xff\xc0\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x0f\xff\xfc\x00\x00\x00\x00\x7f\x00\x00\x00\x00?\xff\xfe\x00\x00\x00\x00\x7f\x00\x00\x00\x00\xff\xff\xfb\x80\x00\x00\x00\x7f\x00\x00\x00\x01\xff\xff\xf8\xc0\x00\x00\x00\x7f\x00\x00\x00\x03\xff\xff\xfe`\x00\x00\x00\x7f\x00\x00\x00\x07\xff\xff\xff\xb8\x00\x00\x00\x7f\x00\x00\x00\x0f\xff\xff\xff\xd8\x00\x00\x00\x7f\x00\x00\x00\x1f\xff\xff\xff\xec\x00\x00\x00\x7f\x00\x00\x00\x1f\xff\xff\xff\xee\x00\x00\x00\x7f\x00\x00\x00?\xff\xff\xff\xf6\x00\x00\x00\x7f\x00\x00\x00?\xff\xff\xff\xf6\x00\x00\x00\x7f\x00\x00\x00?\xff\xff\xff\xff\x00\x00\x00\x7f\x00\x00\x00?\xff\xff\xff\xff\x00\x00\x00\x7f\x00\x00\x00\x7f\xff\xff\xff\xff\x00\x00\x00\x7f\x00\x00\x00\x7f\xff\xff\xff\xff\x00\x00\x00\x7f\x00\x00\x00\x7f\xff\xff\xff\xff\x00\x00\x00\x7f\x00\x00\x00\x7f\xf9\xff\xe7\xff\x00\x00\x00\x7f\x00\x00\x00\x7f\xc0\x7f\x80\xff\x00\x00\x00\x7f\x00\x00\x00\x7f\xc0?\x00\xff\x00\x00\x00\x7f\x00\x00\x00\x7f\x80\x1e\x00\x7f\x00\x00\x00\x7f\x00\x00\x00\x7f\x80\x1e\x00\x7f\x00\x00\x00\x7f\x00\x00\x00\x7f\x80\x1e\x00\x7f\x00\x00\x00\x7f\x00\x00\x00\x7f\x80\x1e\x00\x7f\x00\x00\x00\x7f\x00\x00\x00?\x80\x1e\x00\x7f\x00\x00\x00\x7f\x00\x00\x00?\xc0?\x00\xff\x00\x00\x00\x7f\x00\x00\x00?\xe0s\x81\xfe\x00\x00\x00\x7f\x00\x00\x00\x1f\xf1\xf1\xe3\xfe\x00\x00\x00\x7f\x00\x00\x00\x1f\xff\xe1\xff\xfc\x00\x00\x00\x7f\x00\x00\x00\x0f\xff\xe0\xff\xf8\x00\x00\x00\x7f\x00\x00\x00\x01\xff\xc0\xff\xe0\x00\x00\x00\x7f\x00\x00\x00\x01\xff\xc0\x7f\xc0\x00\x00\x00\x7f\x00\x00\x00\x01\xff\xc0\x7f\xc0\x00\x00\x00\x7f\x00\x00\xf0\x00\xff\xff\xff\xc0\x00\x00\x00\x7f\x00\x00\xf0\x00\xff\xff\xff\x80\x00\xf0\x00\x7f\x00\x00\xf8\x00\x07\xff\xf8\x00\x01\xf0\x00\x7f\x00\x00\xf8\x00\x07\xff\xf8\x00\x03\xf0\x00\x7f\x00\x01\xff\x00\x07\xf7\xf8\x00\x07\xe0\x00\x7f\x00\x03\xff\xe0\x06s\x98\x00?\xf0\x00\x7f\x00\x03\xff\xfe\x00s\x98\x01\xff\xf8\x00\x7f\x00\x07\xff\xff\xc0!\x00\x1f\xff\xfc\x00\x7f\x00\x03\xf1\xff\xf8\x00\x01\xff\xf1\xfc\x00\x7f\x00\x03\xf0?\xff\x00\x0f\xff\x81\xf8\x00\x7f\x00\x01\xe0\x07\xff\xf0\x07\xfc\x01\xf8\x00\x7f\x00\x00\x00\x00\xff\xfe\x00`\x00\x00\x00\x7f\x00\x00\x00\x00\x1f\xff\xe0\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x03\xff\xfc\x00\x00\x00\x00\x7f\x00\x00p\x01\xc0\x7f\xff\xc0\x00\x00\x00\x7f\x00\x00\xfc\x1f\xf8\x0f\xff\xf8\x03\xe0\x00\x7f\x00\x01\xfd\xff\xfe\x01\xff\xff\x87\xf0\x00\x7f\x00\x03\xff\xff\xfe\x00?\xff\xff\xf0\x00\x7f\x00\x03\xff\xff\xf0\x00\x07\xff\xff\xf0\x00\x7f\x00\x01\xff\xff\x80\x00\x00\xff\xff\xf0\x00\x7f\x00\x00\xff\xfc\x00\x00\x00\x1f\xff\xf0\x00\x7f\x00\x00?\xc0\x00\x00\x00\x03\xff\xe0\x00\x7f\x00\x00?\x00\x00\x00\x00\x00\x7f\x80\x00\x7f\x00\x00?\x00\x00\x00\x00\x00\x1f\x00\x00\x7f\x00\x00?\x00\x00\x00\x00\x00\x1f\x00\x00\x7f\x00\x00\x1e\x00\x00\x00\x00\x00\x1f\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x0e\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f'
|
||||
Snow=b'P4\n89 64\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\r\xc0\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x0c\xc0\x00\x02\x00\x7f\x00\x00\x00\x00\x00\x00\x13 \x00\x04\x00\x7f\x00\x00\x00\x00\x00\x00?\xf0\x00"`\x7f\x00\x10\x00\x00\x00\x00\x13`\x00\x1a\xc0\x7f\x00|\x00\x00\x00\x00\x04\x80\x00\x16\x00\x7f\x020\x80\x00\x01\x00\x0e\xc0\x00\x0f\x00\x7f\x02\xde\xc0\x00\x03\x00\x02\x80\x00\x1a\xc0\x7f\x0e\xba\xe0\x003\x18\x00\x00\x00$@\x7f\x07\xbb\xc0\x00;p\x00\x00\x00\x02\x00\x7f\t\xff0\x00\x1f\xe0\x00\x00\x00\x040\x7f\x03m\x80\x0c\x07\xc0@\x00\x00\x00x\x7f\x02\xee\xc0\x0c#\x10\xc0\x00\x00\x00p\x7f\r\xff\xb0\x0c{|\xc0\x00\x00\x00\x00\x7f\x07\xff\xc0l\xff\xfc\xcc\x00\x02\x00\x00\x7f\x0e\xba\xe0\xfc\xcf\xcc\xfc\x00\x1b`\x00\x7f\x02\xfe\x80<\xd3\xac\xf0\x00\x1f\xc0\x00\x7f\x02\x10\x80\x1f\xdbo\xf0\x00\x0f\xc0\x00\x7f\x00|\x00\x7f\xcf\xef\xfc\x08\x07\x00\x80\x7f\x00T\x00\xf1\xff\xff\x1e\x08\x03\x00\xc0\x7f\x00\x10\x00\x07\xff\xff\x80\x0c\x13 \x80\x7f\x00\x00\x00\x0f?\xf3\xe0<{y\xb0\x7f\x00\x00\x00\x1c\xfc\xfd\xe0<\x7f\xd9\xe0\x7f\x00\x00\x00\x0c\xfc~ ?g\x93\xe0\x7f\x00\x00\x00\x1e<\xf0\xe0\xff\xa77\xf8\x7f\x00\x80\x00\x07\xff\xfb\xc0\xe1\xe3>8\x7f\x00\x00\x00\xe3\xff\xff\x1e\x00\xfb|\x00\x7f\x02\xe0\x00\xff\xcf\xef\xbc\x03\xff\xff\x00\x7f\x01\x80\x00?\xdbo\xf0\x06\x0f\x83\x00\x7f\x00@\x00>\xd3,\xf8\x07\x9f\xc3\x00\x7f\x00\x80\x00|\xcf\xcc\xfc\x03\xff\xff\x00\x7f\x00\x00@\xec\xff\xfc\xce\x80\xf3<\x00\x7f\x00\x00\xc0\x0c\xfb|\xc0\xf9\xe3>x\x7f\x00\x00\xe0\x0c#\x10\xc0\x7f\'7\xf8\x7f\x00\x03\xf0\x0c\x07\xc0@>o\x91\xe0\x7f\x00\x03\xf0\x00\x1f\xe0\x00<{\xd9\xf0\x7f\x00\n\xd0\x00;\xf0\x00,{q\xa0\x7f\x00\x1e\xde\x0038\x00\x0c\x03\x00\xc0\x7f\x0e\x9c\xce|\x03\x00\x00\x08\x03\x00\xc0\x7f\x07\x87\xf8|\x01\x00\x00\x08\x07\x00\x80\x7f\x05\x8f\xdc|\x00\x00\x00\x00\x0f\xc0\x00\x7f\x03\xfe\xde\xf8\x00\x00\x00\x00\x1f\xe0\x00\x7f\x009\xf3\x10\x00\x00\x00\x00\x1b`\x00\x7f\x01\x9f\xff \x00\x00\x00\x00\x00\x00\x00\x7f\x00\xa7\xf9`\x00\x00\x00\x00\x10\x00\x00\x7f\x01\xff\xff\xe0\x00\x00\x00\x00\\\x00\x00\x7f\x01\xff\xff\xf0\x00\x00\x00\x008\x00\x00\x7f\x00\xa7\xfd`\x00\x00\x00\x02T\x80\x00\x7f\x01\x9d\xff \x00\x00\x00\x0e\xfe\xe0\x00\x7f\x033\xf3\x98\x00\x00\x00\x07\x9b\xc0\x00\x7f\x05\xde\xde\xe0\x00\x00\x00\r\xffp\x00\x7f\x07\x87\xd8|\x00\x02\x00\x03\x7f\x80\x00\x7f\x0f\xaf\xfd|\x00\x00\x00\x02\xee\xc0\x00\x7f\x02\x8c\xce0\x00\x12 \x03\xff\x80\x00\x7f\x00\x1e\xce\x00\x00\t\x80\r\xffp\x00\x7f\x00\x02\xc8\x00\x00\x07\x00\x07\xbb\xc0\x00\x7f\x00\x01\xf0\x00\x00\x0b\x80\x0e\xfe\xe0\x00\x7f\x00\x03\xd0\x00\x00\x19`\x02\xd4\x80\x00\x7f\x00\x01\xe0\x00\x00\x00\x00\x008\x80\x00\x7f\x00\x00\xe0\x00\x00\x03\x00\x00\\\x00\x00\x7f\x00\x00\xc0\x00\x00\x00\x00\x00\x10\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f'
|
||||
Target=b"P4\n89 64\n\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x01\xff\xe0\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x1f\xff\xfc\x00\x00\x00\x00\x7f\x00\x00\x00\x00\xff\xfb\xff\x80\x00\x00\x00\x7f\x00\x00\x00\x03\xf8\x08\x1f\xe0\x00\x00\x00\x7f\x00\x00\x00\x07\xe1\x00\x01\xf0\x00\x00\x00\x7f\x00\x00\x00\x1f\x10\x84 \xfc\x00\x00\x00\x7f\x00\x00\x00<\x00B\x10\x1e\x00\x00\x00\x7f\x00\x00\x00x\x84!\x08O\x00\x00\x00\x7f\x00\x00\x00\xe0B\x10\x84\x03\x80\x00\x00\x7f\x00\x00\x01\xe4!\x08B\x13\xc0\x00\x00\x7f\x00\x00\x03\x82\x10\x84!\x01\xe0\x00\x00\x7f\x00\x00\x07\xa1\x08B\x10\x84\xf0\x00\x00\x7f\x00\x00\x0e\x10\x84 \x08@x\x00\x00\x7f\x00\x00\x0e\x08B\x0c\x84!8\x00\x00\x7f\x00\x00\x1c\x84 \x08B\x10\x1c\x00\x00\x7f\x00\x008B\x10\xff\x01\x08N\x00\x00\x7f\x00\x008!\x03\xff\xe0\x84\x0e\x00\x00\x7f\x00\x00r\x10\x8f\x89\xf8B\x17\x00\x00\x7f\x00\x00q\x08\x1eU<!\x07\x00\x00\x7f\x00\x00p\x849UN\x10\x87\x00\x00\x7f\x00\x00\xe0BuUW\x08C\x80\x00\x7f\x00\x00\xe4 \xea\xaa\xab\x84#\x80\x00\x7f\x00\x00\xc2\x10\xca\xaa\xa9\x82\x03\x80\x00\x7f\x00\x01\xc1\t\xd5UU\xc1\t\xc0\x00\x7f\x00\x01\xc0\x81\x95R\xaa\xc0\x85\xc0\x00\x7f\x00\x01\xc8C\xaa\xadT\xe8A\xc0\x00\x7f\x00\x01\xc4#\xaa\xd2\xaa\xe0!\xc0\x00\x7f\x00\x01\xc2\x13U*\xaab\x11\xc0\x00\x7f\x00\x01\xc1\x03*\xc9Ui\x08\xc0\x00\x7f\x00\x07\xe0\x8f\xd5>\xaa\xf8\x83\xf0\x00\x7f\x00\x01\xc8\x0b\x15MUp@\xe0\x00\x7f\x00\x01\x84'j\xaa\x95d!\xc0\x00\x7f\x00\x01\xc2\x03\x95Ujb\x01\xc0\x00\x7f\x00\x01\xc1\x0b\xaa\xaa\x92\xe1\t\xc0\x00\x7f\x00\x01\xc0\x81\xaa\xb6n\xc0\x85\xc0\x00\x7f\x00\x01\xc8C\xd5I\x91\xc8A\xc0\x00\x7f\x00\x00\xe4 \xd56m\x84!\x80\x00\x7f\x00\x00\xe2\x10\xea\xc9\x93\x82\x13\x80\x00\x7f\x00\x00\xe1\x08u6w!\x03\x80\x00\x7f\x00\x00`\x849\xc9\x8e\x10\x87\x00\x00\x7f\x00\x00pB\x1e6<\x08G\x00\x00\x7f\x00\x00t!\x0f\x89\xf8\x84'\x00\x00\x7f\x00\x008\x10\x83\xff\xe0B\x0e\x00\x00\x7f\x00\x009\x08B\xff\x84!\x0e\x00\x00\x7f\x00\x00\x1c\x84 ,\x02\x10\x9c\x00\x00\x7f\x00\x00\x0eB\x10\x98!\x088\x00\x00\x7f\x00\x00\x0e\x01\x08B\x10\x848\x00\x00\x7f\x00\x00\x07\x90\x84!\x08Bp\x00\x00\x7f\x00\x00\x03\xc0B\x10\x84 \xe0\x00\x00\x7f\x00\x00\x01\xe4!\x08B\x13\xc0\x00\x00\x7f\x00\x00\x00\xe0\x10\x84!\x03\x80\x00\x00\x7f\x00\x00\x00y\x08B\x10\x8f\x00\x00\x00\x7f\x00\x00\x00<\x84!\x08\x1e\x00\x00\x00\x7f\x00\x00\x00\x1f\x02\x10\x84|\x00\x00\x00\x7f\x00\x00\x00\x07\xc1\x00A\xf0\x00\x00\x00\x7f\x00\x00\x00\x03\xf8\x08\x0f\xe0\x00\x00\x00\x7f\x00\x00\x00\x00\xff\xeb\xff\x80\x00\x00\x00\x7f\x00\x00\x00\x00\x1f\xff\xfc\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x03\xff\xe0\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x18\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x08\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f"
|
||||
17
boards/default/micropython/build/lib/oled128x64.py
Normal file
17
boards/default/micropython/build/lib/oled128x64.py
Normal file
@@ -0,0 +1,17 @@
|
||||
"""
|
||||
OLED Displays
|
||||
|
||||
Micropython library for the SSD1106_I2C OLED Displays
|
||||
=======================================================
|
||||
|
||||
#Preliminary composition 20230412
|
||||
|
||||
dahanzimin From the Mixly Team
|
||||
"""
|
||||
from ssd1106 import SSD1106_I2C
|
||||
|
||||
class OLED(SSD1106_I2C):
|
||||
"""A single matrix."""
|
||||
def __init__(self, i2c, width=128, height=64, address=0x3c, font_address=0x700000):
|
||||
super().__init__(width, height, i2c, address)
|
||||
self.font(font_address)
|
||||
34
boards/default/micropython/build/lib/onenet.py
Normal file
34
boards/default/micropython/build/lib/onenet.py
Normal file
@@ -0,0 +1,34 @@
|
||||
import ujson as json
|
||||
from umqtt import MQTTClient,str_len
|
||||
|
||||
def get_data_dict(d):
|
||||
result = {"datastreams":[]}
|
||||
for x in d:
|
||||
result["datastreams"].append({"id":x,"datapoints":[{"value":d[x]}]})
|
||||
return result
|
||||
|
||||
def pubData(value, state):
|
||||
value = get_data_dict(value)
|
||||
jdata = json.dumps(value)
|
||||
jlen = str_len(jdata)
|
||||
bdata = bytearray(jlen+3)
|
||||
bdata[0] = 1 #publish data in type of json
|
||||
bdata[1] = int(jlen / 256) # data lenght
|
||||
bdata[2] = jlen % 256 # data lenght
|
||||
bdata[3:jlen+4] = jdata.encode('ascii') # json data
|
||||
if state:
|
||||
print(value)
|
||||
#print(bdata)
|
||||
return bdata
|
||||
|
||||
def init_MQTT_client(sid, address, cid, api, topic, callback):
|
||||
client = MQTT_Client(sid, address, 6002, cid, api)
|
||||
client.set_callback(callback)
|
||||
client.connect()
|
||||
client.subscribe(bytes(topic, 'utf-8'))
|
||||
return client
|
||||
|
||||
#inherit
|
||||
class MQTT_Client(MQTTClient):
|
||||
def publish(self, msg, is_print=False, topic='$dp', retain=False, qos=0):
|
||||
super().publish('$dp',pubData(msg, is_print))
|
||||
112
boards/default/micropython/build/lib/pe_g1.py
Normal file
112
boards/default/micropython/build/lib/pe_g1.py
Normal file
@@ -0,0 +1,112 @@
|
||||
"""
|
||||
PE_G1
|
||||
|
||||
Micropython library for the PE_G1(Motor*5*2 & Servo*4)
|
||||
=======================================================
|
||||
|
||||
#Preliminary composition 20230120
|
||||
|
||||
@dahanzimin From the Mixly Team
|
||||
"""
|
||||
from time import sleep_ms
|
||||
from micropython import const
|
||||
|
||||
_PE_G1_ADDRESS = const(0x25)
|
||||
_PE_G1_ID = const(0x00)
|
||||
_PE_G1_VBAT = const(0x01)
|
||||
_PE_G1_MOTOR = const(0x03)
|
||||
_PE_G1_SERVO = const(0x0D)
|
||||
_PE_G1_OFF = const(0x16)
|
||||
|
||||
class PE_G1:
|
||||
def __init__(self, i2c_bus, addr=_PE_G1_ADDRESS):
|
||||
self._i2c=i2c_bus
|
||||
self._addr = addr
|
||||
sleep_ms(500)
|
||||
if self._rreg(_PE_G1_ID)!= 0x25:
|
||||
raise AttributeError("Cannot find a PE_G1")
|
||||
self.reset()
|
||||
|
||||
def _wreg(self, reg, val):
|
||||
'''Write memory address'''
|
||||
try:
|
||||
self._i2c.writeto_mem(self._addr, reg, val.to_bytes(1, 'little'))
|
||||
except:
|
||||
return 0
|
||||
|
||||
def _rreg(self, reg, nbytes=1):
|
||||
'''Read memory address'''
|
||||
try:
|
||||
self._i2c.writeto(self._addr, reg.to_bytes(1, 'little'))
|
||||
return self._i2c.readfrom(self._addr, nbytes)[0] if nbytes<=1 else self._i2c.readfrom(self._addr, nbytes)[0:nbytes]
|
||||
except:
|
||||
return 0
|
||||
|
||||
def reset(self):
|
||||
"""Reset all registers to default state"""
|
||||
for reg in range(_PE_G1_MOTOR,_PE_G1_MOTOR+18):
|
||||
self._wreg(reg,0x00)
|
||||
|
||||
def read_bat(self,ratio=0.0097):
|
||||
'''Read battery power'''
|
||||
vbat= self._rreg(_PE_G1_VBAT)<<2 | self._rreg(_PE_G1_VBAT+1)>>6
|
||||
return round(vbat*ratio,2)
|
||||
|
||||
def m_pwm(self,index,duty=None):
|
||||
"""Motor*5*2 PWM duty cycle data register"""
|
||||
if not 0 <= index <= 9:
|
||||
raise ValueError("Motor port must be a number in the range: 0~9")
|
||||
if duty is None:
|
||||
return self._rreg(_PE_G1_MOTOR+index)
|
||||
else:
|
||||
if not 0 <= duty <= 255:
|
||||
raise ValueError("Duty must be a number in the range: 0~255")
|
||||
self._wreg(_PE_G1_MOTOR+index,duty)
|
||||
|
||||
def s_pwm(self,index,duty=None):
|
||||
"""Servo*4 PWM duty cycle data register"""
|
||||
if not 0 <= index <= 3:
|
||||
raise ValueError("Servo port must be a number in the range: 0~3")
|
||||
if duty is None:
|
||||
return self._rreg(_PE_G1_SERVO+index*2)<<8 | self._rreg(_PE_G1_SERVO+index*2+1)
|
||||
else:
|
||||
if not 0 <= duty <= 4095:
|
||||
raise ValueError("Duty must be a number in the range: 0~4095")
|
||||
self._wreg(_PE_G1_SERVO+index*2,duty>>8)
|
||||
self._wreg(_PE_G1_SERVO+index*2+1,duty&0xff)
|
||||
|
||||
def motor(self,index,action,speed=0):
|
||||
if not 0 <= speed <= 100:
|
||||
raise ValueError("Speed parameters must be a number in the range: 0~100")
|
||||
if action=="N":
|
||||
self.m_pwm(index*2,0)
|
||||
self.m_pwm(index*2+1,0)
|
||||
elif action=="P":
|
||||
self.m_pwm(index*2,255)
|
||||
self.m_pwm(index*2+1,255)
|
||||
elif action=="CW":
|
||||
self.m_pwm(index*2,0)
|
||||
self.m_pwm(index*2+1,speed*255//100)
|
||||
elif action=="CCW":
|
||||
self.m_pwm(index*2,speed*255//100)
|
||||
self.m_pwm(index*2+1,0)
|
||||
elif action=="NC":
|
||||
return round(self.m_pwm(index*2)*100/255),round(self.m_pwm(index*2+1)*100/255)
|
||||
else:
|
||||
raise ValueError('Invalid input, valid are "N","P","CW","CCW"')
|
||||
|
||||
def servo180(self,index,angle=None):
|
||||
if angle is None:
|
||||
return round((self.s_pwm(index)-102.375)*180/409.5)
|
||||
else:
|
||||
if not 0 <= angle <= 180:
|
||||
raise ValueError("Servo(180) angle must be a number in the range: 0~180")
|
||||
self.s_pwm(index,round(102.375 + 409.5/180 * angle))
|
||||
|
||||
def servo360(self,index,speed=None):
|
||||
if speed is None:
|
||||
return round((self.s_pwm(index)-102.375)*200/409.5-100)
|
||||
else:
|
||||
if not -100<= speed <= 100:
|
||||
raise ValueError("Servo(360) speed must be a number in the range: -100~100")
|
||||
self.s_pwm(index,round(102.375 + 409.5/200 * (speed+100)))
|
||||
41
boards/default/micropython/build/lib/pm2_5.py
Normal file
41
boards/default/micropython/build/lib/pm2_5.py
Normal file
@@ -0,0 +1,41 @@
|
||||
"""
|
||||
PM2.5
|
||||
|
||||
Micropython library for the PM2.5(UART)
|
||||
=======================================================
|
||||
#Preliminary composition 20220908
|
||||
|
||||
dahanzimin From the Mixly Team
|
||||
"""
|
||||
import time
|
||||
|
||||
class PM2_5:
|
||||
def __init__(self, uart):
|
||||
self._uart=uart
|
||||
self._uart.init(baudrate=9600)
|
||||
self._pm=(0,0)
|
||||
self._flag=False
|
||||
if not self._chip_id():
|
||||
raise AttributeError("Cannot find a PM2.5")
|
||||
|
||||
def _rreg(self):
|
||||
'''Read data'''
|
||||
if self._uart.any():
|
||||
eec=0
|
||||
buf=self._uart.read(7)
|
||||
for i in buf[1:5]:
|
||||
eec+=i
|
||||
if (eec & 0xff) == buf[5] and buf[0] == 0xAA and buf[6] == 0xFF:
|
||||
self._pm=(buf[1] << 8 | buf[2] , buf[3] << 8 | buf[4] )
|
||||
return True
|
||||
|
||||
def _chip_id(self):
|
||||
for _ in range(5):
|
||||
if self._rreg():
|
||||
return True
|
||||
time.sleep(1)
|
||||
return False
|
||||
|
||||
def concentration(self):
|
||||
self._rreg()
|
||||
return self._pm
|
||||
29
boards/default/micropython/build/lib/progres_picture.py
Normal file
29
boards/default/micropython/build/lib/progres_picture.py
Normal file
@@ -0,0 +1,29 @@
|
||||
#Take the picture bytes in progres_picture.py
|
||||
#--dahanzimin From the Mixly Team
|
||||
|
||||
Bar_0=b'P4\n89 64\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x1ca\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x16\xd2\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x002\xd5\x80\x00\x00\x00\x7f\x00\x00\x00\x00\x002w@\x00\x00\x00\x7f\x00\x00\x00\x00\x002\x0b@\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x1e\x19\xc0\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f?\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x7f\x7f\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\xff\xc0\x00\x00\x00\x00\x00\x00\x00\x00\x00\x01\xff\x7f\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f'
|
||||
Bar_1=b'P4\n89 64\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x07\x1ea\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x05\x90\xd2\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x9c\xd5\x80\x00\x00\x00\x7f\x00\x00\x00\x00\x01\x86w@\x00\x00\x00\x7f\x00\x00\x00\x00\x03\x02\x0b@\x00\x00\x00\x7f\x00\x00\x00\x00\x07\xbe\x19\xc0\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f?\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x7f\x7f\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xea\xaa\xaa\xaa\xc0\x00\x00\x00\x00\x00\x00\xff\xd5RIU\x80\x00\x00\x00\x00\x00\x00\xff\xea\xad\xb6\xab\x00\x00\x00\x00\x00\x00\x00\xff\xd5RIV\x00\x00\x00\x00\x00\x00\x00\xff\xea\xad\xb6\xac\x00\x00\x00\x00\x00\x00\x00\xff\xd5RIX\x00\x00\x00\x00\x00\x00\x00\xff\xd5m\xb6\xb0\x00\x00\x00\x00\x00\x00\x00\xff\xea\x92I`\x00\x00\x00\x00\x00\x00\x00\xff\xd5m\xb6\xc0\x00\x00\x00\x00\x00\x00\x00\xff\xca\x92I\x80\x00\x00\x00\x00\x00\x00\x00\xff\xfbm\xb7\x00\x00\x00\x00\x00\x00\x00\x01\xff\x7f\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f'
|
||||
Bar_2=b'P4\n89 64\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x07\x9ca\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x04\x16\xd2\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x072\xd5\x80\x00\x00\x00\x7f\x00\x00\x00\x00\x01\xb2w@\x00\x00\x00\x7f\x00\x00\x00\x00\x00\xb2\x0b@\x00\x00\x00\x7f\x00\x00\x00\x00\x0f\x9e\x19\xc0\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f?\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x7f\x7f\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xea\xaa\xaa\xaa\xaa\xaa\xac\x00\x00\x00\x00\xff\xd5$\x92I$\x95X\x00\x00\x00\x00\xff\xea\xdbm\xb6\xdbj\xb0\x00\x00\x00\x00\xff\xd5$\x92I$\x95`\x00\x00\x00\x00\xff\xd6\xdbm\xb6\xdbj\xc0\x00\x00\x00\x00\xff\xe9$\x92I$\x95\x80\x00\x00\x00\x00\xff\xd6\xdbm\xb6\xdbk\x00\x00\x00\x00\x00\xff\xc9$\x92I$\x96\x00\x00\x00\x00\x00\xff\xf6\xdbm\xb6\xdbl\x00\x00\x00\x00\x00\xff\xc9$\x92I$\x98\x00\x00\x00\x00\x00\xff\xf6\xdbm\xb6\xdbp\x00\x00\x00\x00\x01\xff\x7f\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f'
|
||||
Bar_3=b'P4\n89 64\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x0f\x9ea\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x01\x90\xd2\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x01\x9c\xd5\x80\x00\x00\x00\x7f\x00\x00\x00\x00\x03\x06w@\x00\x00\x00\x7f\x00\x00\x00\x00\x02\x02\x0b@\x00\x00\x00\x7f\x00\x00\x00\x00\x06>\x19\xc0\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f?\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x7f\x7f\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xd5UUUUUUUU\x80\x00\xff\xd5RI$\x92I$\x92\xab\x00\x00\xff\xea\xad\xb6\xdbm\xb6\xdbmV\x00\x00\xff\xd5RI$\x92I$\x92\xac\x00\x00\xff\xea\xad\xb6\xdbm\xb6\xdbmX\x00\x00\xff\xd5RI$\x92I$\x92\xb0\x00\x00\xff\xd5m\xb6\xdbm\xb6\xdbm`\x00\x00\xff\xea\x92I$\x92I$\x92\xc0\x00\x00\xff\xd5m\xb6\xdbm\xb6\xdbm\x80\x00\x00\xff\xca\x92I$\x92I$\x93\x00\x00\x00\xff\xfbm\xb6\xdbm\xb6\xdbn\x00\x00\x01\xff\x7f\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f'
|
||||
Bar_4=b'P4\n89 64\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x87\x1ca\x00\x00\x00\x00\x7f\x00\x00\x00\x01\xc5\x96\xd2\x00\x00\x00\x00\x7f\x00\x00\x00\x00\xcc\xb2\xd5\x80\x00\x00\x00\x7f\x00\x00\x00\x00\xcc\xb2w@\x00\x00\x00\x7f\x00\x00\x00\x00\xcc\xb2\x0b@\x00\x00\x00\x7f\x00\x00\x00\x01\xe7\x9e\x19\xc0\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f?\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x7f\x7f\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xd5UUUUUUUUUU\xff\xd5$\x92I$\x92I$\x92I*\xff\xea\xdbm\xb6\xdbm\xb6\xdbm\xb6\xd5\xff\xd5$\x92I$\x92I$\x92I+\xff\xd6\xdbm\xb6\xdbm\xb6\xdbm\xb6\xd5\xff\xe9$\x92I$\x92I$\x92I+\xff\xd6\xdbm\xb6\xdbm\xb6\xdbm\xb6\xd5\xff\xc9$\x92I$\x92I$\x92I+\xff\xf6\xdbm\xb6\xdbm\xb6\xdbm\xb6\xd5\xff\xc9$\x92I$\x92I$\x92I%\xff\xf6\xdbm\xb6\xdbm\xb6\xdbm\xb6\xdb\xff\x7f\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f'
|
||||
Dial_0=b'P4\n89 64\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x0c\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x0c\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00m\x80\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x1f\xff\xfc\x00\x00\x00\x00\x7f\x00\x00\x00\x00\xff\xcc\xff\xc0\x00\x00\x00\x7f\x00\x00\x00\x07\xf8\x0c\x07\xf0\x00\x00\x00\x7f\x00\x00\x00\x1f\x80\x01\x00\xfc\x00\x00\x00\x7f\x00\x00\x00<\x00\x00\x00\x1f\x00\x00\x00\x7f\x00\x00\x00\xf0\x00\x00\x00\x07\xc0\x00\x00\x7f\x00\x00\x01\xe0\x00\x00\x00\x11\xe0\x00\x00\x7f\x00\x00\x07\x80\x00\x00\x00\x00p\x00\x00\x7f\x00\x00\x0f\x00\x00\x00\x00\x018\x00\x00\x7f\x00\x00\x1c\x00\x00\x00\x00\x00\x1e\x00\x00\x7f\x00\x039\x00\x00\x00\x00\x00\x0f \x00\x7f\x00\x01\xb0\x00\x00\x00\x00\x00\x07`\x00\x7f\x00\x00\xc0\x00\x00\x00\x00\x00\x02\xc0\x00\x7f\x00\x00`\x00\x00\x00\x00\x00\x01\x80\x00\x7f\x00\x01\xa0\x00\x00\x00\x00\x00\x03`\x00\x7f\x00\x03\x80\x00\x00\x00\x00\x00\x00p\x00\x7f\x00\x07 \x00\x00\x00\x00\x00\x000\x00\x7f\x00\x06\x00\x00\x00\x00\x00\x00\x00\xb8\x00\x7f\x00\x0e\x80\x00\x00\x00\x00\x00\x00\x1c\x00\x7f\x00\x1c\x00\x00\x00\x00\x00\x00\x00\x1c\x00\x7f\x00\x19\x00\x00\x00\x00\x00\x00\x00\x0e\x00\x7f\x008\x00\x00\x00\x00\x00\x00\x00\x06\x00\x7f\x002\x00\x00\x00\x00\x00\x00\x00\x06\x00\x7f\x000\x00\x00\x00\x00\x00\x00\x00\x17\x00\x7f\x00t\x00\x00\x00\x00\x00\x00\x00\x03\x00\x7f\x00`\x00\x00\x00\x00\x00\x00\x00\x03\x80\x7f\x00`\x00\x00\x00\x00\x00\x00\x00\x01\x80\x7f\x00\xe0\x00\x00\x00\x00\x00\x00\x00\x01\x80\x7f\x00\xc0\x00\x00\x00\x00\x00\x00\x00\x01\x80\x7f\x00\xc0\x00\x00\x00\x00\x00\x00\x00\x01\xc0\x7f\x00\xc0\x00\x00\x00\x00\x00\x00\x00\x00\xc0\x7f\x00\xc0\x00\x00\x00\x00\x00\x00\x00\x00\xc0\x7f\x01\xc0\x00\x00\x00\x00\x00\x00\x00\x00\xc0\x7f\x01\x80\x00\x00\x00\x00\x00\x00\x00\x00\xc0\x7f\x01\x80\x00\x00\x00\x00\x00\x00\x00\x00\xc0\x7f\x01\x80\x00\x00\x00\x01\x00\x00\x00\x00\xc0\x7f\x01\x80\x00\x00\x00\x0c\x00\x00\x00\x00\xc0\x7f\x01\x90\x00\x00\x00w@\x00\x00\x02\xc0\x7f\x00\x80\x00?\xff\xf9\x00\x00\x00\x00@\x7f\x07\xe1\x7f\xff\xff\xfd\xa0\x00\x00\x0b\xf8\x7f\x0f\xf0\xff\xff\xff\xfc\x80\x00\x00\x03\xf8\x7f\x00\x00\x00?\xff\xfd\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\xfb\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x1e\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f'
|
||||
Dial_1=b'P4\n89 64\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x0c\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x0c\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00m\x80\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x1f\xff\xfc\x00\x00\x00\x00\x7f\x00\x00\x00\x00\xff\xcc\xff\xc0\x00\x00\x00\x7f\x00\x00\x00\x07\xf8\x0c\x07\xf0\x00\x00\x00\x7f\x00\x00\x00\x1f\x80\x01\x00\xfc\x00\x00\x00\x7f\x00\x00\x00<\x00\x00\x00\x1f\x00\x00\x00\x7f\x00\x00\x00\xf0\x00\x00\x00\x07\xc0\x00\x00\x7f\x00\x00\x01\xe0\x00\x00\x00\x11\xe0\x00\x00\x7f\x00\x00\x07\x80\x00\x00\x00\x00p\x00\x00\x7f\x00\x00\x0f\x00\x00\x00\x00\x018\x00\x00\x7f\x00\x00\x1c\x00\x00\x00\x00\x00\x1e\x00\x00\x7f\x00\x039\x00\x00\x00\x00\x00\x0f \x00\x7f\x00\x01\xb0\x00\x00\x00\x00\x00\x07`\x00\x7f\x00\x00\xc0\x00\x00\x00\x00\x00\x02\xc0\x00\x7f\x00\x00`\x00\x00\x00\x00\x00\x01\x80\x00\x7f\x00\x01\xa0\x00\x00\x00\x00\x00\x03`\x00\x7f\x00\x03\x88\x00\x00\x00\x00\x00\x00p\x00\x7f\x00\x07 \x00\x00\x00\x00\x00\x000\x00\x7f\x00\x06\x02\x80\x00\x00\x00\x00\x00\xb8\x00\x7f\x00\x0e\x83\x00\x00\x00\x00\x00\x00\x1c\x00\x7f\x00\x1c\x01\x80\x00\x00\x00\x00\x00\x1c\x00\x7f\x00\x19\x00\xc0\x00\x00\x00\x00\x00\x0e\x00\x7f\x008\x00`\x00\x00\x00\x00\x00\x06\x00\x7f\x002\x010\x00\x00\x00\x00\x00\x06\x00\x7f\x000\x00\x1c\x80\x00\x00\x00\x00\x17\x00\x7f\x00t\x00N@\x00\x00\x00\x00\x03\x00\x7f\x00`\x00\x0f \x00\x00\x00\x00\x03\x80\x7f\x00`\x00\x17\x80\x00\x00\x00\x00\x01\x80\x7f\x00\xe0\x00\x03\xc0\x00\x00\x00\x00\x01\x80\x7f\x00\xc0\x00\x05\xf0\x00\x00\x00\x00\x01\x80\x7f\x00\xc0\x00\x00\xf8\x00\x00\x00\x00\x01\xc0\x7f\x00\xc0\x00\x00|\x00\x00\x00\x00\x00\xc0\x7f\x00\xc0\x00\x00>@\x00\x00\x00\x00\xc0\x7f\x01\xc0\x00\x00\x1f\x00\x00\x00\x00\x00\xc0\x7f\x01\x80\x00\x00\x0f\xd0\x00\x00\x00\x00\xc0\x7f\x01\x80\x00\x00\x0f\xe0\x00\x00\x00\x00\xc0\x7f\x01\x80\x00\x00\x07\xf1\x00\x00\x00\x00\xc0\x7f\x01\x80\x00\x00\x13\xfc\x00\x00\x00\x00\xc0\x7f\x01\x90\x00\x00\x01\xff@\x00\x00\x02\xc0\x7f\x00\x80\x00\x00\x04\xf9\x00\x00\x00\x00@\x7f\x07\xe4\x00\x00\x02}\xa0\x00\x00\x0b\xf8\x7f\x0f\xf0\x00\x00\x00\xfc\x80\x00\x00\x03\xf8\x7f\x00\x00\x00\x00\x00A\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00#\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x1e\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f'
|
||||
Dial_2=b'P4\n89 64\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x0c\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x0c\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00m\x80\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x1f\xff\xfc\x00\x00\x00\x00\x7f\x00\x00\x00\x00\xff\xcc\xff\xc0\x00\x00\x00\x7f\x00\x00\x00\x07\xf8\x0c\x07\xf0\x00\x00\x00\x7f\x00\x00\x00\x1f\x80\x01\x00\xfc\x00\x00\x00\x7f\x00\x00\x00<\x00\x02\x00\x1f\x00\x00\x00\x7f\x00\x00\x00\xf0\x00\x00\x00\x07\xc0\x00\x00\x7f\x00\x00\x01\xe0\x00\x08\x00\x11\xe0\x00\x00\x7f\x00\x00\x07\x80\x00\x00\x00\x00p\x00\x00\x7f\x00\x00\x0f\x00\x00$\x00\x018\x00\x00\x7f\x00\x00\x1c\x00\x00\x0c\x00\x00\x1e\x00\x00\x7f\x00\x039\x00\x00\x0c\x00\x00\x0f \x00\x7f\x00\x01\xb0\x00\x00\x0c\x00\x00\x07`\x00\x7f\x00\x00\xc0\x00\x00\x0c\x00\x00\x02\xc0\x00\x7f\x00\x00`\x00\x00\x0c\x00\x00\x01\x80\x00\x7f\x00\x01\xa0\x00\x00\x0c\x00\x00\x03`\x00\x7f\x00\x03\x80\x00\x00\x0c\x00\x00\x00p\x00\x7f\x00\x07 \x00\x00\x0c\x00\x00\x000\x00\x7f\x00\x06\x00\x00\x00\x0c\x00\x00\x00\xb8\x00\x7f\x00\x0e\x80\x00\x00\x0c\x00\x00\x00\x1c\x00\x7f\x00\x1c\x00\x00\x00N\x00\x00\x00\x1c\x00\x7f\x00\x19\x00\x00\x00\x1e\x80\x00\x00\x0e\x00\x7f\x008\x00\x00\x00\x1e\x00\x00\x00\x06\x00\x7f\x002\x00\x00\x00\x1e\x00\x00\x00\x06\x00\x7f\x000\x00\x00\x00\x1e\x00\x00\x00\x17\x00\x7f\x00t\x00\x00\x00\x1e\x00\x00\x00\x03\x00\x7f\x00`\x00\x00\x00\x1e\x00\x00\x00\x03\x80\x7f\x00`\x00\x00\x00\x1e\x00\x00\x00\x01\x80\x7f\x00\xe0\x00\x00\x00\x1e\x00\x00\x00\x01\x80\x7f\x00\xc0\x00\x00\x00\x1e\x00\x00\x00\x01\x80\x7f\x00\xc0\x00\x00\x00\x1e\x00\x00\x00\x01\xc0\x7f\x00\xc0\x00\x00\x00\x1e\x00\x00\x00\x00\xc0\x7f\x00\xc0\x00\x00\x00?\x00\x00\x00\x00\xc0\x7f\x01\xc0\x00\x00\x00?\x00\x00\x00\x00\xc0\x7f\x01\x80\x00\x00\x00?\x00\x00\x00\x00\xc0\x7f\x01\x80\x00\x00\x00?\x00\x00\x00\x00\xc0\x7f\x01\x80\x00\x00\x00?\x00\x00\x00\x00\xc0\x7f\x01\x80\x00\x00\x00?\x00\x00\x00\x00\xc0\x7f\x01\x90\x00\x00\x00?\x00\x00\x00\x02\xc0\x7f\x00\x80\x00\x00\x01\x7f\x00\x00\x00\x00@\x7f\x07\xe4\x00\x00\x00\x7f\xa0\x00\x00\x0b\xf8\x7f\x0f\xf0\x00\x00\x00\xde\x80\x00\x00\x03\xf8\x7f\x00\x00\x00\x00\x00A\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00#\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x1e\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f'
|
||||
Dial_3=b'P4\n89 64\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x0c\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x0c\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00m\x80\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x1f\xff\xfc\x00\x00\x00\x00\x7f\x00\x00\x00\x00\xff\xcc\xff\xc0\x00\x00\x00\x7f\x00\x00\x00\x07\xf8\x0c\x07\xf0\x00\x00\x00\x7f\x00\x00\x00\x1f\x80\x01\x00\xfc\x00\x00\x00\x7f\x00\x00\x00<\x00\x00\x00\x1f\x00\x00\x00\x7f\x00\x00\x00\xf0\x00\x00\x00\x07\xc0\x00\x00\x7f\x00\x00\x01\xe0\x00\x00\x00\x11\xe0\x00\x00\x7f\x00\x00\x07\x80\x00\x00\x00\x00p\x00\x00\x7f\x00\x00\x0f\x00\x00\x00\x00\x018\x00\x00\x7f\x00\x00\x1c\x00\x00\x00\x00\x00\x1e\x00\x00\x7f\x00\x039\x00\x00\x00\x00\x00\x0f \x00\x7f\x00\x01\xb0\x00\x00\x00\x00\x00\x07`\x00\x7f\x00\x00\xc0\x00\x00\x00\x00\x00\x02\xc0\x00\x7f\x00\x00`\x00\x00\x00\x00\x00\x01\x80\x00\x7f\x00\x01\xa0\x00\x00\x00\x00\x00\x0b`\x00\x7f\x00\x03\x80\x00\x00\x00\x00\x00\x00p\x00\x7f\x00\x07 \x00\x00\x00\x00\x00\x000\x00\x7f\x00\x06\x00\x00\x00\x00\x00\x00\x10\xb8\x00\x7f\x00\x0e\x80\x00\x00\x00\x00\x00 \x1c\x00\x7f\x00\x1c\x00\x00\x00\x00\x00\x02H\x1c\x00\x7f\x00\x19\x00\x00\x00\x00\x00\x00\xd0\x0e\x00\x7f\x008\x00\x00\x00\x00\x00\x03\x80\x06\x00\x7f\x002\x00\x00\x00\x00\x00\x07\x00\x06\x00\x7f\x000\x00\x00\x00\x00\x00N\x00\x17\x00\x7f\x00t\x00\x00\x00\x00\x00\x1c\x00\x03\x00\x7f\x00`\x00\x00\x00\x00\x008\x00\x03\x80\x7f\x00`\x00\x00\x00\x00\x00\xf0\x00\x01\x80\x7f\x00\xe0\x00\x00\x00\x00\t\xe4\x00\x01\x80\x7f\x00\xc0\x00\x00\x00\x00\x03\xc0\x00\x01\x80\x7f\x00\xc0\x00\x00\x00\x00\x07\xd0\x00\x01\xc0\x7f\x00\xc0\x00\x00\x00\x00\x1f\x80\x00\x00\xc0\x7f\x00\xc0\x00\x00\x00\x00?\x00\x00\x00\xc0\x7f\x01\xc0\x00\x00\x00\x00~\x00\x00\x00\xc0\x7f\x01\x80\x00\x00\x00\x04\xfc\x00\x00\x00\xc0\x7f\x01\x80\x00\x00\x00\x01\xf8\x00\x00\x00\xc0\x7f\x01\x80\x00\x00\x00\x03\xf2\x00\x00\x00\xc0\x7f\x01\x80\x00\x00\x00\x0f\xe0\x00\x00\x00\xc0\x7f\x01\x90\x00\x00\x00?\xc0\x00\x00\x02\xc0\x7f\x00\x80\x00\x00\x01o\xd0\x00\x00\x00@\x7f\x07\xe4\x00\x00\x00O\x80\x00\x00\x0b\xf8\x7f\x0f\xf0\x00\x00\x00\xcf\x80\x00\x00\x03\xf8\x7f\x00\x00\x00\x00\x00a\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00#\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x1e\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f'
|
||||
Dial_4=b"P4\n89 64\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x0c\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x0c\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00m\x80\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x1f\xff\xfc\x00\x00\x00\x00\x7f\x00\x00\x00\x00\xff\xcc\xff\xc0\x00\x00\x00\x7f\x00\x00\x00\x07\xf8\x0c\x07\xf0\x00\x00\x00\x7f\x00\x00\x00\x1f\x80\x01\x00\xfc\x00\x00\x00\x7f\x00\x00\x00<\x00\x00\x00\x1f\x00\x00\x00\x7f\x00\x00\x00\xf0\x00\x00\x00\x07\xc0\x00\x00\x7f\x00\x00\x01\xe0\x00\x00\x00\x11\xe0\x00\x00\x7f\x00\x00\x07\x80\x00\x00\x00\x00p\x00\x00\x7f\x00\x00\x0f\x00\x00\x00\x00\x018\x00\x00\x7f\x00\x00\x1c\x00\x00\x00\x00\x00\x1e\x00\x00\x7f\x00\x039\x00\x00\x00\x00\x00\x0f \x00\x7f\x00\x01\xb0\x00\x00\x00\x00\x00\x07`\x00\x7f\x00\x00\xc0\x00\x00\x00\x00\x00\x02\xc0\x00\x7f\x00\x00`\x00\x00\x00\x00\x00\x01\x80\x00\x7f\x00\x01\xa0\x00\x00\x00\x00\x00\x03`\x00\x7f\x00\x03\x80\x00\x00\x00\x00\x00\x00p\x00\x7f\x00\x07 \x00\x00\x00\x00\x00\x000\x00\x7f\x00\x06\x00\x00\x00\x00\x00\x00\x00\xb8\x00\x7f\x00\x0e\x80\x00\x00\x00\x00\x00\x00\x1c\x00\x7f\x00\x1c\x00\x00\x00\x00\x00\x00\x00\x1c\x00\x7f\x00\x19\x00\x00\x00\x00\x00\x00\x00\x0e\x00\x7f\x008\x00\x00\x00\x00\x00\x00\x00\x06\x00\x7f\x002\x00\x00\x00\x00\x00\x00\x00\x06\x00\x7f\x000\x00\x00\x00\x00\x00\x00\x00\x17\x00\x7f\x00t\x00\x00\x00\x00\x00\x00\x00\x03\x00\x7f\x00`\x00\x00\x00\x00\x00\x00\x00\x03\x80\x7f\x00`\x00\x00\x00\x00\x00\x00\x00\x01\x80\x7f\x00\xe0\x00\x00\x00\x00\x00\x00\x00\x01\x80\x7f\x00\xc0\x00\x00\x00\x00\x00\x00\x00\x01\x80\x7f\x00\xc0\x00\x00\x00\x00\x00\x00\x00\x01\xc0\x7f\x00\xc0\x00\x00\x00\x00\x00\x00\x00\x00\xc0\x7f\x00\xc0\x00\x00\x00\x00\x00\x00\x00\x00\xc0\x7f\x01\xc0\x00\x00\x00\x00\x00\x00\x00\x00\xc0\x7f\x01\x80\x00\x00\x00\x00\x00\x00\x00\x00\xc0\x7f\x01\x80\x00\x00\x00\x00\x00\x00\x00\x00\xc0\x7f\x01\x80\x00\x00\x00\x01\x00\x00\x00\x00\xc0\x7f\x01\x80\x00\x00\x00\x1c\x00\x00\x00\x00\xc0\x7f\x01\x90\x00\x00\x007\x00\x00\x00\x02\xc0\x7f\x00\x80\x00\x00\x01o\xff\xf0\x00\x00@\x7f\x07\xe4\x00\x00\x00O\xff\xff\xff\xab\xf8\x7f\x0f\xf0\x00\x00\x00\xcf\xff\xff\xff\x83\xf8\x7f\x00\x00\x00\x00\x00O\xff\xf8\x00\x00\x00\x7f\x00\x00\x00\x00\x00'\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x1e\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f"
|
||||
Dots_0=b'P4\n89 64\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\xa0\x00\n\x00\x00\xa0\x00\x00\x7f\x00\x00\x04\x08\x00@\x80\x04\x08\x00\x00\x7f\x00\x00\x02\x10\x00!\x00\x02\x10\x00\x00\x7f\x00\x00\x04\x08\x00@\x80\x04\x08\x00\x00\x7f\x00\x00 \x01\x02\x00\x10 \x01\x00\x00\x7f\x00\x00\x10\x02\x01\x00 \x10\x02\x00\x00\x7f\x00\x00@\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\xfc\x00\x0f\xc0\x00\x80\x00\x7f\x00\x00@\x00\xfc\x00\x0f\xc0\x00\x00\x00\x7f\x00\x00@\x00\x84\x00\x08@\x00\x80\x00\x7f\x00\x00\x00\x02\x00\x00 \x00\x02\x00\x00\x7f\x00\x00(\x01\x02\x80\x10(\x01\x00\x00\x7f\x00\x00\x00\x08\x00\x00\x80\x00\x08\x00\x00\x7f\x00\x00\x02\x10\x00!\x00\x02\x10\x00\x00\x7f\x00\x00\x04\x08\x00@\x80\x04\x08\x00\x00\x7f\x00\x00\x01@\x00\x14\x00\x01@\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f'
|
||||
Dots_1=b'P4\n89 64\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\xa0\x00\n\x00\x00\xa0\x00\x00\x7f\x00\x00\x04\x08\x00@\x80\x04\x08\x00\x00\x7f\x00\x00\x03\xf0\x00!\x00\x02\x10\x00\x00\x7f\x00\x00\x07\xf8\x00@\x80\x04\x08\x00\x00\x7f\x00\x00/\xfd\x02\x00\x10 \x01\x00\x00\x7f\x00\x00\x1f\xfe\x01\x00 \x10\x02\x00\x00\x7f\x00\x00\x1f\xfe\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00_\xfe\xfc\x00\x0f\xc0\x00\x80\x00\x7f\x00\x00\x1f\xfe\xfc\x00\x0f\xc0\x00\x00\x00\x7f\x00\x00_\xfe\x84\x00\x08@\x00\x80\x00\x7f\x00\x00\x1f\xfe\x00\x00 \x00\x02\x00\x00\x7f\x00\x00/\xfd\x02\x80\x10(\x01\x00\x00\x7f\x00\x00\x07\xf8\x00\x00\x80\x00\x08\x00\x00\x7f\x00\x00\x03\xf0\x00!\x00\x02\x10\x00\x00\x7f\x00\x00\x04\x08\x00@\x80\x04\x08\x00\x00\x7f\x00\x00\x01@\x00\x14\x00\x01@\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f'
|
||||
Dots_2=b'P4\n89 64\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\xa0\x00\n\x00\x00\xa0\x00\x00\x7f\x00\x00\x04\x08\x00@\x80\x04\x08\x00\x00\x7f\x00\x00\x02\x10\x00?\x00\x02\x10\x00\x00\x7f\x00\x00\x04\x08\x00\x7f\x80\x04\x08\x00\x00\x7f\x00\x00 \x01\x02\xff\xd0 \x01\x00\x00\x7f\x00\x00\x10\x02\x01\xff\xe0\x10\x02\x00\x00\x7f\x00\x00@\x00\x01\xff\xe0\x00\x00\x00\x00\x7f\x00\x00\x00\x00\xfd\xff\xef\xc0\x00\x80\x00\x7f\x00\x00@\x00\xfd\xff\xef\xc0\x00\x00\x00\x7f\x00\x00@\x00\x85\xff\xe8@\x00\x80\x00\x7f\x00\x00\x00\x02\x01\xff\xe0\x00\x02\x00\x00\x7f\x00\x00(\x01\x02\xff\xd0(\x01\x00\x00\x7f\x00\x00\x00\x08\x00\x7f\x80\x00\x08\x00\x00\x7f\x00\x00\x02\x10\x00?\x00\x02\x10\x00\x00\x7f\x00\x00\x04\x08\x00@\x80\x04\x08\x00\x00\x7f\x00\x00\x01@\x00\x14\x00\x01@\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f'
|
||||
Dots_3=b'P4\n89 64\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\xa0\x00\n\x00\x00\xa0\x00\x00\x7f\x00\x00\x04\x08\x00@\x80\x04\x08\x00\x00\x7f\x00\x00\x02\x10\x00!\x00\x03\xf0\x00\x00\x7f\x00\x00\x04\x08\x00@\x80\x07\xf8\x00\x00\x7f\x00\x00 \x01\x02\x00\x10/\xfd\x00\x00\x7f\x00\x00\x10\x02\x01\x00 \x1f\xfe\x00\x00\x7f\x00\x00@\x00\x00\x00\x00\x1f\xfe\x00\x00\x7f\x00\x00\x00\x00\xfc\x00\x0f\xdf\xfe\x80\x00\x7f\x00\x00@\x00\xfc\x00\x0f\xdf\xfe\x00\x00\x7f\x00\x00@\x00\x84\x00\x08_\xfe\x80\x00\x7f\x00\x00\x00\x02\x00\x00 \x1f\xfe\x00\x00\x7f\x00\x00(\x01\x02\x80\x10/\xfd\x00\x00\x7f\x00\x00\x00\x08\x00\x00\x80\x07\xf8\x00\x00\x7f\x00\x00\x02\x10\x00!\x00\x03\xf0\x00\x00\x7f\x00\x00\x04\x08\x00@\x80\x04\x08\x00\x00\x7f\x00\x00\x01@\x00\x14\x00\x01@\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f'
|
||||
Hourglass_0=b'P4\n89 64\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00?\xff\xff\xff\xfe\x00\x00\x00\x7f\x00\x00\x00?\xff\xf0\x00\x02\x00\x00\x00\x7f\x00\x00\x00?\xff\xfc\x00\x02\x00\x00\x00\x7f\x00\x00\x00?\xff\xff\xff\xfe\x00\x00\x00\x7f\x00\x00\x00\x06\xaa\xaa\xaa\xb0\x00\x00\x00\x7f\x00\x00\x00\x07\xff\xff\xff\xf0\x00\x00\x00\x7f\x00\x00\x00\x06\x00\x00\x00\x10\x00\x00\x00\x7f\x00\x00\x00\x06\x00\x00\x00\x10\x00\x00\x00\x7f\x00\x00\x00\x06\x00\x00\x00\x10\x00\x00\x00\x7f\x00\x00\x00\x06\x00\x00\x00\x10\x00\x00\x00\x7f\x00\x00\x00\x06\x00\x00\x00\x10\x00\x00\x00\x7f\x00\x00\x00\x06UUUP\x00\x00\x00\x7f\x00\x00\x00\x06\xaa\xaa\xaa\x90\x00\x00\x00\x7f\x00\x00\x00\x06\xaa\xaa\xaa\xb0\x00\x00\x00\x7f\x00\x00\x00\x02UUU0\x00\x00\x00\x7f\x00\x00\x00\x03UUU \x00\x00\x00\x7f\x00\x00\x00\x01\xaa\xaa\xaa`\x00\x00\x00\x7f\x00\x00\x00\x00\xd5UT\xc0\x00\x00\x00\x7f\x00\x00\x00\x00j\xaa\xa9\x80\x00\x00\x00\x7f\x00\x00\x00\x005US\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x1a\xaa\xa6\x00\x00\x00\x00\x7f\x00\x00\x00\x00\rUL\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x06\xaa\x98\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x03U0\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x01\xaa`\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\xd4\xc0\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00i\x80\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x003\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x006\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00c\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\xc1\x80\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x01\x88\xc0\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x03\x00`\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x06\x080\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x0c\x00\x18\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x18\x08\x0c\x00\x00\x00\x00\x7f\x00\x00\x00\x000\x00\x06\x00\x00\x00\x00\x7f\x00\x00\x00\x00`\x08\x03\x00\x00\x00\x00\x7f\x00\x00\x00\x00\xc0\x00\x01\x80\x00\x00\x00\x7f\x00\x00\x00\x01\x80\x08\x00\xc0\x00\x00\x00\x7f\x00\x00\x00\x03\x00\x00\x00`\x00\x00\x00\x7f\x00\x00\x00\x03\x00\x08\x000\x00\x00\x00\x7f\x00\x00\x00\x02\x00\x00\x000\x00\x00\x00\x7f\x00\x00\x00\x06\x00\n\x00\x10\x00\x00\x00\x7f\x00\x00\x00\x06\x00*\x00\x10\x00\x00\x00\x7f\x00\x00\x00\x06\x00U@\x10\x00\x00\x00\x7f\x00\x00\x00\x06\x01U@\x10\x00\x00\x00\x7f\x00\x00\x00\x06\x02\xaa\xa8\x10\x00\x00\x00\x7f\x00\x00\x00\x06\x05UT\x10\x00\x00\x00\x7f\x00\x00\x00\x06]\xb6\xdb\x10\x00\x00\x00\x7f\x00\x00\x00\x06\x00\x00\x00\x10\x00\x00\x00\x7f\x00\x00\x00\x07\xff\xff\xff\xf0\x00\x00\x00\x7f\x00\x00\x00\x06\xaa\xaa\xaa\xb0\x00\x00\x00\x7f\x00\x00\x00?\xff\xff\xff\xfe\x00\x00\x00\x7f\x00\x00\x00?\xff\xf8\x00\x02\x00\x00\x00\x7f\x00\x00\x00?\xff\xfc\x00\x02\x00\x00\x00\x7f\x00\x00\x00?\xff\xff\xff\xfe\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f'
|
||||
Hourglass_1=b'P4\n89 64\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00?\xff\xff\xff\xfe\x00\x00\x00\x7f\x00\x00\x00?\xff\xf0\x00\x02\x00\x00\x00\x7f\x00\x00\x00?\xff\xfc\x00\x02\x00\x00\x00\x7f\x00\x00\x00?\xff\xff\xff\xfe\x00\x00\x00\x7f\x00\x00\x00\x06\xaa\xaa\xaa\xb0\x00\x00\x00\x7f\x00\x00\x00\x07\xff\xff\xff\xf0\x00\x00\x00\x7f\x00\x00\x00\x06\x00\x00\x00\x10\x00\x00\x00\x7f\x00\x00\x00\x06\x00\x00\x00\x10\x00\x00\x00\x7f\x00\x00\x00\x06\x00\x00\x00\x10\x00\x00\x00\x7f\x00\x00\x00\x06\x00\x00\x00\x10\x00\x00\x00\x7f\x00\x00\x00\x06\x00\x00\x00\x10\x00\x00\x00\x7f\x00\x00\x00\x06\x00\x00\x00\x10\x00\x00\x00\x7f\x00\x00\x00\x06\x00\x00\x00\x10\x00\x00\x00\x7f\x00\x00\x00\x06\x00\x00\x000\x00\x00\x00\x7f\x00\x00\x00\x02\x00\x00\x000\x00\x00\x00\x7f\x00\x00\x00\x03\x00\x00\x00 \x00\x00\x00\x7f\x00\x00\x00\x01\x80\x00\x00`\x00\x00\x00\x7f\x00\x00\x00\x00\xc0\x00\x00\xc0\x00\x00\x00\x7f\x00\x00\x00\x00`*\x01\x80\x00\x00\x00\x7f\x00\x00\x00\x002\xaa\x83\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x1a\xaa\xa6\x00\x00\x00\x00\x7f\x00\x00\x00\x00\rUL\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x06\xaa\x98\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x03U0\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x01\xaa`\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\xd4\xc0\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00i\x80\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x003\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x006\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00c\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\xc9\x80\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x01\x80\xc0\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x03\x08`\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x06\x000\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x0c\x08\x18\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x18\x00\x0c\x00\x00\x00\x00\x7f\x00\x00\x00\x000\x08\x06\x00\x00\x00\x00\x7f\x00\x00\x00\x00`\x00\x03\x00\x00\x00\x00\x7f\x00\x00\x00\x00\xc0\x08\x01\x80\x00\x00\x00\x7f\x00\x00\x00\x01\x80\x14\x00\xc0\x00\x00\x00\x7f\x00\x00\x00\x03\x00U\x00`\x00\x00\x00\x7f\x00\x00\x00\x03\x00\xaa\x800\x00\x00\x00\x7f\x00\x00\x00\x02\x05U@0\x00\x00\x00\x7f\x00\x00\x00\x06\x15UT\x10\x00\x00\x00\x7f\x00\x00\x00\x06UUU\x10\x00\x00\x00\x7f\x00\x00\x00\x06\xaa\xaa\xaa\x90\x00\x00\x00\x7f\x00\x00\x00\x06\xaa\xaa\xaa\x90\x00\x00\x00\x7f\x00\x00\x00\x06UUUP\x00\x00\x00\x7f\x00\x00\x00\x06\xaa\xaa\xaa\x90\x00\x00\x00\x7f\x00\x00\x00\x06\xdbm\xb6\xd0\x00\x00\x00\x7f\x00\x00\x00\x06\x00\x00\x00\x10\x00\x00\x00\x7f\x00\x00\x00\x07\xff\xff\xff\xf0\x00\x00\x00\x7f\x00\x00\x00\x06\xaa\xaa\xaa\xb0\x00\x00\x00\x7f\x00\x00\x00?\xff\xff\xff\xfe\x00\x00\x00\x7f\x00\x00\x00?\xff\xf8\x00\x02\x00\x00\x00\x7f\x00\x00\x00?\xff\xfc\x00\x02\x00\x00\x00\x7f\x00\x00\x00?\xff\xff\xff\xfe\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f'
|
||||
Hourglass_2=b'P4\n89 64\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00p\x00\x00\x00\x00\x00\x07\x80\x00\x7f\x00\x00\xf0\x00\x00\x00\x00\x00\x07\x80\x00\x7f\x00\x00\x90\x00\x00\x00\x00\x00\x05\x80\x00\x7f\x00\x00\x9f\xfc\x00\x00\x00\x1f\xfc\x80\x00\x7f\x00\x00\x9f\xff\x80\x00\x00\x7f\xfc\x80\x00\x7f\x00\x00\x94\x01\xc0\x00\x00\xc0\x14\x80\x00\x7f\x00\x00\x9c\x00`\x00\x01\x80\x1c\x80\x00\x7f\x00\x00\x94\x000\x00\x03\x00\x14\x80\x00\x7f\x00\x00\x9c\x00\x18\x00\x06\x00\x1c\x80\x00\x7f\x00\x00\x94\x00\x0c\x00\x0c\x00\x14\x80\x00\x7f\x00\x00\x9c\x00\x06\x00\x18\x00\x1c\x80\x00\x7f\x00\x00\x94\x00\x03\x000\x00\x14\x80\x00\x7f\x00\x00\x9c\x00\x01\x80`\x00\x1c\x80\x00\x7f\x00\x00\x94\x00\x00\xc0\xc0\x00\x14\x80\x00\x7f\x00\x00\x9d\x00\x00a\x80\x00\x1c\x80\x00\x7f\x00\x00\x95@\x003\x00\x00\x14\x80\x00\x7f\x00\x00\x9dP\x00\x1e\x00\x00\x1c\x80\x00\x7f\x00\x00\x94\xb4\x00\x0c\x00\x00\x14\x80\x00\x7f\x00\x00\xbdJ@\x00\x00\x00\x1d\x80\x00\x7f\x00\x00\xf4\xb5\xa9\x00\x00\x00\x15\x80\x00\x7f\x00\x00\xfdJU\\\x00\x00\x1f\x80\x00\x7f\x00\x00\xf4\xb5\xaa\xb6\x00\x00\x17\x80\x00\x7f\x00\x00\xfdJUc\x00\x00\x1f\x80\x00\x7f\x00\x00\xf4\xb5\xaa\xc1\x85\x00\x17\x80\x00\x7f\x00\x00\xfdJU\x80\xca\xc0\x1f\x80\x00\x7f\x00\x00\xf4\xb5\xab\x00e*W\x80\x00\x7f\x00\x00\xfdJV\x002\xda\x9f\x80\x00\x7f\x00\x00\xf4\xb5\xac\x00\x19%W\x80\x00\x7f\x00\x00\xfdJX\x00\x0c\xda\x9f\x80\x00\x7f\x00\x00\xf5u\xb0\x00\x06%W\x80\x00\x7f\x00\x00\xfd\n`\x00\x039_\x80\x00\x7f\x00\x00\xf5\xf8\xc0\x00\x01\x87W\x80\x00\x7f\x00\x00\xfc\x03\x80\x00\x00\xf0_\x80\x00\x7f\x00\x00\xff\xff\x00\x00\x00?\xff\x80\x00\x7f\x00\x00\xf8\x00\x00\x00\x00\x00\x0f\x80\x00\x7f\x00\x00\xf0\x00\x00\x00\x00\x00\x07\x80\x00\x7f\x00\x00\xf0\x00\x00\x00\x00\x00\x07\x80\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f'
|
||||
Timer_0=b'P4\n89 64\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\xff\x80\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\xc0\xc0\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x80\xc0\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\xc0\xc0\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\xf3\x80\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x002\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x10\x00\x7f\x00\x06\x00\x00\x00\x7f\x00\x00\x008\x07\xff\xf8\x0f\x00\x00\x00\x7f\x00\x00\x00|?\xff\xff\x1f\x80\x00\x00\x7f\x00\x00\x00\xc6\xff\xc1\xff\xb9\xc0\x00\x00\x7f\x00\x00\x01\x87\xf8\x00\x0f\xf0\xe0\x00\x00\x7f\x00\x00\x03\x07\xe0\x00\x01\xf8p\x00\x00\x7f\x00\x00\x03\x1f\x80/\x00|p\x00\x00\x7f\x00\x00\x01\xbe\x00!\x00>\xe0\x00\x00\x7f\x00\x00\x00\xfc\x00!\x00\x0f\xc0\x00\x00\x7f\x00\x00\x00\xf0\x00#\x00\x07\x80\x00\x00\x7f\x00\x00\x01\xe0\x00.\x00\x03\xc0\x00\x00\x7f\x00\x00\x01\xc0\x00(\x00\x01\xe0\x00\x00\x7f\x00\x00\x03\xc0\x00(\x00\x00\xf0\x00\x00\x7f\x00\x00\x07\x80\x00/\x00\x00p\x00\x00\x7f\x00\x00\x07\x00\x00\x00\x00\x00x\x00\x00\x7f\x00\x00\x0f\x00\x00\x00\x00\x008\x00\x00\x7f\x00\x00\x0e\x00\x00\x00\x00\x00<\x00\x00\x7f\x00\x00\x1e\x00\x00\x00\x00\x00\x1c\x00\x00\x7f\x00\x00\x1c\x00\x00\x00\x00\x00\x1e\x00\x00\x7f\x00\x00\x1c\x00\x00\x00\x00\x00\x0e\x00\x00\x7f\x00\x008\x00\x00\x00\x00\x00\x0e\x00\x00\x7f\x00\x008\x00\x00\x00\x00\x00\x0f\x00\x00\x7f\x00\x008\x00\x00\x00\x00\x00\x07\x00\x00\x7f\x00\x008\x00\x00\x00\x00\x00\x07\x00\x00\x7f\x00\x00y\xe0\x00\x00\x00\x03\xc7\x00\x00\x7f\x00\x00q \x00\x00\x00\x00G\x00\x00\x7f\x00\x00q \x00\x00\x00\x00G\x00\x00\x7f\x00\x00q\xe0\x00\x00\x00\x01\xc7\x00\x00\x7f\x00\x00p \x00\x00\x00\x00\xc7\x00\x00\x7f\x00\x00p \x00\x00\x00\x00G\x00\x00\x7f\x00\x00x \x00\x00\x00\x00\xc7\x00\x00\x7f\x00\x009\xe0\x00\x00\x00\x03\xc7\x00\x00\x7f\x00\x008\x00\x00\x00\x00\x00\x07\x00\x00\x7f\x00\x008\x00\x00\x00\x00\x00\x0f\x00\x00\x7f\x00\x008\x00\x00\x00\x00\x00\x0e\x00\x00\x7f\x00\x00<\x00\x00\x00\x00\x00\x0e\x00\x00\x7f\x00\x00\x1c\x00\x00\x00\x00\x00\x0e\x00\x00\x7f\x00\x00\x1c\x00\x00\x00\x00\x00\x1c\x00\x00\x7f\x00\x00\x1e\x00\x00\x00\x00\x00\x1c\x00\x00\x7f\x00\x00\x0e\x00\x00\x00\x00\x00<\x00\x00\x7f\x00\x00\x0f\x00\x00\x00\x00\x008\x00\x00\x7f\x00\x00\x07\x80\x00\x1e\x00\x00x\x00\x00\x7f\x00\x00\x03\x80\x00\x10\x00\x00\xf0\x00\x00\x7f\x00\x00\x03\xc0\x00\x10\x00\x01\xe0\x00\x00\x7f\x00\x00\x01\xe0\x00\x10\x00\x01\xe0\x00\x00\x7f\x00\x00\x00\xf0\x00\x1e\x00\x03\xc0\x00\x00\x7f\x00\x00\x00x\x00\x12\x00\x0f\x80\x00\x00\x7f\x00\x00\x00<\x00\x12\x00\x1f\x00\x00\x00\x7f\x00\x00\x00\x1f\x00\x1e\x00>\x00\x00\x00\x7f\x00\x00\x00\x0f\xc0\x00\x00\xfc\x00\x00\x00\x7f\x00\x00\x00\x07\xf0\x00\x03\xf0\x00\x00\x00\x7f\x00\x00\x00\x01\xfe\x00?\xe0\x00\x00\x00\x7f\x00\x00\x00\x00\x7f\xff\xff\x80\x00\x00\x00\x7f\x00\x00\x00\x00\x1f\xff\xfc\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x03\xff\xe0\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f'
|
||||
Timer_1=b'P4\n89 64\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\xff\x80\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\xc0\xc0\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x80\xc0\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\xc0\xc0\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\xf3\x80\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x002\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x10\x00\x7f\x00\x06\x00\x00\x00\x7f\x00\x00\x008\x07\xff\xf8\x0f\x00\x00\x00\x7f\x00\x00\x00|?\xff\xff\x1f\x80\x00\x00\x7f\x00\x00\x00\xc6\xff\xc1\xff\xb9\xc0\x00\x00\x7f\x00\x00\x01\x87\xf8\x00\x0f\xf0\xe0\x00\x00\x7f\x00\x00\x03\x07\xe0\x00\x01\xf8p\x00\x00\x7f\x00\x00\x03\x1f\x80.@|p\x00\x00\x7f\x00\x00\x01\xbe\x00#T>\xe0\x00\x00\x7f\x00\x00\x00\xfc\x00!U\x0f\xc0\x00\x00\x7f\x00\x00\x00\xf0\x00!*\x87\x80\x00\x00\x7f\x00\x00\x01\xe0\x00/U\xa3\xc0\x00\x00\x7f\x00\x00\x01\xc0\x00(*Q\xe0\x00\x00\x7f\x00\x00\x03\xc0\x00(U\xa8\xf0\x00\x00\x7f\x00\x00\x07\x80\x00/*Tp\x00\x00\x7f\x00\x00\x07\x00\x00\x00U\xa8x\x00\x00\x7f\x00\x00\x0f\x00\x00\x00RV8\x00\x00\x7f\x00\x00\x0e\x00\x00\x05m\xa9<\x00\x00\x7f\x00\x00\x1e\x00\x00\n\x92V\x9c\x00\x00\x7f\x00\x00\x1c\x00\x00\x05m\xa9\x1e\x00\x00\x7f\x00\x00\x1c\x00\x00\n\x92V\x8e\x00\x00\x7f\x00\x008\x00\x00\x05m\xa8\x8e\x00\x00\x7f\x00\x008\x00\x00\n\x92W\xcf\x00\x00\x7f\x00\x008\x00\x00\x05m\xa8\x0f\x00\x00\x7f\x00\x008\x00\x00\n\x92P\x07\x00\x00\x7f\x00\x00y\xe0\x00\x05m\xb3\xc7\x00\x00\x7f\x00\x00q \x00\n\x92HG\x00\x00\x7f\x00\x00q \x00\x05m\xb4G\x00\x00\x7f\x00\x00q\xe0\x00\x04\x92I\xc7\x00\x00\x7f\x00\x00p \x00\x00\x00\x00\xc7\x00\x00\x7f\x00\x00p \x00\x00\x00\x00G\x00\x00\x7f\x00\x00x \x00\x00\x00\x00\xc7\x00\x00\x7f\x00\x009\xe0\x00\x00\x00\x03\xc7\x00\x00\x7f\x00\x008\x00\x00\x00\x00\x00\x07\x00\x00\x7f\x00\x008\x00\x00\x00\x00\x00\x0f\x00\x00\x7f\x00\x008\x00\x00\x00\x00\x00\x0e\x00\x00\x7f\x00\x00<\x00\x00\x00\x00\x00\x0e\x00\x00\x7f\x00\x00\x1c\x00\x00\x00\x00\x00\x0e\x00\x00\x7f\x00\x00\x1c\x00\x00\x00\x00\x00\x1c\x00\x00\x7f\x00\x00\x1e\x00\x00\x00\x00\x00\x1c\x00\x00\x7f\x00\x00\x0e\x00\x00\x00\x00\x00<\x00\x00\x7f\x00\x00\x0f\x00\x00\x00\x00\x008\x00\x00\x7f\x00\x00\x07\x80\x00\x1e\x00\x00x\x00\x00\x7f\x00\x00\x03\x80\x00\x10\x00\x00\xf0\x00\x00\x7f\x00\x00\x03\xc0\x00\x10\x00\x01\xe0\x00\x00\x7f\x00\x00\x01\xe0\x00\x10\x00\x01\xe0\x00\x00\x7f\x00\x00\x00\xf0\x00\x1e\x00\x03\xc0\x00\x00\x7f\x00\x00\x00x\x00\x12\x00\x0f\x80\x00\x00\x7f\x00\x00\x00<\x00\x12\x00\x1f\x00\x00\x00\x7f\x00\x00\x00\x1f\x00\x1e\x00>\x00\x00\x00\x7f\x00\x00\x00\x0f\xc0\x00\x00\xfc\x00\x00\x00\x7f\x00\x00\x00\x07\xf0\x00\x03\xf0\x00\x00\x00\x7f\x00\x00\x00\x01\xfe\x00?\xe0\x00\x00\x00\x7f\x00\x00\x00\x00\x7f\xff\xff\x80\x00\x00\x00\x7f\x00\x00\x00\x00\x1f\xff\xfc\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x03\xff\xe0\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f'
|
||||
Timer_2=b'P4\n89 64\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\xff\x80\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\xc0\xc0\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x80\xc0\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\xc0\xc0\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\xf3\x80\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x002\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x10\x00\x7f\x00\x06\x00\x00\x00\x7f\x00\x00\x008\x07\xff\xf8\x0f\x00\x00\x00\x7f\x00\x00\x00|?\xff\xff\x1f\x80\x00\x00\x7f\x00\x00\x00\xc6\xff\xc1\xff\xb9\xc0\x00\x00\x7f\x00\x00\x01\x87\xf8\x00\x0f\xf0\xe0\x00\x00\x7f\x00\x00\x03\x07\xe0\x00\x01\xf8p\x00\x00\x7f\x00\x00\x03\x1f\x80.@|p\x00\x00\x7f\x00\x00\x01\xbe\x00#T>\xe0\x00\x00\x7f\x00\x00\x00\xfc\x00!*\x0f\xc0\x00\x00\x7f\x00\x00\x00\xf0\x00!UG\x80\x00\x00\x7f\x00\x00\x01\xe0\x00/*\xa3\xc0\x00\x00\x7f\x00\x00\x01\xc0\x00(UQ\xe0\x00\x00\x7f\x00\x00\x03\xc0\x00(*\xa8\xf0\x00\x00\x7f\x00\x00\x07\x80\x00/UTp\x00\x00\x7f\x00\x00\x07\x00\x00\x00UTx\x00\x00\x7f\x00\x00\x0f\x00\x00\x00\xaa\xaa8\x00\x00\x7f\x00\x00\x0e\x00\x00\x05UU<\x00\x00\x7f\x00\x00\x1e\x00\x00\n\xaa\xaa\x9c\x00\x00\x7f\x00\x00\x1c\x00\x00\x05UU\x1e\x00\x00\x7f\x00\x00\x1c\x00\x00\x05UV\x8e\x00\x00\x7f\x00\x008\x00\x00\x05UP\x8e\x00\x00\x7f\x00\x008\x00\x00\n\xaa\xaf\xcf\x00\x00\x7f\x00\x008\x00\x00\x05UP\x0f\x00\x00\x7f\x00\x008\x00\x00\x05UP\x07\x00\x00\x7f\x00\x00y\xe0\x00\x05US\xc7\x00\x00\x7f\x00\x00q \x00\n\xaa\xa8G\x00\x00\x7f\x00\x00q \x00\x05UTG\x00\x00\x7f\x00\x00q\xe0\x00\n\xaa\xa9\xc7\x00\x00\x7f\x00\x00p \x00\x05UT\xc7\x00\x00\x7f\x00\x00p \x00\n\xaa\xa8G\x00\x00\x7f\x00\x00x \x00\x05UP\xc7\x00\x00\x7f\x00\x009\xe0\x00\x05US\xc7\x00\x00\x7f\x00\x008\x00\x00\x05UP\x07\x00\x00\x7f\x00\x008\x00\x00\x05UUO\x00\x00\x7f\x00\x008\x00\x00\x05UUN\x00\x00\x7f\x00\x00<\x00\x00\n\xaa\xaa\x8e\x00\x00\x7f\x00\x00\x1c\x00\x00\x05UUN\x00\x00\x7f\x00\x00\x1c\x00\x00\n\xaa\xaa\x9c\x00\x00\x7f\x00\x00\x1e\x00\x00\x05UU\x1c\x00\x00\x7f\x00\x00\x0e\x00\x00\x05UU<\x00\x00\x7f\x00\x00\x0f\x00\x00\x00\xaa\xaa8\x00\x00\x7f\x00\x00\x07\x80\x00\x1eUTx\x00\x00\x7f\x00\x00\x03\x80\x00\x10\xb5T\xf0\x00\x00\x7f\x00\x00\x03\xc0\x00\x11J\xa9\xe0\x00\x00\x7f\x00\x00\x01\xe0\x00\x10\xb5!\xe0\x00\x00\x7f\x00\x00\x00\xf0\x00\x1eJ\xc3\xc0\x00\x00\x7f\x00\x00\x00x\x00\x12\xb5\x0f\x80\x00\x00\x7f\x00\x00\x00<\x00\x12J\x1f\x00\x00\x00\x7f\x00\x00\x00\x1f\x00\x1e\xb4>\x00\x00\x00\x7f\x00\x00\x00\x0f\xc0\x00@\xfc\x00\x00\x00\x7f\x00\x00\x00\x07\xf0\x00\x03\xf0\x00\x00\x00\x7f\x00\x00\x00\x01\xfe\x00?\xe0\x00\x00\x00\x7f\x00\x00\x00\x00\x7f\xff\xff\x80\x00\x00\x00\x7f\x00\x00\x00\x00\x1f\xff\xfc\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x03\xff\xe0\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f'
|
||||
Timer_3=b'P4\n89 64\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\xff\x80\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\xc0\xc0\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x80\xc0\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\xc0\xc0\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\xf3\x80\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x002\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x10\x00\x7f\x00\x06\x00\x00\x00\x7f\x00\x00\x008\x07\xff\xf8\x0f\x00\x00\x00\x7f\x00\x00\x00|?\xff\xff\x1f\x80\x00\x00\x7f\x00\x00\x00\xc6\xff\xc1\xff\xb9\xc0\x00\x00\x7f\x00\x00\x01\x87\xf8\x00\x0f\xf0\xe0\x00\x00\x7f\x00\x00\x03\x07\xe0\x00\x01\xf8p\x00\x00\x7f\x00\x00\x03\x1f\x80.@|p\x00\x00\x7f\x00\x00\x01\xbe\x00#T>\xe0\x00\x00\x7f\x00\x00\x00\xfc\x00!*\x0f\xc0\x00\x00\x7f\x00\x00\x00\xf0\x00!UG\x80\x00\x00\x7f\x00\x00\x01\xe0\x00/*\xa3\xc0\x00\x00\x7f\x00\x00\x01\xc0\x00(UQ\xe0\x00\x00\x7f\x00\x00\x03\xc0\x00(*\xa8\xf0\x00\x00\x7f\x00\x00\x07\x80\x00/UTp\x00\x00\x7f\x00\x00\x07\x00\x00\x00UTx\x00\x00\x7f\x00\x00\x0f\x00\x00\x00\xaa\xaa8\x00\x00\x7f\x00\x00\x0e\x00\x00\x05UU<\x00\x00\x7f\x00\x00\x1e\x00\x00\n\xaa\xaa\x9c\x00\x00\x7f\x00\x00\x1c\x00\x00\x05UU\x1e\x00\x00\x7f\x00\x00\x1c\x00\x00\x05UV\x8e\x00\x00\x7f\x00\x008\x00\x00\x05UP\x8e\x00\x00\x7f\x00\x008\x00\x00\n\xaa\xaf\xcf\x00\x00\x7f\x00\x008\x00\x00\x05UP\x0f\x00\x00\x7f\x00\x008\x00\x00\x05UP\x07\x00\x00\x7f\x00\x00y\xe0\x00\x05US\xc7\x00\x00\x7f\x00\x00q \x00\n\xaa\xa8G\x00\x00\x7f\x00\x00q \x00\x05UTG\x00\x00\x7f\x00\x00q\xe0\x00\n\xaa\xa9\xc7\x00\x00\x7f\x00\x00p%UUUT\xc7\x00\x00\x7f\x00\x00p"\xaa\xaa\xaa\xa8G\x00\x00\x7f\x00\x00x%UUUP\xc7\x00\x00\x7f\x00\x009\xe5UUUS\xc7\x00\x00\x7f\x00\x008\n\xaa\xaa\xaa\xa8\x07\x00\x00\x7f\x00\x008\xd5UUUUO\x00\x00\x7f\x00\x008UUUUUN\x00\x00\x7f\x00\x00<\xaa\xaa\xaa\xaa\xaa\x8e\x00\x00\x7f\x00\x00\x1cUUUUUN\x00\x00\x7f\x00\x00\x1cUUUUU\x9c\x00\x00\x7f\x00\x00\x1e*\xaa\xaa\xaa\xaa\x1c\x00\x00\x7f\x00\x00\x0e\x15UUUU<\x00\x00\x7f\x00\x00\x0f\x15U@\xaa\xaa8\x00\x00\x7f\x00\x00\x07\x8a\xaa\x9eUTx\x00\x00\x7f\x00\x00\x03\x8a\xaa\x90\xb5T\xf0\x00\x00\x7f\x00\x00\x03\xc2\xaa\x91J\xa9\xe0\x00\x00\x7f\x00\x00\x01\xe2\xaa\x90\xb5!\xe0\x00\x00\x7f\x00\x00\x00\xf0\xaa\x9eJ\xc3\xc0\x00\x00\x7f\x00\x00\x00x*\x92\xb5\x0f\x80\x00\x00\x7f\x00\x00\x00<*\x92J\x1f\x00\x00\x00\x7f\x00\x00\x00\x1f\x05\x1e\xb4>\x00\x00\x00\x7f\x00\x00\x00\x0f\xc0\x80@\xfc\x00\x00\x00\x7f\x00\x00\x00\x07\xf0\x00\x03\xf0\x00\x00\x00\x7f\x00\x00\x00\x01\xfe\x00?\xe0\x00\x00\x00\x7f\x00\x00\x00\x00\x7f\xff\xff\x80\x00\x00\x00\x7f\x00\x00\x00\x00\x1f\xff\xfc\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x03\xff\xe0\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f'
|
||||
Timer_4=b'P4\n89 64\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\xff\x80\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\xc0\xc0\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x80\xc0\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\xc0\xc0\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\xf3\x80\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x002\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x10\x00\x7f\x00\x06\x00\x00\x00\x7f\x00\x00\x008\x07\xff\xf8\x0f\x00\x00\x00\x7f\x00\x00\x00|?\xff\xff\x1f\x80\x00\x00\x7f\x00\x00\x00\xc6\xff\xc1\xff\xb9\xc0\x00\x00\x7f\x00\x00\x01\x87\xf8\x00\x0f\xf0\xe0\x00\x00\x7f\x00\x00\x03\x07\xe0\x00\x01\xf8p\x00\x00\x7f\x00\x00\x03\x1f\x81.@|p\x00\x00\x7f\x00\x00\x01\xbe\x15#T>\xe0\x00\x00\x7f\x00\x00\x00\xfc*!*\x0f\xc0\x00\x00\x7f\x00\x00\x00\xf0U!UG\x80\x00\x00\x7f\x00\x00\x01\xe1U/*\xa3\xc0\x00\x00\x7f\x00\x00\x01\xc1U(UQ\xe0\x00\x00\x7f\x00\x00\x03\xc5U(*\xa8\xf0\x00\x00\x7f\x00\x00\x07\x85U/UTp\x00\x00\x7f\x00\x00\x07\x15U\x00UTx\x00\x00\x7f\x00\x00\x0f\n\xaa\x80\xaa\xaa8\x00\x00\x7f\x00\x00\x0e*\xaa\xaa\xaa\xaa<\x00\x00\x7f\x00\x00\x1e*\xaa\xaa\xaa\xaa\x9c\x00\x00\x7f\x00\x00\x1cUUUUU\x1e\x00\x00\x7f\x00\x00\x1cUUUUU\x8e\x00\x00\x7f\x00\x008\x15UUUTN\x00\x00\x7f\x00\x008\xf5UUUW\xcf\x00\x00\x7f\x00\x008\n\xaa\xaa\xaa\xa8\x0f\x00\x00\x7f\x00\x008\x05UUUP\x07\x00\x00\x7f\x00\x00y\xe5UUUS\xc7\x00\x00\x7f\x00\x00q"\xaa\xaa\xaa\xa8G\x00\x00\x7f\x00\x00q%UUUTG\x00\x00\x7f\x00\x00q\xe2\xaa\xaa\xaa\xa9\xc7\x00\x00\x7f\x00\x00p%UUUT\xc7\x00\x00\x7f\x00\x00p"\xaa\xaa\xaa\xa8G\x00\x00\x7f\x00\x00x%UUUP\xc7\x00\x00\x7f\x00\x009\xe5UUUS\xc7\x00\x00\x7f\x00\x008\n\xaa\xaa\xaa\xa8\x07\x00\x00\x7f\x00\x008\xd5UUUUO\x00\x00\x7f\x00\x008UUUUUN\x00\x00\x7f\x00\x00<\xaa\xaa\xaa\xaa\xaa\x8e\x00\x00\x7f\x00\x00\x1cUUUUUN\x00\x00\x7f\x00\x00\x1cUUUUU\x9c\x00\x00\x7f\x00\x00\x1e*\xaa\xaa\xaa\xaa\x1c\x00\x00\x7f\x00\x00\x0e\x15UUUU<\x00\x00\x7f\x00\x00\x0f\x15U@\xaa\xaa8\x00\x00\x7f\x00\x00\x07\x8a\xaa\x9eUTx\x00\x00\x7f\x00\x00\x03\x8a\xaa\x90\xb5T\xf0\x00\x00\x7f\x00\x00\x03\xc2\xaa\x91J\xa9\xe0\x00\x00\x7f\x00\x00\x01\xe2\xaa\x90\xb5!\xe0\x00\x00\x7f\x00\x00\x00\xf0\xaa\x9eJ\xc3\xc0\x00\x00\x7f\x00\x00\x00x*\x92\xb5\x0f\x80\x00\x00\x7f\x00\x00\x00<*\x92J\x1f\x00\x00\x00\x7f\x00\x00\x00\x1f\x05\x1e\xb4>\x00\x00\x00\x7f\x00\x00\x00\x0f\xc0\x80@\xfc\x00\x00\x00\x7f\x00\x00\x00\x07\xf0\x00\x03\xf0\x00\x00\x00\x7f\x00\x00\x00\x01\xfe\x00?\xe0\x00\x00\x00\x7f\x00\x00\x00\x00\x7f\xff\xff\x80\x00\x00\x00\x7f\x00\x00\x00\x00\x1f\xff\xfc\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x03\xff\xe0\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f'
|
||||
Water_level_0=b'P4\n89 64\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x01\x00\x00`\x00\x08\x00\x03\x00\x00@\x7f\x03\x80\x00\xf0\x00\x1c\x00\x07\x80\x00\xe0\x7f\x0e\xc0\x01\xd8\x00s\x00\x0e\xc0\x01\xf8\x7f\x1ep\x03\xde\x00\xfb\x80\x1ep\x07\x9c\x7f\xff\x1e?\xe7\xc7\xfc\xf1\xff>?\xcf\xff\xff\xff\xff\xfd\xff\xff\xbf\xff\xef\xff\xf7\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff'
|
||||
Water_level_1=b'P4\n89 64\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x01\x00\x00`\x00\x08\x00\x03\x00\x00@\x7f\x03\x80\x00\xf0\x00\x1c\x00\x07\x80\x00\xe0\x7f\x0e\xc0\x01\xd8\x00s\x00\x0e\xc0\x01\xf8\x7f\x1ep\x03\xde\x00\xfb\x80\x1ep\x07\x9c\x7f\xff\x1e?\xe7\xc7\xfc\xf1\xff>?\xcf\xff\xff\xff\xff\xfd\xff\xff\xbf\xff\xef\xff\xf7\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff'
|
||||
Water_level_2=b'P4\n89 64\n\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00\x7f\x01\x00\x00`\x00\x08\x00\x03\x00\x00@\x7f\x03\x80\x00\xf0\x00\x1c\x00\x07\x80\x00\xe0\x7f\x0e\xc0\x01\xd8\x00s\x00\x0e\xc0\x01\xf8\x7f\x1ep\x03\xde\x00\xfb\x80\x1ep\x07\x9c\x7f\xff\x1e?\xe7\xc7\xfc\xf1\xff\x1e?\xcf\xff\xff\xff\xff\xfd\xff\xff?\xff\xef\xff\xf7\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff'
|
||||
Water_level_3=b'P4\n89 64\n\x01\x00\x00`\x00\x08\x00\x03\x00\x00@\x7f\x03\x80\x00\xf0\x00\x1c\x00\x07\x80\x00\xe0\x7f\x0e\xc0\x01\xd8\x00s\x00\x0e\xc0\x01\xf8\x7f\x1ep\x03\xde\x00\xfb\x80\x1ep\x07\x9c\x7f\xff\x1e?\xe7\xc7\xfc\xf1\xff\x1e?\xcf\xff\xff\xff\xff\xfd\xff\xff?\xff\xef\xff\xf7\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xdc\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xe1\x7f\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xf0?\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xe0\x7f\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xdf\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xbf\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfe?\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xfc?\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xf8o\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xe0O\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xf8\x1f\xff\xff\xff\xfe\xff\xff\xff\xff\xff\xff\xe0\x1f\xff\xff\xff\xff\x17\xff\xff\xff\xff\xff\xf0\x0f\xff\xff\xff\xff\x07\xff\xff\xff\xff\xff\xfco\xff\xff\xff\xff\x07\xff\xff\xff\xff\xff\xfe\x7f\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff\xff'
|
||||
115
boards/default/micropython/build/lib/ps2.py
Normal file
115
boards/default/micropython/build/lib/ps2.py
Normal file
@@ -0,0 +1,115 @@
|
||||
"""
|
||||
PS2Controller
|
||||
|
||||
MicroPython library for the PS2Controller
|
||||
=======================================================
|
||||
|
||||
#Perform upgrade repair 20220819
|
||||
|
||||
dahanzimin From the Mixly Team
|
||||
"""
|
||||
|
||||
import time
|
||||
from machine import Pin
|
||||
from micropython import const
|
||||
|
||||
PSB_SELECT = const(0x0001)
|
||||
PSB_L3 = const(0x0002)
|
||||
PSB_R3 = const(0x0004)
|
||||
PSB_START = const(0x0008)
|
||||
PSB_PAD_UP = const(0x0010)
|
||||
PSB_PAD_RIGHT = const(0x0020)
|
||||
PSB_PAD_DOWN = const(0x0040)
|
||||
PSB_PAD_LEFT = const(0x0080)
|
||||
PSB_L2 = const(0x0100)
|
||||
PSB_R2 = const(0x0200)
|
||||
PSB_L1 = const(0x0400)
|
||||
PSB_R1 = const(0x0800)
|
||||
PSB_GREEN = const(0x1000)
|
||||
PSB_RED = const(0x2000)
|
||||
PSB_BLUE = const(0x4000)
|
||||
PSB_PINK = const(0x8000)
|
||||
PSB_TRIANGLE = const(0x1000)
|
||||
PSB_CIRCLE = const(0x2000)
|
||||
PSB_CROSS = const(0x4000)
|
||||
PSB_SQUARE = const(0x8000)
|
||||
|
||||
PSS_RX = const(0)
|
||||
PSS_RY = const(1)
|
||||
PSS_LX = const(2)
|
||||
PSS_LY = const(3)
|
||||
|
||||
class PS2Controller:
|
||||
def __init__(self,clk_pin,do_pin,di_pin,cs_pin,mode=1,timeout=1000): #mode: 0 red; 1 green
|
||||
self.di =Pin(di_pin,Pin.IN)
|
||||
self.do =Pin(do_pin,Pin.OUT)
|
||||
self.cs =Pin(cs_pin,Pin.OUT)
|
||||
self.clk=Pin(clk_pin,Pin.OUT)
|
||||
|
||||
self.buttons=0
|
||||
self.last_buttons=0
|
||||
self.rods=(128,128,128,128)
|
||||
self.motor1=0
|
||||
self.motor2=0
|
||||
|
||||
timestamp = time.ticks_ms()
|
||||
while not (self._cmds([0x01,0x42])[1] in [0x41,0x73,0x79,0xF3]):
|
||||
if time.ticks_diff(time.ticks_ms(), timestamp) > timeout:
|
||||
raise AttributeError("Cannot find a PS2Controller",self._cmds([0x01,0x42])[1])
|
||||
|
||||
self._cmds([0x01,0x43,0x00,0x01,0x00]) # 进入配置模式
|
||||
time.sleep_ms(10)
|
||||
self._cmds([0x01,0x44,0x00,mode,0x03,0x00,0x00,0x00,0x00]) # “红绿灯”配置模式
|
||||
time.sleep_ms(10)
|
||||
self._cmds([0x01,0x4D,0x00,0x00,0x01]) # 开启震动模式
|
||||
time.sleep_ms(10)
|
||||
self._cmds([0x01,0x43,0x00,0x00,0x5A,0x5A,0x5A,0x5A,0x5A]) # 完成并保存配置
|
||||
time.sleep_ms(10)
|
||||
|
||||
def _cmd(self,cmd):
|
||||
'''Single byte command sending and receiving'''
|
||||
ret = 0
|
||||
for i in range(8):
|
||||
if cmd & 1 << i:
|
||||
self.do.value(1)
|
||||
else:
|
||||
self.do.value(0)
|
||||
self.clk.value(0)
|
||||
time.sleep_us(10)
|
||||
if self.di.value():
|
||||
ret |= 1 << i
|
||||
self.clk.value(1)
|
||||
self.do.value(1)
|
||||
time.sleep_us(10)
|
||||
return ret
|
||||
|
||||
def _cmds(self,cmds):
|
||||
'''Multi byte command sending and receiving'''
|
||||
self.cs.value(0)
|
||||
buffer=bytearray(9)
|
||||
for i, cmd in enumerate(cmds):
|
||||
buffer[i]=self._cmd(cmd)
|
||||
self.cs.value(1)
|
||||
time.sleep_ms(10)
|
||||
return buffer
|
||||
|
||||
def keydata(self):
|
||||
"""Read the value of the key"""
|
||||
_buffer=self._cmds([0X01, 0X42, 0X00, self.motor1, self.motor2, 0X00, 0X00, 0X00, 0X00])
|
||||
if _buffer[2]==0x5A:
|
||||
handkey=(_buffer[4]<<8)| _buffer[3]
|
||||
self.buttons=-handkey-1 & 0xffff
|
||||
self.rods=(_buffer[5],_buffer[6],_buffer[7],_buffer[8])
|
||||
return self.buttons,self.rods
|
||||
|
||||
def vibration(self,motor1=0,motor2=0):
|
||||
"""Vibration settings"""
|
||||
self.motor1=motor1 #motor1:小电机,只有震和不振
|
||||
self.motor2=0 if motor2<1 else motor2*0xBF//100+0X40 #motor2:大电机,范围0x40-0xff,映射0-100
|
||||
self._cmds([0X01, 0X42, 0X00, self.motor1, self.motor2, 0X00, 0X00, 0X00, 0X00])
|
||||
|
||||
def button(self,psb):
|
||||
return (self.keydata()[0] & psb) > 0
|
||||
|
||||
def analog(self,pss):
|
||||
return self.keydata()[1][pss]
|
||||
215
boards/default/micropython/build/lib/qmc5883l.py
Normal file
215
boards/default/micropython/build/lib/qmc5883l.py
Normal file
@@ -0,0 +1,215 @@
|
||||
"""
|
||||
QMC5883L
|
||||
|
||||
MicroPython library for the QMC5883L 3-Axis Magnetic Sensor
|
||||
=======================================================
|
||||
#Preliminary composition 20220217
|
||||
|
||||
by https://github.com/RigacciOrg/py-qmc5883l.git
|
||||
|
||||
dahanzimin From the Mixly Team
|
||||
"""
|
||||
|
||||
import math
|
||||
import time
|
||||
from micropython import const
|
||||
|
||||
I2CADDR_DEFAULT = const(0x0D) # Default I2C address
|
||||
|
||||
REG_XOUT_LSB = const(0x00) # Output Data Registers for magnetic sensor.
|
||||
REG_YOUT_LSB = const(0x02) # Output Data Registers for magnetic sensor.
|
||||
REG_ZOUT_LSB = const(0x04) # Output Data Registers for magnetic sensor.
|
||||
REG_STATUS_1 = const(0x06) # Status Register.
|
||||
REG_TOUT_LSB = const(0x07) # Output Data Registers for temperature.
|
||||
|
||||
REG_CONTROL_1 = const(0x09) # Reg to control mode of compass.
|
||||
REG_CONTROL_2 = const(0x0A) # Reg to contro2 mode of compass.
|
||||
REG_RST_PERIOD = const(0x0B) # SET/RESET Period Register.
|
||||
REG_CHIP_ID = const(0x0D) # Chip ID register.
|
||||
|
||||
# Flags for Status Register #1.
|
||||
STAT_DRDY = const(0b00000001) # Data Ready.
|
||||
STAT_OVL = const(0b00000010) # Overflow flag.
|
||||
STAT_DOR = const(0b00000100) # Data skipped for reading.
|
||||
# Flags for Status Register #2.
|
||||
INT_ENB = const(0b00000001) # Interrupt Pin Enabling.
|
||||
SOFT_RST = const(0b10000000) # Soft Reset.
|
||||
# Flags for Control Register 1.
|
||||
MODE_STBY = const(0b00000000) # Standby mode.
|
||||
MODE_CONT = const(0b00000001) # Continuous read mode.
|
||||
ODR_10HZ = const(0b00000000) # Output Data Rate Hz.
|
||||
ODR_50HZ = const(0b00000100)
|
||||
ODR_100HZ = const(0b00001000)
|
||||
ODR_200HZ = const(0b00001100)
|
||||
RNG_2G = const(0b00000000) # Range 2 Gauss: for magnetic-clean environments.
|
||||
RNG_8G = const(0b00010000) # Range 8 Gauss: for strong magnetic fields.
|
||||
OSR_512 = const(0b00000000) # Over Sample Rate 512: less noise, more power.
|
||||
OSR_256 = const(0b01000000)
|
||||
OSR_128 = const(0b10000000)
|
||||
OSR_64 = const(0b11000000)
|
||||
|
||||
class Compass:
|
||||
|
||||
def __init__(self,i2c_bus,ODR=ODR_200HZ,RNG=RNG_8G,OSR=OSR_512):
|
||||
self._device = i2c_bus
|
||||
self._address = I2CADDR_DEFAULT
|
||||
self.output_range = RNG
|
||||
self._declination = 0.0
|
||||
self._calibration = [[1.0, 0.0, 0.0],
|
||||
[0.0, 1.0, 0.0],
|
||||
[0.0, 0.0, 1.0]]
|
||||
self._device.scan()
|
||||
time.sleep(0.1)
|
||||
if self._read_byte(REG_CHIP_ID) != 0xFF:
|
||||
raise AttributeError("Cannot find a QMC5883L")
|
||||
|
||||
self.mode_cont = (MODE_CONT | ODR | RNG | OSR)
|
||||
self.mode_stby = (MODE_STBY | ODR_10HZ | RNG_2G | OSR_64)
|
||||
self.mode_continuous()
|
||||
|
||||
def __del__(self):
|
||||
"""Once finished using the sensor, switch to standby mode."""
|
||||
self.mode_standby()
|
||||
|
||||
def _write_byte(self, reg, val):
|
||||
"""Write memory address"""
|
||||
self._device.writeto_mem(self._address,reg,val.to_bytes(1, 'little'))
|
||||
|
||||
def _read_byte(self, reg,nbytes=1):
|
||||
"""Read memory address"""
|
||||
return self._device.readfrom_mem(self._address, reg, nbytes)[0] if nbytes<=1 else self._device.readfrom_mem(self._address, reg, nbytes)[0:nbytes]
|
||||
|
||||
def mode_continuous(self):
|
||||
"""Set the device in continuous read mode."""
|
||||
self._write_byte(REG_CONTROL_2, SOFT_RST) # Soft reset.
|
||||
self._write_byte(REG_CONTROL_2, INT_ENB) # Disable interrupt.
|
||||
self._write_byte(REG_RST_PERIOD, 0x01) # Define SET/RESET period.
|
||||
self._write_byte(REG_CONTROL_1, self.mode_cont) # Set operation mode.
|
||||
|
||||
def mode_standby(self):
|
||||
"""Set the device in standby mode."""
|
||||
self._write_byte(REG_CONTROL_2, SOFT_RST)
|
||||
self._write_byte(REG_CONTROL_2, INT_ENB)
|
||||
self._write_byte(REG_RST_PERIOD, 0x01)
|
||||
self._write_byte(REG_CONTROL_1, self.mode_stby) # Set operation mode.
|
||||
|
||||
def _read_word_2c(self, registry):
|
||||
"""Calculate the 2's complement of a two bytes value."""
|
||||
data=self._read_byte(registry,2)
|
||||
val = (data[1] << 8) | data[0]
|
||||
if val >= 0x8000: # 32768
|
||||
return val - 0x10000 # 65536
|
||||
else:
|
||||
return val
|
||||
|
||||
def ready(self):
|
||||
return self._read_byte(REG_STATUS_1)
|
||||
|
||||
def get_data(self):
|
||||
"""Read data from magnetic and temperature data registers."""
|
||||
i = 0
|
||||
[x, y, z, t] = [None, None, None, 0]
|
||||
while i < 20: # Timeout after about 0.20 seconds.
|
||||
status = self.ready()
|
||||
if status & STAT_OVL:
|
||||
# Some values have reached an overflow.
|
||||
if self.output_range == RNG_2G:
|
||||
raise AttributeError("Consider switching to RNG_8G output range")
|
||||
else:
|
||||
raise AttributeError("Magnetic sensor overflow")
|
||||
if status & STAT_DOR:
|
||||
# Previous measure was read partially, sensor in Data Lock.
|
||||
x = self._read_word_2c(REG_XOUT_LSB)
|
||||
y = self._read_word_2c(REG_YOUT_LSB)
|
||||
z = self._read_word_2c(REG_ZOUT_LSB)
|
||||
continue
|
||||
if status & STAT_DRDY:
|
||||
# Data is ready to read.
|
||||
x = self._read_word_2c(REG_XOUT_LSB)
|
||||
y = self._read_word_2c(REG_YOUT_LSB)
|
||||
z = self._read_word_2c(REG_ZOUT_LSB)
|
||||
t = self._read_word_2c(REG_TOUT_LSB)
|
||||
break
|
||||
else:
|
||||
# Waiting for DRDY.
|
||||
time.sleep(0.01)
|
||||
i += 1
|
||||
return [x, y, z, t/100+20]
|
||||
|
||||
def get_magnet_raw(self):
|
||||
"""Get the 3 axis values from magnetic sensor."""
|
||||
[x, y, z, t] = self.get_data()
|
||||
return [x, y, z]
|
||||
|
||||
def get_magnet(self):
|
||||
"""Return the horizontal magnetic sensor vector with (x, y) calibration applied."""
|
||||
[x, y, z] = self.get_magnet_raw()
|
||||
if x is None or y is None:
|
||||
[x1, y1] = [x, y]
|
||||
else:
|
||||
c = self._calibration
|
||||
x1 = x * c[0][0] + y * c[0][1] + c[0][2]
|
||||
y1 = x * c[1][0] + y * c[1][1] + c[1][2]
|
||||
return [x1, y1]
|
||||
|
||||
def get_bearing_raw(self):
|
||||
"""Horizontal bearing (in degrees) from magnetic value X and Y."""
|
||||
[x, y, z] = self.get_magnet_raw()
|
||||
if x is None or y is None:
|
||||
return None
|
||||
else:
|
||||
b = math.degrees(math.atan2(y, x))
|
||||
if b < 0:
|
||||
b += 360.0
|
||||
return b
|
||||
|
||||
def get_bearing(self):
|
||||
"""Horizontal bearing, adjusted by calibration and declination."""
|
||||
[x, y] = self.get_magnet()
|
||||
if x is None or y is None:
|
||||
return None
|
||||
else:
|
||||
b = math.degrees(math.atan2(y, x))
|
||||
if b < 0:
|
||||
b += 360.0
|
||||
b += self._declination
|
||||
if b < 0.0:
|
||||
b += 360.0
|
||||
elif b >= 360.0:
|
||||
b -= 360.0
|
||||
return round(b,2)
|
||||
|
||||
def get_temp(self):
|
||||
"""Raw (uncalibrated) data from temperature sensor."""
|
||||
[x, y, z, t] = self.get_data()
|
||||
return t
|
||||
|
||||
def set_declination(self, value):
|
||||
"""Set the magnetic declination, in degrees."""
|
||||
try:
|
||||
d = float(value)
|
||||
if d < -180.0 or d > 180.0:
|
||||
raise AttributeError('Declination must be >= -180 and <= 180')
|
||||
else:
|
||||
self._declination = d
|
||||
except:
|
||||
raise AttributeError('Declination must be a float value')
|
||||
|
||||
def get_declination(self):
|
||||
"""Return the current set value of magnetic declination."""
|
||||
return self._declination
|
||||
|
||||
def set_calibration(self, value):
|
||||
"""Set the 3x3 matrix for horizontal (x, y) magnetic vector calibration."""
|
||||
c = [[1.0, 0.0, 0.0], [0.0, 1.0, 0.0], [0.0, 0.0, 1.0]]
|
||||
try:
|
||||
for i in range(0, 3):
|
||||
for j in range(0, 3):
|
||||
c[i][j] = float(value[i][j])
|
||||
self._calibration = c
|
||||
except:
|
||||
logging.error(u'Calibration must be a 3x3 float matrix.')
|
||||
|
||||
def get_calibration(self):
|
||||
"""Return the current set value of the calibration matrix."""
|
||||
return self._calibration
|
||||
103
boards/default/micropython/build/lib/qmi8658.py
Normal file
103
boards/default/micropython/build/lib/qmi8658.py
Normal file
@@ -0,0 +1,103 @@
|
||||
"""
|
||||
QMI8658
|
||||
|
||||
Micropython library for the QMI8658(Accelerometer+Gyroscope)
|
||||
=======================================================
|
||||
|
||||
#Preliminary composition 20220716
|
||||
|
||||
dahanzimin From the Mixly Team
|
||||
"""
|
||||
import time
|
||||
from micropython import const
|
||||
|
||||
QMI8658_REG_DEVICE_ID = const(0x00)
|
||||
|
||||
QMI8658_REG_Ctrl1 = const(0x02) #Serial Interface and Sensor Enable
|
||||
QMI8658_REG_Ctrl2 = const(0x03) #Accelerometer Settings
|
||||
QMI8658_REG_Ctrl3 = const(0x04) #Gyroscope Settings
|
||||
QMI8658_REG_Ctrl5 = const(0x06) #Sensor Data Processing Settings
|
||||
QMI8658_REG_Ctrl7 = const(0x08) #Sensor Data Processing Settings
|
||||
QMI8658_REG_Ctrl9 = const(0x0A) #Host Commands
|
||||
QMI8658_REG_StatusInt = const(0x2D) #Sensor Data Available and Lock Register Address
|
||||
QMI8658_REG_DATA = const(0x33)
|
||||
|
||||
Qmi8658AccRange_2g = 0 #/* +/- 2g range */
|
||||
Qmi8658AccRange_4g = 1 #/* +/- 4g range */
|
||||
Qmi8658AccRange_8g = 2 #/* +/- 8g range */
|
||||
Qmi8658AccRange_16g = 3 #/* +/- 16g range */
|
||||
|
||||
Qmi8658GyrRange_16dps = 0 #/* +-16 degrees per second. */
|
||||
Qmi8658GyrRange_32dps = 1 #/* +-32 degrees per second. */
|
||||
Qmi8658GyrRange_64dps = 2 #/* +-64 degrees per second. */
|
||||
Qmi8658GyrRange_128dps = 3 #/* +-128 degrees per second. */
|
||||
Qmi8658GyrRange_256dps = 4 #/* +-256 degrees per second. */
|
||||
Qmi8658GyrRange_512dps = 5 #/* +-512 degrees per second. */
|
||||
Qmi8658GyrRange_1024dps = 6 #/* +-1024 degrees per second. */
|
||||
Qmi8658GyrRange_2048dps = 7 #/* +-2048 degrees per second. */
|
||||
|
||||
Qmi8658Acc_Gyr_Odr_8000Hz = 0x00 #/* High resolution 8000Hz output rate. */
|
||||
Qmi8658Acc_Gyr_Odr_4000Hz = 0x01 #/* High resolution 4000Hz output rate. */
|
||||
Qmi8658Acc_Gyr_Odr_2000Hz = 0x02 #/* High resolution 2000Hz output rate. */
|
||||
Qmi8658Acc_Gyr_Odr_1000Hz = 0x03 #/* High resolution 1000Hz output rate. */
|
||||
Qmi8658Acc_Gyr_Odr_500Hz = 0x04 #/* High resolution 500Hz output rate. */
|
||||
Qmi8658Acc_Gyr_Odr_250Hz = 0x05 #/* High resolution 250Hz output rate. */
|
||||
Qmi8658Acc_Gyr_Odr_125Hz = 0x06 #/* High resolution 125Hz output rate. */
|
||||
Qmi8658Acc_Gyr_Odr_62_5Hz = 0x07 #/* High resolution 62.5Hz output rate. */
|
||||
Qmi8658Acc_Gyr_Odr_31_25Hz= 0x08 #/* High resolution 31.25Hz output rate. */
|
||||
|
||||
class QMI8658:
|
||||
def __init__(self, i2c_bus,addr=0x6B,AccRange=Qmi8658AccRange_8g,GyrRange=Qmi8658GyrRange_2048dps,Acc_Gyr_Odr=Qmi8658Acc_Gyr_Odr_500Hz):
|
||||
self._device = i2c_bus
|
||||
self._address = addr
|
||||
if self._chip_id() != 0x05:
|
||||
raise AttributeError("Cannot find a QMI8658")
|
||||
|
||||
self._wreg(QMI8658_REG_Ctrl9,0xA2) #做selftest,提高精度
|
||||
time.sleep(1)
|
||||
self._wreg(QMI8658_REG_Ctrl1,0x60)
|
||||
self._wreg(QMI8658_REG_Ctrl7,0x03) #启动
|
||||
self._wreg(QMI8658_REG_Ctrl2,(AccRange<< 4)|Acc_Gyr_Odr) #ACC-500HZ/8G
|
||||
self._wreg(QMI8658_REG_Ctrl3,(GyrRange<< 4)|Acc_Gyr_Odr) #Gyr-500HZ/2048dps
|
||||
self._wreg(QMI8658_REG_Ctrl5,0x75) #Gyr-14%,ACC-5.32%
|
||||
self.gyr_lsb_div= 2**(11-GyrRange)
|
||||
self.acc_lsb_div= 1<<(14-AccRange)
|
||||
|
||||
def _wreg(self, reg, val):
|
||||
'''Write memory address'''
|
||||
self._device.writeto_mem(self._address,reg,val.to_bytes(1, 'little'))
|
||||
|
||||
def _rreg(self, reg,nbytes=1):
|
||||
'''Read memory address'''
|
||||
return self._device.readfrom_mem(self._address, reg, nbytes)[0] if nbytes<=1 else self._device.readfrom_mem(self._address, reg, nbytes)[0:nbytes]
|
||||
|
||||
def _chip_id(self):
|
||||
return self._rreg(QMI8658_REG_DEVICE_ID)
|
||||
|
||||
def status(self):
|
||||
return self._rreg(QMI8658_REG_StatusInt)
|
||||
|
||||
def u2s(self,n):
|
||||
return n if n < (1 << 15) else n - (1 << 16)
|
||||
|
||||
def getdata(self):
|
||||
while self.status() == 0x81:
|
||||
time.sleep(0.001)
|
||||
_buffer=self._rreg(QMI8658_REG_DATA,14)
|
||||
tmp= float(self.u2s(_buffer[1]<<8|_buffer[0]))/256.0
|
||||
acc_x=float(self.u2s(_buffer[3]<<8|_buffer[2]))/self.acc_lsb_div
|
||||
acc_y=float(self.u2s(_buffer[5]<<8|_buffer[4]))/self.acc_lsb_div
|
||||
acc_z=float(self.u2s(_buffer[7]<<8|_buffer[6]))/self.acc_lsb_div
|
||||
gyr_x=float(self.u2s(_buffer[9]<<8|_buffer[8]))/self.gyr_lsb_div
|
||||
gyr_y=float(self.u2s(_buffer[11]<<8|_buffer[10]))/self.gyr_lsb_div
|
||||
gyr_z=float(self.u2s(_buffer[13]<<8|_buffer[12]))/self.gyr_lsb_div
|
||||
return (acc_x,acc_y,acc_z),(gyr_x,gyr_y,gyr_z),round(tmp,2)
|
||||
|
||||
def accelerometer(self):
|
||||
return self.getdata()[0]
|
||||
|
||||
def gyroscope(self):
|
||||
return self.getdata()[1]
|
||||
|
||||
def temperature(self):
|
||||
return self.getdata()[2]
|
||||
115
boards/default/micropython/build/lib/radio.py
Normal file
115
boards/default/micropython/build/lib/radio.py
Normal file
@@ -0,0 +1,115 @@
|
||||
"""
|
||||
Radio-ESP-NOW
|
||||
|
||||
Micropython library for the Radio-ESP-NOW
|
||||
=======================================================
|
||||
#Preliminary composition 20220228
|
||||
|
||||
dahanzimin From the Mixly Team
|
||||
"""
|
||||
|
||||
try:
|
||||
from esp import espnow
|
||||
version = 0
|
||||
except:
|
||||
import espnow
|
||||
version = 1
|
||||
from ubinascii import hexlify,unhexlify
|
||||
import network
|
||||
|
||||
class ESPNow(espnow.ESPNow):
|
||||
def __init__(self,channel=1,txpower=20):
|
||||
super().__init__()
|
||||
self.active(True)
|
||||
self._channel = channel
|
||||
self._txpower = txpower
|
||||
self._nic = network.WLAN(network.AP_IF)
|
||||
self._nic.active(True)
|
||||
self._nic.config(hidden=True,channel=self._channel,txpower=self._txpower)
|
||||
|
||||
def send(self,peer,msg):
|
||||
'''Send data after error reporting and effective processing'''
|
||||
try:
|
||||
_peer=unhexlify(peer)
|
||||
return super().send(_peer, str(msg))
|
||||
except OSError as err:
|
||||
if len(err.args) < 2:
|
||||
raise err
|
||||
if err.args[1] == 'ESP_ERR_ESPNOW_NOT_INIT':
|
||||
raise OSError("Radio(ESPNOW) is not activated, unable to transmit data")
|
||||
elif err.args[1] == 'ESP_ERR_ESPNOW_IF':
|
||||
self._nic.active(True)
|
||||
elif err.args[1] == 'ESP_ERR_ESPNOW_NOT_FOUND':
|
||||
self.add_peer(_peer,channel=self._channel,ifidx=network.AP_IF)
|
||||
return super().send(_peer, str(msg))
|
||||
elif err.args[1] == 'ESP_ERR_ESPNOW_NO_MEM':
|
||||
raise OSError("internal ESP-NOW buffers are full")
|
||||
elif err.args[1] == 'ESP_ERR_ESPNOW_ARG':
|
||||
raise OSError("invalid argument")
|
||||
else:
|
||||
raise err
|
||||
|
||||
def recv(self):
|
||||
'''Receive data'''
|
||||
if self.any():
|
||||
host, msg = super().recv()
|
||||
return hexlify(host).decode(),msg.decode()
|
||||
else :
|
||||
return None,None
|
||||
|
||||
def set_channel(self,channel=None,txpower=None):
|
||||
self._channel = self._channel if channel is None else channel
|
||||
self._nic.config(hidden=True, channel=self._channel, txpower=self._txpower if txpower is None else txpower)
|
||||
|
||||
def _cb_handle0(self, event_code,data):
|
||||
'''Callback processing conversion'''
|
||||
if self._on_handle:
|
||||
if isinstance(self._on_handle, list):
|
||||
for func in self._on_handle:
|
||||
cmd = func.__name__.rfind('__')
|
||||
if cmd != -1:
|
||||
cmd=func.__name__[cmd+2:]
|
||||
if cmd == str(data[1].decode()):
|
||||
func(hexlify(data[0]).decode(),data[1].decode())
|
||||
else:
|
||||
func(hexlify(data[0]).decode(),data[1].decode())
|
||||
else:
|
||||
self._on_handle(hexlify(data[0]).decode(),data[1].decode())
|
||||
|
||||
def _cb_handle1(self, ee):
|
||||
'''Callback processing conversion'''
|
||||
host, msg = super().recv()
|
||||
if self._on_handle:
|
||||
if isinstance(self._on_handle, list):
|
||||
for func in self._on_handle:
|
||||
cmd = func.__name__.rfind('__')
|
||||
if cmd != -1:
|
||||
cmd=func.__name__[cmd+2:]
|
||||
if cmd == str(msg.decode()):
|
||||
func(hexlify(host).decode(), msg.decode())
|
||||
else:
|
||||
func(hexlify(host).decode(), msg.decode())
|
||||
else:
|
||||
self._on_handle(hexlify(host).decode(), msg.decode())
|
||||
|
||||
def recv_cb(self, recv_cbs):
|
||||
'''Receive callback'''
|
||||
self._on_handle = recv_cbs
|
||||
if recv_cbs:
|
||||
if version == 0:
|
||||
self.irq(self._cb_handle0)
|
||||
else:
|
||||
self.irq(self._cb_handle1)
|
||||
|
||||
def info(self):
|
||||
'''Get the paired Mac and rssi'''
|
||||
_info=[]
|
||||
for i in self.peers_table:
|
||||
_info.append((hexlify(i).decode(),self.peers_table[i][0]))
|
||||
return _info
|
||||
|
||||
@property
|
||||
def mac(self):
|
||||
'''Get mac address'''
|
||||
return hexlify(self._nic.config('mac')).decode()
|
||||
|
||||
279
boards/default/micropython/build/lib/rc522.py
Normal file
279
boards/default/micropython/build/lib/rc522.py
Normal file
@@ -0,0 +1,279 @@
|
||||
"""
|
||||
RC522
|
||||
|
||||
Micropython library for the RC522 RFID (I2C&SPI)
|
||||
=======================================================
|
||||
#Preliminary composition 20231204
|
||||
|
||||
dahanzimin From the Mixly Team
|
||||
"""
|
||||
import machine
|
||||
from micropython import const
|
||||
|
||||
RC_OK = True
|
||||
RC_NOTAGERR = None
|
||||
RC_ERR = False
|
||||
RC_REQIDL = const(0x26)
|
||||
RC_REQALL = const(0x52)
|
||||
RC_AUTHENT1A = const(0x60)
|
||||
RC_AUTHENT1B = const(0x61)
|
||||
RC_Version = const(0x37)
|
||||
|
||||
class RC522:
|
||||
def __init__(self, drive_bus,cs_pin=None,addr=0x28):
|
||||
self._device= drive_bus
|
||||
if type(drive_bus) in [machine.I2C,machine.SoftI2C]:
|
||||
self._type=True
|
||||
self._address = addr
|
||||
elif type(drive_bus) in [machine.SPI,machine.SoftSPI]:
|
||||
self._type=False
|
||||
self._cs = machine.Pin(cs_pin, machine.Pin.OUT)
|
||||
else:
|
||||
raise ValueError("RC522 only supports I2C and SPI")
|
||||
|
||||
self.init()
|
||||
self.add_list=[1,2,4,5,6,8,9,10,12,13,14,16,17,18,20,21,22,24,25,26,28,29,30,32,33,34,36,37,38,40,41,42,44,45,46,48,49,50,52,53,54,56,57,58,60,61,62]
|
||||
|
||||
def _wreg(self, reg, val):
|
||||
'''Write memory address'''
|
||||
if self._type:
|
||||
self._device.writeto_mem(self._address,reg,val.to_bytes(1, 'little'))
|
||||
else:
|
||||
self._cs.value(0)
|
||||
self._device.write(b'%c' % int(0xff & ((reg << 1) & 0x7e)))
|
||||
self._device.write(b'%c' % int(0xff & val))
|
||||
self._cs.value(1)
|
||||
|
||||
def _rreg(self, reg):
|
||||
'''Read memory address'''
|
||||
if self._type:
|
||||
return self._device.readfrom_mem(self._address, reg, 1)[0]
|
||||
else:
|
||||
self._cs.value(0)
|
||||
self._device.write(b'%c' % int(0xff & (((reg << 1) & 0x7e) | 0x80)))
|
||||
val = self._device.read(1)
|
||||
self._cs.value(1)
|
||||
return val[0]
|
||||
|
||||
def _sflags(self, reg, mask):
|
||||
self._wreg(reg, self._rreg(reg) | mask)
|
||||
|
||||
def _cflags(self, reg, mask):
|
||||
self._wreg(reg, self._rreg(reg) & (~mask))
|
||||
|
||||
def _tocard(self, cmd, send):
|
||||
recv = []
|
||||
bits = 0
|
||||
irq_en = 0
|
||||
wait_irq =0
|
||||
n = 0
|
||||
stat = RC_ERR
|
||||
if cmd == 0x0E:
|
||||
irq_en = 0x12
|
||||
wait_irq = 0x10
|
||||
elif cmd == 0x0C:
|
||||
irq_en = 0x77
|
||||
wait_irq = 0x30
|
||||
self._wreg(0x02, irq_en)
|
||||
self._cflags(0x04, 0x80)
|
||||
self._sflags(0x0A, 0x80)
|
||||
self._wreg(0x01, 0x00)
|
||||
for c in send:
|
||||
self._wreg(0x09, c)
|
||||
self._wreg(0x01, cmd)
|
||||
|
||||
if cmd == 0x0C:
|
||||
self._sflags(0x0D, 0x80)
|
||||
|
||||
i = 100
|
||||
while True:
|
||||
n = self._rreg(0x04)
|
||||
i -= 1
|
||||
if ~((i != 0) and ~(n & 0x01) and ~(n & wait_irq)):
|
||||
break
|
||||
|
||||
self._cflags(0x0D, 0x80)
|
||||
if i:
|
||||
if (self._rreg(0x06) & 0x1B) == 0x00:
|
||||
stat = RC_OK
|
||||
|
||||
if n & irq_en & 0x01:
|
||||
stat = RC_NOTAGERR
|
||||
elif cmd == 0x0C:
|
||||
n = self._rreg(0x0A)
|
||||
lbits = self._rreg(0x0C) & 0x07
|
||||
if lbits != 0:
|
||||
bits = (n - 1) * 8 + lbits
|
||||
else:
|
||||
bits = n * 8
|
||||
if n == 0:
|
||||
n = 1
|
||||
elif n > 16:
|
||||
n = 16
|
||||
for _ in range(n):
|
||||
recv.append(self._rreg(0x09))
|
||||
else:
|
||||
stat = RC_ERR
|
||||
return stat, recv, bits
|
||||
|
||||
def _crc(self, data):
|
||||
self._cflags(0x05, 0x04)
|
||||
self._sflags(0x0A, 0x80)
|
||||
for c in data:
|
||||
self._wreg(0x09, c)
|
||||
self._wreg(0x01, 0x03)
|
||||
i = 0xFF
|
||||
while True:
|
||||
n = self._rreg(0x05)
|
||||
i -= 1
|
||||
if not ((i != 0) and not (n & 0x04)):
|
||||
break
|
||||
return [self._rreg(0x22), self._rreg(0x21)]
|
||||
|
||||
def init(self):
|
||||
self.reset()
|
||||
self._wreg(0x2A, 0x8D)
|
||||
self._wreg(0x2B, 0x3E)
|
||||
self._wreg(0x2D, 30)
|
||||
self._wreg(0x2C, 0)
|
||||
self._wreg(0x15, 0x40)
|
||||
self._wreg(0x11, 0x3D)
|
||||
self._wreg(0x26, 0x68)
|
||||
#A32NQ32C3 Additional Register Configuration
|
||||
if self._rreg(RC_Version) == 0x82:
|
||||
self._wreg(0x12, 0x0)
|
||||
self._wreg(0x13, 0x0)
|
||||
self._wreg(0x14, 0x84)
|
||||
self._wreg(0x18, 0x33)
|
||||
self._wreg(0x0c, 0x10)
|
||||
self.antenna_on()
|
||||
|
||||
def reset(self):
|
||||
self._wreg(0x01, 0x0F)
|
||||
|
||||
def antenna_on(self, on=True):
|
||||
if on and ~(self._rreg(0x14) & 0x03):
|
||||
self._sflags(0x14, 0x03)
|
||||
else:
|
||||
self._cflags(0x14, 0x03)
|
||||
|
||||
def request(self, mode):
|
||||
self._wreg(0x0D, 0x07)
|
||||
stat, recv, bits = self._tocard(0x0C, [mode])
|
||||
if (stat != RC_OK) | (bits != 0x10):
|
||||
stat = RC_ERR
|
||||
return stat, bits
|
||||
|
||||
def anticoll(self):
|
||||
ser_chk = 0
|
||||
ser = [0x93, 0x20]
|
||||
self._wreg(0x0D, 0x00)
|
||||
(stat, recv, bits) = self._tocard(0x0C, ser)
|
||||
|
||||
if stat == RC_OK:
|
||||
if len(recv) == 5:
|
||||
for i in range(4):
|
||||
ser_chk = ser_chk ^ recv[i]
|
||||
if ser_chk != recv[4]:
|
||||
stat = RC_ERR
|
||||
else:
|
||||
stat = RC_ERR
|
||||
return stat, recv
|
||||
|
||||
def select_tag(self, ser):
|
||||
buf = [0x93, 0x70] + ser[:5]
|
||||
buf += self._crc(buf)
|
||||
(stat, recv, bits) = self._tocard(0x0C, buf)
|
||||
return RC_OK if (stat == RC_OK) and (bits == 0x18) else RC_ERR
|
||||
|
||||
def auth(self, mode, addr, sect, ser):
|
||||
return self._tocard(0x0E, [mode, addr] + sect + ser[:4])[0]
|
||||
|
||||
def stop_crypto1(self):
|
||||
self._cflags(0x08, 0x08)
|
||||
|
||||
def read(self, addr):
|
||||
data = [0x30, addr]
|
||||
data += self._crc(data)
|
||||
(stat, recv, _) = self._tocard(0x0C, data)
|
||||
return recv if stat == RC_OK else None
|
||||
|
||||
def write(self, addr, data):
|
||||
buf = [0xA0, addr]
|
||||
buf += self._crc(buf)
|
||||
(stat, recv, bits) = self._tocard(0x0C, buf)
|
||||
|
||||
if not (stat == RC_OK) or not (bits == 4) or not ((recv[0] & 0x0F) == 0x0A):
|
||||
stat = RC_ERR
|
||||
else:
|
||||
buf = [0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]
|
||||
for i in range(len(data)):
|
||||
buf[i]=data[i]
|
||||
buf += self._crc(buf)
|
||||
(stat, recv, bits) = self._tocard(0x0C, buf)
|
||||
if not (stat == RC_OK) or not (bits == 4) or not ((recv[0] & 0x0F) == 0x0A):
|
||||
stat = RC_ERR
|
||||
return stat
|
||||
|
||||
def read_card(self,add,x='ALL'):#0:all,i:id,2:content
|
||||
if add>=47:
|
||||
raise AttributeError("Out of address range")
|
||||
stat, tag_type = self.request(RC_REQALL)
|
||||
if stat !=RC_OK:
|
||||
stat, tag_type = self.request(RC_REQALL)
|
||||
if stat == RC_OK:
|
||||
(stat, raw_uid) = self.anticoll()
|
||||
if stat == RC_OK:
|
||||
if self.select_tag(raw_uid) == RC_OK:
|
||||
key = [0xFF,0xFF,0xFF,0xFF,0xFF,0xFF]
|
||||
if self.auth(RC_AUTHENT1A, self.add_list[add], key, raw_uid) == RC_OK:
|
||||
card = self.read(self.add_list[add])
|
||||
try:
|
||||
card = bytes(card).decode().replace("\x00", '') if card else None
|
||||
except:
|
||||
card = bytes(card) if card else None
|
||||
self.stop_crypto1()
|
||||
if x == "ALL":
|
||||
return int('{}{}{}{}'.format(raw_uid[0], raw_uid[1], raw_uid[2], raw_uid[3])), card
|
||||
elif x == "id":
|
||||
return int('{}{}{}{}'.format(raw_uid[0], raw_uid[1], raw_uid[2], raw_uid[3]))
|
||||
elif x == "content":
|
||||
return card
|
||||
|
||||
def write_card(self, data,add):
|
||||
if add>=47:
|
||||
raise AttributeError("Out of address range")
|
||||
stat, tag_type = self.request(RC_REQALL)
|
||||
if stat !=RC_OK:
|
||||
stat, tag_type = self.request(RC_REQALL)
|
||||
if stat == RC_OK:
|
||||
(stat, raw_uid) = self.anticoll()
|
||||
if stat == RC_OK:
|
||||
if self.select_tag(raw_uid) == RC_OK:
|
||||
key = [0xFF,0xFF,0xFF,0xFF,0xFF,0xFF]
|
||||
if self.auth(RC_AUTHENT1A, self.add_list[add], key, raw_uid) == RC_OK:
|
||||
try:
|
||||
data =list(data.encode())
|
||||
except:
|
||||
data =list(data)
|
||||
if len(data)>16:
|
||||
raise AttributeError("Input must be less than 16 bytes")
|
||||
stat = self.write(self.add_list[add], data)
|
||||
self.stop_crypto1()
|
||||
if stat == RC_OK:
|
||||
print('Data written to card')
|
||||
return RC_OK
|
||||
else:
|
||||
print('Failed to write data to card')
|
||||
return RC_ERR
|
||||
else:
|
||||
print('Authentication error')
|
||||
return RC_ERR
|
||||
else:
|
||||
print('Failed to select tag')
|
||||
return RC_ERR
|
||||
else:
|
||||
return RC_ERR
|
||||
|
||||
def scan_card(self,stat=RC_REQIDL):
|
||||
return self.request(stat)[0]
|
||||
239
boards/default/micropython/build/lib/rfm98.py
Normal file
239
boards/default/micropython/build/lib/rfm98.py
Normal file
@@ -0,0 +1,239 @@
|
||||
"""
|
||||
RFM98
|
||||
|
||||
Micropython library for the RFM98 LoRa
|
||||
=======================================================
|
||||
#Preliminary composition 20220406
|
||||
#Rebuild and optimize execution 20220412
|
||||
#Repair receive mode 20220428
|
||||
|
||||
dahanzimin From the Mixly Team
|
||||
"""
|
||||
import gc
|
||||
import time
|
||||
from machine import Pin
|
||||
from micropython import const
|
||||
|
||||
_REG_FIFO = const(0x00)
|
||||
_REG_OP_MODE = const(0x01)
|
||||
_REG_FRF_MSB = const(0x06)
|
||||
_REG_FRF_MID = const(0x07)
|
||||
_REG_FRF_LSB = const(0x08)
|
||||
_REG_PA_CONFIG = const(0x09)
|
||||
_REG_LNA = const(0x0C)
|
||||
_REG_FIFO_ADDR_PTR = const(0x0D)
|
||||
_REG_FIFO_TX_BASE_ADDR = const(0x0E)
|
||||
_REG_FIFO_RX_BASE_ADDR = const(0x0F)
|
||||
_REG_FIFO_RX_CURRENT_ADDR = const(0x10)
|
||||
_REG_IRQ_FLAGS = const(0x12)
|
||||
_REG_RX_NB_BYTES = const(0x13)
|
||||
_REG_PKT_SNR_VALUE = const(0x19)
|
||||
_REG_PKT_RSSI_VALUE = const(0x1A)
|
||||
_REG_MODEM_CONFIG1 = const(0x1D)
|
||||
_REG_MODEM_CONFIG2 = const(0x1E)
|
||||
_REG_PREAMBLE_MSB = const(0x20)
|
||||
_REG_PREAMBLE_LSB = const(0x21)
|
||||
_REG_PAYLOAD_LENGTH = const(0x22)
|
||||
_REG_MODEM_CONFIG3 = const(0x26)
|
||||
_REG_DIO_MAPPING1 = const(0x40)
|
||||
_REG_DIO_MAPPING2 = const(0x41)
|
||||
_REG_VERSION = const(0x42)
|
||||
_REG_PA_DAC = const(0x4D)
|
||||
_DETECTION_OPTIMIZE = const(0x31)
|
||||
_DETECTION_THRESHOLD = const(0x37)
|
||||
|
||||
_MODE_LONG_RANGE_MODE = const(0x88)
|
||||
_MODE_SLEEP = const(0x00)
|
||||
_MODE_STDBY = const(0x01)
|
||||
_MODE_TX = const(0x03)
|
||||
_MODE_RX = const(0x05)
|
||||
|
||||
class RFM98:
|
||||
def __init__(self,spi,cs_pin,frequency_mhz=433.0,signal_bandwidth=125E3,coding_rate=5,spreading_factor=7,**kw):
|
||||
self._spi = spi
|
||||
self._pin_ss = Pin(cs_pin, Pin.OUT)
|
||||
self._frequency_mhz=frequency_mhz
|
||||
self._signal_bandwidth=signal_bandwidth
|
||||
self._coding_rate=coding_rate
|
||||
self._spreading_factor=spreading_factor
|
||||
self._kw=kw
|
||||
self.init()
|
||||
|
||||
def init(self):
|
||||
for i in range(6):
|
||||
if self._read_u8(_REG_VERSION) == 18: # No device type check!
|
||||
break
|
||||
if i >=5:
|
||||
raise AttributeError("Cannot find a RFM9x")
|
||||
time.sleep(1)
|
||||
|
||||
self.sleep()
|
||||
time.sleep(0.01)
|
||||
if self._read_u8(_REG_OP_MODE) != (_MODE_LONG_RANGE_MODE | _MODE_SLEEP):
|
||||
raise RuntimeError("Failed to configure radio for LoRa mode, check wiring!")
|
||||
self._write_u8(_REG_FIFO_TX_BASE_ADDR, 0x00) # Setup entire 256 byte FIFO
|
||||
self._write_u8(_REG_FIFO_RX_BASE_ADDR, 0x00)
|
||||
|
||||
self.idle()
|
||||
self.coding_rate(self._coding_rate) # CR: 5...8
|
||||
self.frequency_mhz(self._frequency_mhz) # Set frequency_mhz 433±10.00
|
||||
self.signal_bandwidth(self._signal_bandwidth) # BW: 7.8...500 kHz
|
||||
self.spreading_factor(self._spreading_factor) # SF: 6..12
|
||||
self.enable_crc(self._kw.get('enable_crc', True)) # Set enable_crc
|
||||
self.preamble_length(self._kw.get('preamble_length', 6))
|
||||
self.tx_power(self._kw.get('tx_power', 16),self._kw.get('high_power', True))
|
||||
|
||||
self._write_u8(_REG_MODEM_CONFIG3, 0x04) #set AGC - True
|
||||
if 1000 /(self._signal_bandwidth / 2**self._spreading_factor) > 16:
|
||||
self._write_u8(_REG_MODEM_CONFIG3, self._read_u8(_REG_MODEM_CONFIG3) | 0x08)
|
||||
|
||||
def transfer(self, address, value = 0x00):
|
||||
response = bytearray(1)
|
||||
self._pin_ss.value(0)
|
||||
self._spi.write(bytes([address]))
|
||||
self._spi.write_readinto(bytes([value]), response)
|
||||
self._pin_ss.value(1)
|
||||
return response
|
||||
|
||||
def _read_u8(self, address):
|
||||
response = self.transfer(address & 0x7f)
|
||||
return int.from_bytes(response, 'big')
|
||||
|
||||
def _write_u8(self, address, value):
|
||||
self.transfer(address | 0x80, value)
|
||||
|
||||
def idle(self):
|
||||
self._write_u8(_REG_OP_MODE, _MODE_LONG_RANGE_MODE | _MODE_STDBY)
|
||||
|
||||
def sleep(self):
|
||||
self._write_u8(_REG_OP_MODE, _MODE_LONG_RANGE_MODE | _MODE_SLEEP)
|
||||
|
||||
def listen(self):
|
||||
self._write_u8(_REG_OP_MODE, _MODE_LONG_RANGE_MODE | _MODE_RX)
|
||||
self._write_u8(_REG_DIO_MAPPING1, 0x00)
|
||||
self._write_u8(_REG_DIO_MAPPING2, 0x40)
|
||||
|
||||
def transmit(self):
|
||||
self._write_u8(_REG_OP_MODE, _MODE_LONG_RANGE_MODE | _MODE_TX)
|
||||
self._write_u8(_REG_DIO_MAPPING1, 0x01)
|
||||
self._write_u8(_REG_DIO_MAPPING2, 0x00)
|
||||
|
||||
def preamble_length(self, val):
|
||||
self._write_u8(_REG_PREAMBLE_MSB, (val >> 8) & 0xFF)
|
||||
self._write_u8(_REG_PREAMBLE_LSB, val & 0xFF)
|
||||
|
||||
def frequency_mhz(self, val):
|
||||
if val < 410 or val > 525:
|
||||
raise RuntimeError("frequency_mhz must be between 410 and 525")
|
||||
frf = int((val * 1000000.0) /(32000000.0 / 524288)) & 0xFFFFFF
|
||||
self._write_u8(_REG_FRF_MSB, frf >> 16)
|
||||
self._write_u8(_REG_FRF_MID, (frf >> 8) & 0xFF)
|
||||
self._write_u8(_REG_FRF_LSB, frf & 0xFF)
|
||||
|
||||
def tx_power(self, val,high_power=True):
|
||||
if high_power:
|
||||
assert 5 <= val <= 23
|
||||
if val > 20:
|
||||
self._write_u8(_REG_PA_DAC, 0x07)
|
||||
val -= 3
|
||||
else:
|
||||
self._write_u8(_REG_PA_DAC, 0x04)
|
||||
self._write_u8(_REG_PA_CONFIG, 0x80 | (val - 5))
|
||||
else:
|
||||
assert -1 <= val <= 14
|
||||
self._write_u8(_REG_PA_CONFIG, 0x70 | (val +1))
|
||||
|
||||
def packet_rssi(self): #last RSSI reading
|
||||
return self._read_u8(_REG_PKT_RSSI_VALUE)-157
|
||||
|
||||
def packet_snr(self): #last SNR reading
|
||||
snr_byte = self._read_u8(_REG_PKT_SNR_VALUE)
|
||||
return snr_byte/4 if snr_byte<=127 else (snr_byte -256 )/4
|
||||
|
||||
def signal_bandwidth(self, val):
|
||||
bw_bins = (7800, 10400, 15600, 20800, 31250, 41700, 62500, 125000, 250000)
|
||||
for bw_id, cutoff in enumerate(bw_bins):
|
||||
if val <= cutoff:
|
||||
break
|
||||
else:
|
||||
bw_id = 9
|
||||
self._write_u8(_REG_MODEM_CONFIG1,(self._read_u8(_REG_MODEM_CONFIG1) & 0x0F) | (bw_id << 4))
|
||||
if val >= 500000:
|
||||
self._write_u8(_DETECTION_OPTIMIZE,(self._read_u8(_DETECTION_OPTIMIZE) | 0x80))
|
||||
self._write_u8(0x36, 0x02)
|
||||
self._write_u8(0x3A, 0x7F)
|
||||
else:
|
||||
self._write_u8(_DETECTION_OPTIMIZE,(self._read_u8(_DETECTION_OPTIMIZE) & 0x7F))
|
||||
self._write_u8(0x36, 0x03)
|
||||
if val == 7800:
|
||||
self._write_u8(0x2F, 0x48)
|
||||
elif val >= 62500:
|
||||
self._write_u8(0x2F, 0x40)
|
||||
else:
|
||||
self._write_u8(0x2F, 0x44)
|
||||
self._write_u8(0x30, 0)
|
||||
|
||||
def coding_rate(self, val):
|
||||
denominator = min(max(val, 5), 8)
|
||||
cr_id = denominator - 4
|
||||
self._write_u8(_REG_MODEM_CONFIG1,(self._read_u8(_REG_MODEM_CONFIG1) & 0xF1) | (cr_id << 1))
|
||||
|
||||
def spreading_factor(self, val):
|
||||
val = min(max(val, 6), 12)
|
||||
self._write_u8(_DETECTION_OPTIMIZE,self._read_u8(_DETECTION_OPTIMIZE)|0x05 if val == 6 else self._read_u8(_DETECTION_OPTIMIZE)|0x03)
|
||||
self._write_u8(_DETECTION_THRESHOLD, 0x0C if val == 6 else 0x0A)
|
||||
self._write_u8(_REG_MODEM_CONFIG2,((self._read_u8(_REG_MODEM_CONFIG2) & 0x0F)| ((val << 4) & 0xF0)))
|
||||
|
||||
def enable_crc(self, val):
|
||||
if val:
|
||||
self._write_u8(_REG_MODEM_CONFIG2,self._read_u8(_REG_MODEM_CONFIG2) | 0x04)
|
||||
else:
|
||||
self._write_u8(_REG_MODEM_CONFIG2,self._read_u8(_REG_MODEM_CONFIG2) & 0xFB)
|
||||
|
||||
def irq_done(self): #irq status
|
||||
return self._read_u8(_REG_IRQ_FLAGS)
|
||||
|
||||
def send(self,msg,timeout=2):
|
||||
self.idle() # Stop receiving to clear FIFO and keep it clear.
|
||||
self._write_u8(_REG_FIFO_ADDR_PTR, 0x00) # FIFO starts at 0.
|
||||
if isinstance(msg, str):
|
||||
msg = msg.encode()
|
||||
size = min(len(msg), 255)
|
||||
for i in range(size): # write data
|
||||
self._write_u8(_REG_FIFO, msg[i]) # Write payload.
|
||||
self._write_u8(_REG_PAYLOAD_LENGTH, size) # Write payload and header length.
|
||||
self.transmit() # Turn on transmit mode to send out the packet.
|
||||
|
||||
timed_out = False
|
||||
start = time.ticks_ms()
|
||||
while not timed_out and not((self._read_u8(_REG_IRQ_FLAGS) & 0x8) >> 3):
|
||||
if time.ticks_diff(time.ticks_ms(), start) >= timeout * 1000:
|
||||
timed_out = True
|
||||
|
||||
self.idle() # Enter idle mode to stop receiving other packets.
|
||||
gc.collect()
|
||||
self._write_u8(_REG_IRQ_FLAGS, 0xFF) # Clear interrupt.
|
||||
return not timed_out
|
||||
|
||||
def recv(self):
|
||||
if self._read_u8(_REG_OP_MODE) != (_MODE_LONG_RANGE_MODE | _MODE_RX):
|
||||
self.listen() # Enter receive mode
|
||||
|
||||
flags=self.irq_done()
|
||||
if flags & 0x40:
|
||||
self.idle() # Enter idle mode to stop receiving other packets.
|
||||
fifo_length = self._read_u8(_REG_RX_NB_BYTES) # Read the length of the FIFO.
|
||||
if fifo_length > 0: # Read the data from the FIFO.
|
||||
self._write_u8(_REG_FIFO_ADDR_PTR, self._read_u8(_REG_FIFO_RX_CURRENT_ADDR))
|
||||
packet = bytearray()
|
||||
for i in range(fifo_length):
|
||||
packet.append(self._read_u8(_REG_FIFO)) # Read the packet.
|
||||
self._write_u8(_REG_IRQ_FLAGS, 0xFF) # Clear interrupt.
|
||||
gc.collect()
|
||||
try :
|
||||
return bytes(packet).decode()
|
||||
except:
|
||||
return bytes(packet)
|
||||
elif flags== 0x15:
|
||||
print("Timeout not handled , overflow error,will restart!")
|
||||
self.init()
|
||||
72
boards/default/micropython/build/lib/sc7a20.py
Normal file
72
boards/default/micropython/build/lib/sc7a20.py
Normal file
@@ -0,0 +1,72 @@
|
||||
"""
|
||||
SC7A20
|
||||
|
||||
Micropython library for the SC7A20 Accelerometer
|
||||
=================================================
|
||||
#Preliminary composition 20240312
|
||||
|
||||
@dahanzimin From the Mixly Team
|
||||
"""
|
||||
import time
|
||||
from math import atan,sqrt,degrees
|
||||
from micropython import const
|
||||
|
||||
SC7A20_ADDRESS = const(0x19)
|
||||
SC7A20_REG_ID = const(0x0F)
|
||||
SC7A20_REG_CTRL1 = const(0x20)
|
||||
SC7A20_REG_CTRL2 = const(0x21)
|
||||
SC7A20_REG_CTRL3 = const(0x22)
|
||||
SC7A20_REG_CTRL4 = const(0x23)
|
||||
SC7A20_REG_DATA = const(0x28)
|
||||
|
||||
#2g 4g 8g 16g
|
||||
_Range_X = (1024,512,256,128)
|
||||
|
||||
class SC7A20:
|
||||
|
||||
def __init__(self, i2c_bus, set_range=2, front=False):
|
||||
self._device = i2c_bus
|
||||
self._address = SC7A20_ADDRESS
|
||||
self._range = set_range #default 8g range
|
||||
self._front = front
|
||||
|
||||
if self._rreg(SC7A20_REG_ID) != 0x11:
|
||||
raise AttributeError("Cannot find a SC7A20")
|
||||
self._wreg(SC7A20_REG_CTRL1, 0X77) #400HZ,xyz使能
|
||||
self._wreg(SC7A20_REG_CTRL2, 0X00) #禁止高通滤波模式
|
||||
self._wreg(SC7A20_REG_CTRL3, 0X00) #禁止中断
|
||||
self._wreg(SC7A20_REG_CTRL4, 0X00 | set_range << 4) #连续更新,设置量程
|
||||
|
||||
def _wreg(self, reg, val):
|
||||
'''Write memory address'''
|
||||
self._device.writeto_mem(self._address,reg,val.to_bytes(1, 'little'))
|
||||
|
||||
def _rreg(self, reg):
|
||||
'''Read memory address'''
|
||||
return self._device.readfrom_mem(self._address, reg, 1)[0]
|
||||
|
||||
def u2s(self, n):
|
||||
return n if n < (1 << 7) else n - (1 << 8)
|
||||
|
||||
@property
|
||||
def getdata(self):
|
||||
x_acc = ((self.u2s(self._rreg(SC7A20_REG_DATA + 1)) << 8 | self._rreg(SC7A20_REG_DATA + 0)) >> 4) / _Range_X[self._range]
|
||||
y_acc = ((self.u2s(self._rreg(SC7A20_REG_DATA + 3)) << 8 | self._rreg(SC7A20_REG_DATA + 2)) >> 4) / _Range_X[self._range]
|
||||
z_acc = ((self.u2s(self._rreg(SC7A20_REG_DATA + 5)) << 8 | self._rreg(SC7A20_REG_DATA + 4)) >> 4) / _Range_X[self._range]
|
||||
return (-x_acc, y_acc, z_acc, None) if self._front else (x_acc, y_acc, z_acc, None)
|
||||
|
||||
def acceleration(self):
|
||||
return self.getdata[0:3]
|
||||
|
||||
def strength(self):
|
||||
from math import sqrt
|
||||
return sqrt(self.getdata[0]**2+self.getdata[1]**2+self.getdata[2]**2)
|
||||
|
||||
def temperature(self):
|
||||
return self.getdata[3]
|
||||
|
||||
def eulerangles(self,upright=False):
|
||||
x, y, z = self.acceleration()
|
||||
pitch = degrees(atan(z / sqrt(x ** 2 + y ** 2))) if upright else degrees(atan(y / sqrt(x ** 2 + z ** 2)))
|
||||
roll = degrees(atan(x / sqrt(y ** 2 + z ** 2)))
|
||||
return round(pitch,2),round(roll,2)
|
||||
231
boards/default/micropython/build/lib/sdcard.py
Normal file
231
boards/default/micropython/build/lib/sdcard.py
Normal file
@@ -0,0 +1,231 @@
|
||||
"""
|
||||
MicroPython driver for SD cards using SPI bus.
|
||||
"""
|
||||
import time
|
||||
from machine import Pin
|
||||
from micropython import const
|
||||
|
||||
_CMD_TIMEOUT = const(100)
|
||||
_R1_IDLE_STATE = const(1 << 0)
|
||||
_R1_ILLEGAL_COMMAND = const(1 << 2)
|
||||
_TOKEN_CMD25 = const(0xFC)
|
||||
_TOKEN_STOP_TRAN = const(0xFD)
|
||||
_TOKEN_DATA = const(0xFE)
|
||||
|
||||
class SDCard:
|
||||
def __init__(self, spi, cs_pin=None, baudrate=50000000):
|
||||
self.spi = spi
|
||||
self.cs = Pin(cs_pin, Pin.OUT, value=1) if cs_pin else None
|
||||
self.cmdbuf = bytearray(6)
|
||||
self.dummybuf = bytearray(512)
|
||||
self.tokenbuf = bytearray(1)
|
||||
for i in range(512):
|
||||
self.dummybuf[i] = 0xFF
|
||||
self.dummybuf_memoryview = memoryview(self.dummybuf)
|
||||
# initialise the card
|
||||
self.init_card(baudrate)
|
||||
|
||||
def init_spi(self, baudrate):
|
||||
self.spi.init(baudrate=baudrate, phase=0, polarity=0)
|
||||
|
||||
def init_card(self, baudrate):
|
||||
# init SPI bus; use low data rate for initialisation
|
||||
self.init_spi(100000)
|
||||
# clock card at least 100 cycles with cs high
|
||||
for i in range(16):
|
||||
self.spi.write(b"\xff")
|
||||
# CMD0: init card; should return _R1_IDLE_STATE (allow 5 attempts)
|
||||
for _ in range(5):
|
||||
if self.cmd(0, 0, 0x95) == _R1_IDLE_STATE:
|
||||
break
|
||||
else:
|
||||
raise OSError("no SD card")
|
||||
# CMD8: determine card version
|
||||
r = self.cmd(8, 0x01AA, 0x87, 4)
|
||||
if r == _R1_IDLE_STATE:
|
||||
self.init_card_v2()
|
||||
elif r == (_R1_IDLE_STATE | _R1_ILLEGAL_COMMAND):
|
||||
self.init_card_v1()
|
||||
else:
|
||||
raise OSError("couldn't determine SD card version")
|
||||
# CMD9: response R2 (R1 byte + 16-byte block read)
|
||||
if self.cmd(9, 0, 0, 0, False) != 0:
|
||||
raise OSError("no response from SD card")
|
||||
csd = bytearray(16)
|
||||
self.readinto(csd)
|
||||
if csd[0] & 0xC0 == 0x40: # CSD version 2.0
|
||||
self.sectors = ((csd[8] << 8 | csd[9]) + 1) * 1024
|
||||
elif csd[0] & 0xC0 == 0x00: # CSD version 1.0 (old, <=2GB)
|
||||
c_size = (csd[6] & 0b11) << 10 | csd[7] << 2 | csd[8] >> 6
|
||||
c_size_mult = (csd[9] & 0b11) << 1 | csd[10] >> 7
|
||||
read_bl_len = csd[5] & 0b1111
|
||||
capacity = (c_size + 1) * (2 ** (c_size_mult + 2)) * (2**read_bl_len)
|
||||
self.sectors = capacity // 512
|
||||
else:
|
||||
raise OSError("SD card CSD format not supported")
|
||||
# CMD16: set block length to 512 bytes
|
||||
if self.cmd(16, 512, 0) != 0:
|
||||
raise OSError("can't set 512 block size")
|
||||
# set to high data rate now that it's initialised
|
||||
self.init_spi(baudrate)
|
||||
|
||||
def init_card_v1(self):
|
||||
for i in range(_CMD_TIMEOUT):
|
||||
time.sleep_ms(50)
|
||||
self.cmd(55, 0, 0)
|
||||
if self.cmd(41, 0, 0) == 0:
|
||||
# SDSC card, uses byte addressing in read/write/erase commands
|
||||
self.cdv = 512
|
||||
# print("[SDCard] v1 card")
|
||||
return
|
||||
raise OSError("timeout waiting for v1 card")
|
||||
|
||||
def init_card_v2(self):
|
||||
for i in range(_CMD_TIMEOUT):
|
||||
time.sleep_ms(50)
|
||||
self.cmd(58, 0, 0, 4)
|
||||
self.cmd(55, 0, 0)
|
||||
if self.cmd(41, 0x40000000, 0) == 0:
|
||||
self.cmd(58, 0, 0, -4) # 4-byte response, negative means keep the first byte
|
||||
ocr = self.tokenbuf[0] # get first byte of response, which is OCR
|
||||
if not ocr & 0x40:
|
||||
# SDSC card, uses byte addressing in read/write/erase commands
|
||||
self.cdv = 512
|
||||
else:
|
||||
# SDHC/SDXC card, uses block addressing in read/write/erase commands
|
||||
self.cdv = 1
|
||||
# print("[SDCard] v2 card")
|
||||
return
|
||||
raise OSError("timeout waiting for v2 card")
|
||||
|
||||
def cmd(self, cmd, arg, crc, final=0, release=True, skip1=False):
|
||||
if self.cs: self.cs(0)
|
||||
|
||||
# create and send the command
|
||||
buf = self.cmdbuf
|
||||
buf[0] = 0x40 | cmd
|
||||
buf[1] = arg >> 24
|
||||
buf[2] = arg >> 16
|
||||
buf[3] = arg >> 8
|
||||
buf[4] = arg
|
||||
buf[5] = crc
|
||||
self.spi.write(buf)
|
||||
|
||||
if skip1:
|
||||
self.spi.readinto(self.tokenbuf, 0xFF)
|
||||
# wait for the response (response[7] == 0)
|
||||
for i in range(_CMD_TIMEOUT):
|
||||
self.spi.readinto(self.tokenbuf, 0xFF)
|
||||
response = self.tokenbuf[0]
|
||||
if not (response & 0x80):
|
||||
if final < 0:
|
||||
self.spi.readinto(self.tokenbuf, 0xFF)
|
||||
final = -1 - final
|
||||
for j in range(final):
|
||||
self.spi.write(b"\xff")
|
||||
if release:
|
||||
if self.cs: self.cs(1)
|
||||
self.spi.write(b"\xff")
|
||||
return response
|
||||
if self.cs: self.cs(1)
|
||||
self.spi.write(b"\xff")
|
||||
return -1
|
||||
|
||||
def readinto(self, buf):
|
||||
if self.cs: self.cs(0)
|
||||
for i in range(_CMD_TIMEOUT):
|
||||
self.spi.readinto(self.tokenbuf, 0xFF)
|
||||
if self.tokenbuf[0] == _TOKEN_DATA:
|
||||
break
|
||||
time.sleep_ms(1)
|
||||
else:
|
||||
if self.cs: self.cs(1)
|
||||
raise OSError("timeout waiting for response")
|
||||
mv = self.dummybuf_memoryview
|
||||
if len(buf) != len(mv):
|
||||
mv = mv[: len(buf)]
|
||||
self.spi.write_readinto(mv, buf)
|
||||
self.spi.write(b"\xff")
|
||||
self.spi.write(b"\xff")
|
||||
if self.cs: self.cs(1)
|
||||
self.spi.write(b"\xff")
|
||||
|
||||
def write(self, token, buf):
|
||||
if self.cs: self.cs(0)
|
||||
self.spi.read(1, token)
|
||||
self.spi.write(buf)
|
||||
self.spi.write(b"\xff")
|
||||
self.spi.write(b"\xff")
|
||||
if (self.spi.read(1, 0xFF)[0] & 0x1F) != 0x05:
|
||||
if self.cs: self.cs(1)
|
||||
self.spi.write(b"\xff")
|
||||
return
|
||||
while self.spi.read(1, 0xFF)[0] == 0:
|
||||
pass
|
||||
if self.cs: self.cs(1)
|
||||
self.spi.write(b"\xff")
|
||||
|
||||
def write_token(self, token):
|
||||
if self.cs: self.cs(0)
|
||||
self.spi.read(1, token)
|
||||
self.spi.write(b"\xff")
|
||||
while self.spi.read(1, 0xFF)[0] == 0x00:
|
||||
pass
|
||||
if self.cs: self.cs(1)
|
||||
self.spi.write(b"\xff")
|
||||
|
||||
def readblocks(self, block_num, buf):
|
||||
# workaround for shared bus, required for (at least) some Kingston
|
||||
self.spi.write(b"\xff")
|
||||
|
||||
nblocks = len(buf) // 512
|
||||
assert nblocks and not len(buf) % 512, "Buffer length is invalid"
|
||||
if nblocks == 1:
|
||||
# CMD17: set read address for single block
|
||||
if self.cmd(17, block_num * self.cdv, 0, release=False) != 0:
|
||||
# release the card
|
||||
if self.cs: self.cs(1)
|
||||
raise OSError(5) # EIO
|
||||
# receive the data and release card
|
||||
self.readinto(buf)
|
||||
else:
|
||||
# CMD18: set read address for multiple blocks
|
||||
if self.cmd(18, block_num * self.cdv, 0, release=False) != 0:
|
||||
if self.cs: self.cs(1)
|
||||
raise OSError(5) # EIO
|
||||
offset = 0
|
||||
mv = memoryview(buf)
|
||||
while nblocks:
|
||||
self.readinto(mv[offset : offset + 512])
|
||||
offset += 512
|
||||
nblocks -= 1
|
||||
if self.cmd(12, 0, 0xFF, skip1=True):
|
||||
raise OSError(5) # EIO
|
||||
|
||||
def writeblocks(self, block_num, buf):
|
||||
# workaround for shared bus, required for (at least) some Kingston
|
||||
self.spi.write(b"\xff")
|
||||
nblocks, err = divmod(len(buf), 512)
|
||||
assert nblocks and not err, "Buffer length is invalid"
|
||||
if nblocks == 1:
|
||||
# CMD24: set write address for single block
|
||||
if self.cmd(24, block_num * self.cdv, 0) != 0:
|
||||
raise OSError(5) # EIO
|
||||
self.write(_TOKEN_DATA, buf)
|
||||
else:
|
||||
# CMD25: set write address for first block
|
||||
if self.cmd(25, block_num * self.cdv, 0) != 0:
|
||||
raise OSError(5) # EIO
|
||||
offset = 0
|
||||
mv = memoryview(buf)
|
||||
while nblocks:
|
||||
self.write(_TOKEN_CMD25, mv[offset : offset + 512])
|
||||
offset += 512
|
||||
nblocks -= 1
|
||||
self.write_token(_TOKEN_STOP_TRAN)
|
||||
|
||||
def ioctl(self, op, arg):
|
||||
if op == 4: # get number of blocks
|
||||
return self.sectors
|
||||
if op == 5: # get block size in bytes
|
||||
return 512
|
||||
134
boards/default/micropython/build/lib/seniverse_api.py
Normal file
134
boards/default/micropython/build/lib/seniverse_api.py
Normal file
@@ -0,0 +1,134 @@
|
||||
"""
|
||||
Seniverse Weather API
|
||||
|
||||
MicroPython library for Seniverse Weather API
|
||||
=======================================================
|
||||
|
||||
#Preliminary composition 20220420
|
||||
#https://www.seniverse.com/api
|
||||
|
||||
dahanzimin From the Mixly Team
|
||||
"""
|
||||
|
||||
import json
|
||||
import urequests
|
||||
|
||||
_weather_now="http://api.seniverse.com/v3/weather/now.json?" #天气实况
|
||||
_weather_daily="http://api.seniverse.com/v3/weather/daily.json?" #逐日天气预报
|
||||
_weather_hourly="http://api.seniverse.com/v3/weather/hourly.json?" #逐时天气预报
|
||||
_weather_alarm="http://api.seniverse.com/v3/weather/alarm.json?" #气象灾害预警
|
||||
_life_suggestion="http://api.seniverse.com/v3/life/suggestion.json?" #生活指数
|
||||
_air_now="http://api.seniverse.com/v3/air/now.json?" #空气质量实况
|
||||
_air_daily="http://api.seniverse.com/v3/air/daily.json?" #逐日空气质量预报
|
||||
_tide_daily="http://api.seniverse.com/v3/tide/daily.json?" #逐小时潮汐预报
|
||||
_geo_sun="http://api.seniverse.com/v3/geo/sun.json?" #日出日落
|
||||
_geo_moon="http://api.seniverse.com/v3/geo/moon.json?" #月出月落和月相
|
||||
_location_search="http://api.seniverse.com/v3/location/search.json?" #城市搜索
|
||||
|
||||
#数据请求
|
||||
def _urequests_api(url):
|
||||
try:
|
||||
results=json.loads(urequests.post(url).text)
|
||||
except Exception as e:
|
||||
raise RuntimeError("API request failed or WiFi is not connected",e)
|
||||
|
||||
if "status" in results.keys():
|
||||
raise ValueError(results["status"])
|
||||
if "results" in results.keys():
|
||||
return results["results"]
|
||||
|
||||
#天气实况 https://docs.seniverse.com/api/weather/now.html
|
||||
def weather_now(key,location):
|
||||
url="{}key={}&location={}".format(_weather_now,key,location)
|
||||
results=_urequests_api(url)[0]
|
||||
return results['now']
|
||||
|
||||
|
||||
#逐日天气预报 https://docs.seniverse.com/api/weather/daily.html
|
||||
def weather_daily(key,location,days=1):
|
||||
url="{}key={}&location={}&days={}".format(_weather_daily,key,location,days)
|
||||
results=_urequests_api(url)[0]
|
||||
data=[]
|
||||
for i in range(len(results['daily'])):
|
||||
data.append(results['daily'][i])
|
||||
return tuple(data)
|
||||
|
||||
#逐时天气预报 https://docs.seniverse.com/api/weather/hourly.html
|
||||
def weather_hourly(key,location,hours=1):
|
||||
url="{}key={}&location={}&hours={}".format(_weather_hourly,key,location,hours)
|
||||
results=_urequests_api(url)[0]
|
||||
data=[]
|
||||
for i in range(len(results['hourly'])):
|
||||
data.append(results['hourly'][i])
|
||||
return tuple(data)
|
||||
|
||||
#气象灾害预警 https://docs.seniverse.com/api/weather/alarm.html
|
||||
def weather_alarm(key,location):
|
||||
url="{}key={}&location={}".format(_weather_alarm,key,location)
|
||||
results=_urequests_api(url)[0]
|
||||
data=[]
|
||||
for i in range(len(results['alarms'])):
|
||||
data.append(results['alarms'][i])
|
||||
return tuple(data)
|
||||
|
||||
#生活指数 https://docs.seniverse.com/api/life/suggestion.html
|
||||
def life_suggestion(key,location,days=1):
|
||||
url="{}key={}&location={}&days={}".format(_life_suggestion,key,location,days)
|
||||
results=_urequests_api(url)[0]
|
||||
data=[]
|
||||
for i in range(len(results['suggestion'])):
|
||||
data.append(results['suggestion'][i])
|
||||
return tuple(data)
|
||||
|
||||
#空气质量实况 https://docs.seniverse.com/api/air/now.html
|
||||
def air_now(key,location):
|
||||
url="{}key={}&location={}&scope=city".format(_air_now,key,location)
|
||||
results=_urequests_api(url)[0]
|
||||
return results['air']['city']
|
||||
|
||||
#逐日空气质量预报 https://docs.seniverse.com/api/air/daily5d.html
|
||||
def air_daily(key,location,days=1):
|
||||
url="{}key={}&location={}&days={}".format(_air_daily,key,location,days)
|
||||
results=_urequests_api(url)[0]
|
||||
data=[]
|
||||
for i in range(len(results['daily'])):
|
||||
data.append(results['daily'][i])
|
||||
return tuple(data)
|
||||
|
||||
#逐时潮汐预报 https://docs.seniverse.com/api/ocean/tide.html
|
||||
def tide_daily(key,location):
|
||||
url="{}key={}&location={}&days=1".format(_tide_daily,key,location)
|
||||
results=_urequests_api(url)[0]
|
||||
data=[]
|
||||
for i in range(len(results['ports'])):
|
||||
data.append({'port':results['ports'][i]['port'],
|
||||
'tide':results['ports'][i]['data'][0]['tide'],
|
||||
'range':results['ports'][i]['data'][0]['range']})
|
||||
return tuple(data)
|
||||
|
||||
#日出日落 https://docs.seniverse.com/api/geo/sun.html
|
||||
def geo_sun(key,location,days=1):
|
||||
url="{}key={}&location={}&days={}".format(_geo_sun,key,location,days)
|
||||
results=_urequests_api(url)[0]
|
||||
data=[]
|
||||
for i in range(len(results['sun'])):
|
||||
data.append(results['sun'][i])
|
||||
return tuple(data)
|
||||
|
||||
#月出月落和月相 https://docs.seniverse.com/api/geo/moon.html
|
||||
def geo_moon(key,location,days=1):
|
||||
url="{}key={}&location={}&days={}".format(_geo_moon,key,location,days)
|
||||
results=_urequests_api(url)[0]
|
||||
data=[]
|
||||
for i in range(len(results['moon'])):
|
||||
data.append(results['moon'][i])
|
||||
return tuple(data)
|
||||
|
||||
#城市搜索 https://docs.seniverse.com/api/fct/search.html
|
||||
def location_search(key,location):
|
||||
url="{}key={}&q={}&limit=50".format(_location_search,key,location)
|
||||
results=_urequests_api(url)
|
||||
data=[]
|
||||
for i in range(len(results)):
|
||||
data.append(results[i])
|
||||
return tuple(data)
|
||||
53
boards/default/micropython/build/lib/servo.py
Normal file
53
boards/default/micropython/build/lib/servo.py
Normal file
@@ -0,0 +1,53 @@
|
||||
"""
|
||||
Servo
|
||||
|
||||
MicroPython library for the Servo(0~180°)
|
||||
=======================================================
|
||||
|
||||
#Preliminary composition 20220803
|
||||
|
||||
dahanzimin From the Mixly Team
|
||||
"""
|
||||
from machine import Pin,PWM
|
||||
|
||||
class Servo:
|
||||
__species = {}
|
||||
__first_init = True
|
||||
|
||||
def __new__(cls, pin, *args, **kwargs):
|
||||
if pin not in cls.__species.keys():
|
||||
cls.__first_init = True
|
||||
cls.__species[pin]=object.__new__(cls)
|
||||
return cls.__species[pin]
|
||||
|
||||
def __init__(self,pin):
|
||||
if self.__first_init:
|
||||
self.__first_init = False
|
||||
self._pulse=None
|
||||
self.pwm = PWM(Pin(pin), duty=0, freq=50)
|
||||
|
||||
def servo_write(self,pulse):
|
||||
self._pulse=pulse
|
||||
self.pwm.duty_u16(int(1638.375 + 6553.5 * pulse))
|
||||
|
||||
def servo_read(self):
|
||||
return self._pulse
|
||||
|
||||
#-------Method usage of class--------
|
||||
|
||||
def servo180_angle(pin,angle=None):
|
||||
if angle is None:
|
||||
return int(Servo(pin).servo_read()*180)
|
||||
else:
|
||||
if not 0<= angle <= 180:
|
||||
raise ValueError("The effective range of the servo(180) angle is 0~180°")
|
||||
Servo(pin).servo_write(angle/180)
|
||||
|
||||
|
||||
def servo360_speed(pin,speed=None):
|
||||
if speed is None:
|
||||
return int(Servo(pin).servo_read()*200-100)
|
||||
else:
|
||||
if not -100<= speed <= 100:
|
||||
raise ValueError("The effective range of the servo(360) speed is -100~100%")
|
||||
Servo(pin).servo_write((speed+100)/200)
|
||||
134
boards/default/micropython/build/lib/shtc3.py
Normal file
134
boards/default/micropython/build/lib/shtc3.py
Normal file
@@ -0,0 +1,134 @@
|
||||
"""
|
||||
SHTC3
|
||||
|
||||
MicroPython library for the SHTC3(Humidity and Temperature)
|
||||
=======================================================
|
||||
|
||||
#Preliminary composition 20220224
|
||||
#https://github.com/adafruit/Adafruit_CircuitPython_SHTC3.git
|
||||
|
||||
dahanzimin From the Mixly Team
|
||||
"""
|
||||
|
||||
from time import sleep
|
||||
from micropython import const
|
||||
from struct import unpack_from
|
||||
|
||||
_SHTC3_DEFAULT_ADDR = const(0x70) # SHTC3 I2C Address
|
||||
_SHTC3_READID = const(0xEFC8) # Read Out of ID Register
|
||||
_SHTC3_SOFTRESET = const(0x805D) # Soft Reset
|
||||
_SHTC3_SLEEP = const(0xB098) # Enter sleep mode
|
||||
_SHTC3_WAKEUP = const(0x3517) # Wakeup mode
|
||||
_SHTC3_CHIP_ID = const(0x807)
|
||||
_SHTC3_NORMAL_MEAS = const(0x7866)
|
||||
_SHTC3_LOWPOW_MEAS = const(0x609C)
|
||||
|
||||
class SHTC3:
|
||||
def __init__(self, i2c_bus, addr = _SHTC3_DEFAULT_ADDR):
|
||||
self._device= i2c_bus
|
||||
self._address = addr
|
||||
self._buffer = bytearray(6)
|
||||
self.low_power = False
|
||||
self.sleeping = False
|
||||
self.reset()
|
||||
if self._get_chip_id() != _SHTC3_CHIP_ID:
|
||||
raise AttributeError("Cannot find a SHTC3")
|
||||
|
||||
def _write_command(self, command):
|
||||
"""helper function to write a command to the i2c device"""
|
||||
self._buffer[0] = command >> 8
|
||||
self._buffer[1] = command & 0xFF
|
||||
self._device.writeto(self._address,self._buffer[0:2])
|
||||
|
||||
def _get_chip_id(self): # readCommand(SHTC3_READID, data, 3);
|
||||
"""Determines the chip id of the sensor"""
|
||||
self._write_command(_SHTC3_READID)
|
||||
sleep(0.001)
|
||||
self._device.readfrom_into(self._address,self._buffer)
|
||||
return unpack_from(">H", self._buffer)[0] & 0x083F
|
||||
|
||||
def reset(self):
|
||||
"""Perform a soft reset of the sensor, resetting all settings to their power-on defaults"""
|
||||
self.sleeping = False
|
||||
try:
|
||||
self._write_command(_SHTC3_SOFTRESET)
|
||||
|
||||
except RuntimeError as run_err:
|
||||
if run_err.args and run_err.args[0] != "I2C device address was NACK'd":
|
||||
raise run_err
|
||||
sleep(0.001)
|
||||
|
||||
@property
|
||||
def sleeping(self):
|
||||
"""Determines the sleep state of the sensor"""
|
||||
return self._cached_sleep
|
||||
|
||||
@sleeping.setter
|
||||
def sleeping(self, sleep_enabled):
|
||||
if sleep_enabled:
|
||||
self._write_command(_SHTC3_SLEEP)
|
||||
else:
|
||||
self._write_command(_SHTC3_WAKEUP)
|
||||
sleep(0.001)
|
||||
self._cached_sleep = sleep_enabled
|
||||
|
||||
@property
|
||||
def low_power(self):
|
||||
"""Enables the less accurate low power mode, trading accuracy for power consumption"""
|
||||
return self._low_power
|
||||
|
||||
@low_power.setter
|
||||
def low_power(self, low_power_enabled):
|
||||
self._low_power = low_power_enabled
|
||||
|
||||
@property
|
||||
def measurements(self):
|
||||
"""both `temperature` and `relative_humidity`, read simultaneously"""
|
||||
self.sleeping = False
|
||||
temperature = None
|
||||
humidity = None
|
||||
if self.low_power:
|
||||
self._write_command(_SHTC3_LOWPOW_MEAS)
|
||||
sleep(0.001)
|
||||
else:
|
||||
self._write_command(_SHTC3_NORMAL_MEAS)
|
||||
sleep(0.013)
|
||||
|
||||
self._device.readfrom_into(self._address,self._buffer)
|
||||
|
||||
temp_data = self._buffer[0:2]
|
||||
temp_crc = self._buffer[2]
|
||||
humidity_data = self._buffer[3:5]
|
||||
humidity_crc = self._buffer[5]
|
||||
|
||||
if temp_crc != self._crc8(temp_data) or humidity_crc != self._crc8(humidity_data):
|
||||
return
|
||||
|
||||
raw_temp = unpack_from(">H", temp_data)[0]
|
||||
raw_temp = ((4375 * raw_temp) >> 14) - 4500
|
||||
temperature = raw_temp / 100.0
|
||||
raw_humidity = unpack_from(">H", humidity_data)[0]
|
||||
raw_humidity = (625 * raw_humidity) >> 12
|
||||
humidity = raw_humidity / 100.0
|
||||
|
||||
self.sleeping = True
|
||||
return (temperature, humidity)
|
||||
|
||||
@staticmethod
|
||||
def _crc8(buffer):
|
||||
"""verify the crc8 checksum"""
|
||||
crc = 0xFF
|
||||
for byte in buffer:
|
||||
crc ^= byte
|
||||
for _ in range(8):
|
||||
if crc & 0x80:
|
||||
crc = (crc << 1) ^ 0x31
|
||||
else:
|
||||
crc = crc << 1
|
||||
return crc & 0xFF # return the bottom 8 bits
|
||||
|
||||
def humidity(self):
|
||||
return self.measurements[1]
|
||||
|
||||
def temperature(self):
|
||||
return self.measurements[0]
|
||||
23
boards/default/micropython/build/lib/sonar.py
Normal file
23
boards/default/micropython/build/lib/sonar.py
Normal file
@@ -0,0 +1,23 @@
|
||||
from machine import Pin
|
||||
import time
|
||||
|
||||
# Sonar
|
||||
class Sonar:
|
||||
def __init__(self, trig, echo):
|
||||
self.trig=Pin(trig, Pin.OUT)
|
||||
self.echo=Pin(echo, Pin.IN)
|
||||
|
||||
def checkdist(self):
|
||||
#trig, echo = Pin(trig, Pin.OUT), Pin(echo, Pin.IN)
|
||||
self.trig.value(0)
|
||||
self.echo.value(0)
|
||||
self.trig.value(1)
|
||||
time.sleep_us(10)
|
||||
self.trig.value(0)
|
||||
while(self.echo.value()==0):
|
||||
pass
|
||||
t1 = time.ticks_us()
|
||||
while(self.echo.value()==1):
|
||||
pass
|
||||
t2 = time.ticks_us()
|
||||
return round(time.ticks_diff(t2, t1) / 10000 * 340 / 2, 2)
|
||||
114
boards/default/micropython/build/lib/spl06_001.py
Normal file
114
boards/default/micropython/build/lib/spl06_001.py
Normal file
@@ -0,0 +1,114 @@
|
||||
"""
|
||||
_SPL06-001
|
||||
|
||||
MicroPython library for the _SPL06-001(Air pressure sensor)
|
||||
=======================================================
|
||||
#Preliminary composition 20240108
|
||||
|
||||
@dahanzimin From the Mixly Team
|
||||
"""
|
||||
import time
|
||||
from micropython import const
|
||||
|
||||
_SPL06_ADDRESS = const(0x77)
|
||||
_SPL06_REG_PSR = const(0x00)
|
||||
_SPL06_REG_TMP = const(0x03)
|
||||
_SPL06_PSR_CFG = const(0x06)
|
||||
_SPL06_TMP_CFG = const(0x07)
|
||||
_SPL06_MEAS_CFG = const(0x08)
|
||||
_SPL06_CFG_REG = const(0x09)
|
||||
_SPL06_REG_RST = const(0x0C)
|
||||
_SPL06_REG_ID = const(0x0D)
|
||||
_SPL06_REG_COEF = const(0x10)
|
||||
|
||||
#Parameter selection(sample/sec, times, kT/kP)
|
||||
_SPL06_PSR_TMP_1 = (0<<4, 0, 524288)
|
||||
_SPL06_PSR_TMP_2 = (1<<4, 1, 1572864)
|
||||
_SPL06_PSR_TMP_4 = (2<<4, 2, 3670016)
|
||||
_SPL06_PSR_TMP_8 = (3<<4, 3, 7864320)
|
||||
_SPL06_PSR_TMP_16 = (4<<4, 4, 253952)
|
||||
_SPL06_PSR_TMP_32 = (5<<4, 5, 516096)
|
||||
_SPL06_PSR_TMP_64 = (6<<4, 6, 1040384)
|
||||
_SPL06_PSR_TMP_128 = (7<<4, 7, 2088960)
|
||||
|
||||
class SPL06:
|
||||
def __init__(self, i2c_bus, addr=_SPL06_ADDRESS, rate=_SPL06_PSR_TMP_32):
|
||||
self._device = i2c_bus
|
||||
self._address = addr
|
||||
self._rate = rate
|
||||
self._psr = 0
|
||||
self._tmp = 0
|
||||
self._alt = 0
|
||||
if self._rreg(_SPL06_REG_ID) != 0x10:
|
||||
raise AttributeError("Cannot find a SPL06-001")
|
||||
self._init()
|
||||
|
||||
def _wreg(self, reg, val):
|
||||
'''Write memory address'''
|
||||
self._device.writeto_mem(self._address,reg,val.to_bytes(1, 'little'))
|
||||
|
||||
def _rreg(self, reg, nbytes=1):
|
||||
'''Read memory address'''
|
||||
return self._device.readfrom_mem(self._address, reg, nbytes)[0] if nbytes<=1 else self._device.readfrom_mem(self._address, reg, nbytes)[0:nbytes]
|
||||
|
||||
def _u2s(self, value, n=8):
|
||||
return value if value < (1 << (n-1)) else value - (1 << n)
|
||||
|
||||
def _status(self):
|
||||
'''数据转换状态'''
|
||||
status = self._rreg(_SPL06_MEAS_CFG)
|
||||
return status & 0x80, status & 0x40, (status >> 4 & 0x01) & (status >> 5 & 0x01) #COEF_RDY,SENSOR_RDY,TMP_RDY+PRS_RDY
|
||||
|
||||
def _init(self):
|
||||
'''软复位'''
|
||||
self._wreg(_SPL06_REG_RST, 0x89)
|
||||
time.sleep_ms(50)
|
||||
'''判断校准数据是否就绪,并读取'''
|
||||
while not self._status()[0]:
|
||||
time.sleep_ms(1)
|
||||
buf = self._rreg(_SPL06_REG_COEF, 18)
|
||||
self._c0 = self._u2s(buf[0] << 4 | buf[1] >> 4, 12)
|
||||
self._c1 = self._u2s((buf[1] & 0x0F) << 8 | buf[2], 12)
|
||||
self._c00 = self._u2s(buf[3] << 12 | buf[4] << 4 | buf[5] >> 4, 20)
|
||||
self._c10 = self._u2s((buf[5] & 0x0F) << 16 | buf[6] << 8 | buf[7], 20)
|
||||
self._c01 = self._u2s(buf[8] << 8 | buf[9], 16)
|
||||
self._c11 = self._u2s(buf[10] << 8 | buf[11], 16)
|
||||
self._c20 = self._u2s(buf[12] << 8 | buf[13], 16)
|
||||
self._c21 = self._u2s(buf[14] << 8 | buf[15], 16)
|
||||
self._c30 = self._u2s(buf[16] << 8 | buf[17], 16)
|
||||
|
||||
'''判断传感器是否就绪,并设置'''
|
||||
while not self._status()[1]:
|
||||
time.sleep_ms(1)
|
||||
self._wreg(_SPL06_MEAS_CFG, 0x07) #Continuous pressure and temperature
|
||||
self._wreg(_SPL06_PSR_CFG, self._rate[0] | self._rate[1]) #Configuration of pressure measurement.
|
||||
self._wreg(_SPL06_TMP_CFG, self._rate[0] | self._rate[1] | 0x80) #Configuration of temperature measurement.
|
||||
self._rreg(_SPL06_REG_PSR, 6)
|
||||
|
||||
if self._rate[1] > 3:
|
||||
self._wreg(_SPL06_CFG_REG, self._rreg(_SPL06_CFG_REG) | 0x0C) #when the oversampling rate is >8 times.
|
||||
|
||||
''''判断数据是否就绪,并读取'''
|
||||
#while not self._status()[2]:
|
||||
#time.sleep_ms(1) #数据就绪需要耗时1s左右
|
||||
|
||||
@property
|
||||
def getdata(self):
|
||||
'''处理获取数据'''
|
||||
if self._status()[2]:
|
||||
buf = self._rreg(_SPL06_REG_PSR, 6)
|
||||
praw = self._u2s(buf[0] << 16 | buf[1] << 8 | buf[2], 24) / self._rate[2]
|
||||
traw = self._u2s(buf[3] << 16 | buf[4] << 8 | buf[5], 24) / self._rate[2]
|
||||
self._psr = self._c00 + praw * (self._c10 + praw *(self._c20 + praw * self._c30)) + traw * self._c01 + traw * praw * (self._c11 + praw * self._c21)
|
||||
self._tmp = self._c0 * 0.5 + self._c1 * traw
|
||||
self._alt = (1 - (self._psr / 101325) ** (1/5.255)) * 44330
|
||||
return round(self._psr/100, 2), round(self._tmp, 2), round(self._alt,2)
|
||||
|
||||
def pressure(self):
|
||||
return self.getdata[0]
|
||||
|
||||
def temperature(self):
|
||||
return self.getdata[1]
|
||||
|
||||
def altitude(self):
|
||||
return self.getdata[2]
|
||||
125
boards/default/micropython/build/lib/ssd1106.py
Normal file
125
boards/default/micropython/build/lib/ssd1106.py
Normal file
@@ -0,0 +1,125 @@
|
||||
"""
|
||||
SSD1106
|
||||
|
||||
library for the SSD1x06 OLED128x64
|
||||
=======================================================
|
||||
|
||||
#Preliminary composition 20230412
|
||||
|
||||
@dahanzimin From the Mixly Team
|
||||
"""
|
||||
import uframebuf
|
||||
from micropython import const
|
||||
|
||||
SET_CONTRAST = const(0x81)
|
||||
SET_ENTIRE_ON = const(0xa4)
|
||||
SET_NORM_INV = const(0xa6)
|
||||
SET_DISP_OFF = const(0xae)
|
||||
SET_DISP_ON = const(0xaf)
|
||||
SET_MEM_ADDR = const(0x20)
|
||||
SET_PAGE_ADDR = const(0x22)
|
||||
SET_DISP_START_LINE = const(0x40)
|
||||
SET_SEG_REMAP = const(0xa0)
|
||||
SET_MUX_RATIO = const(0xa8)
|
||||
SET_COM_OUT_DIR = const(0xc0)
|
||||
SET_DISP_OFFSET = const(0xd3)
|
||||
SET_COM_PIN_CFG = const(0xda)
|
||||
SET_DISP_CLK_DIV = const(0xd5)
|
||||
SET_PRECHARGE = const(0xd9)
|
||||
SET_VCOM_DESEL = const(0xdb)
|
||||
SET_CHARGE_PUMP = const(0x8d)
|
||||
SET_COL_ADDR_L = const(0x02)
|
||||
SET_COL_ADDR_H = const(0x10)
|
||||
SET_PAGE_ADDR1 = const(0xb0)
|
||||
SET_CONTRACT_CTRL = const(0x81)
|
||||
|
||||
class SSD1106(uframebuf.FrameBuffer_Uincode):
|
||||
def __init__(self, width, height, external_vcc):
|
||||
self._external = external_vcc
|
||||
self._buffer = bytearray((width + 7) // 8 * height)
|
||||
super().__init__(self._buffer, width, height, uframebuf.MONO_VLSB)
|
||||
self.init_display()
|
||||
|
||||
def init_display(self):
|
||||
for cmd in (
|
||||
SET_DISP_OFF, # display off
|
||||
SET_DISP_CLK_DIV, 0x80, # timing and driving scheme
|
||||
SET_MUX_RATIO, 0x3f, #0xa8
|
||||
SET_DISP_OFFSET, 0x00, #0xd3
|
||||
SET_DISP_START_LINE | 0x00, #start line
|
||||
SET_CHARGE_PUMP, 0x10 if self._external else 0x14,
|
||||
SET_MEM_ADDR, 0x00, # address setting
|
||||
SET_SEG_REMAP | 0x01, # column addr 127 mapped to SEG0
|
||||
SET_COM_OUT_DIR | 0x08, # scan from COM[N] to COM0
|
||||
SET_COM_PIN_CFG, 0x12,
|
||||
SET_CONTRACT_CTRL, 0xcf,
|
||||
SET_PRECHARGE, 0x22 if self._external else 0xf1,
|
||||
SET_VCOM_DESEL, 0x40, # 0.83*Vcc
|
||||
SET_ENTIRE_ON, # output follows RAM contents
|
||||
SET_NORM_INV,
|
||||
SET_DISP_ON): # on
|
||||
self.write_cmd(cmd)
|
||||
self.fill(0)
|
||||
self.show()
|
||||
|
||||
def poweroff(self):
|
||||
self.write_cmd(SET_DISP_OFF)
|
||||
|
||||
def poweron(self):
|
||||
self.write_cmd(SET_DISP_ON)
|
||||
|
||||
def contrast(self, contrast):
|
||||
self.write_cmd(SET_CONTRAST)
|
||||
self.write_cmd(contrast)
|
||||
|
||||
def invert(self, invert):
|
||||
self.write_cmd(SET_NORM_INV | (invert & 1))
|
||||
|
||||
def show(self):
|
||||
for i in range(0, 8):
|
||||
self.write_cmd(SET_PAGE_ADDR1 + i)
|
||||
self.write_cmd(SET_COL_ADDR_L + 0) # offset 2 pixels for 128x64 panel
|
||||
self.write_cmd(SET_COL_ADDR_H + 0)
|
||||
self.write_data(self._buffer[i*128:(i+1)*128]) # send one page display data
|
||||
|
||||
class SSD1106_I2C(SSD1106):
|
||||
def __init__(self, width, height, i2c, addr=0x3c, external_vcc=False):
|
||||
self.i2c = i2c
|
||||
self.addr = addr
|
||||
self.temp = bytearray(2)
|
||||
super().__init__(width, height, external_vcc)
|
||||
|
||||
def write_cmd(self, cmd):
|
||||
self.temp[0] = 0x80
|
||||
self.temp[1] = cmd
|
||||
self.i2c.writeto(self.addr, self.temp)
|
||||
|
||||
def write_data(self, buf):
|
||||
tmp = bytearray([0x40])
|
||||
self.i2c.writeto(self.addr, tmp+buf)
|
||||
|
||||
class SSD1106_SPI(SSD1106):
|
||||
def __init__(self, width, height, spi, dc, cs, external_vcc=False):
|
||||
self.rate = 10 * 1024 * 1024
|
||||
dc.init(dc.OUT, value=0)
|
||||
cs.init(cs.OUT, value=1)
|
||||
self.spi = spi
|
||||
self.dc = dc
|
||||
self.cs = cs
|
||||
super().__init__(width, height, external_vcc)
|
||||
|
||||
def write_cmd(self, cmd):
|
||||
self.spi.init(baudrate=self.rate, polarity=0, phase=0)
|
||||
self.cs(1)
|
||||
self.dc(0)
|
||||
self.cs(0)
|
||||
self.spi.write(bytearray([cmd]))
|
||||
self.cs(1)
|
||||
|
||||
def write_data(self, buf):
|
||||
self.spi.init(baudrate=self.rate, polarity=0, phase=0)
|
||||
self.cs(1)
|
||||
self.dc(1)
|
||||
self.cs(0)
|
||||
self.spi.write(buf)
|
||||
self.cs(1)
|
||||
117
boards/default/micropython/build/lib/st7735.py
Normal file
117
boards/default/micropython/build/lib/st7735.py
Normal file
@@ -0,0 +1,117 @@
|
||||
"""
|
||||
ST7735
|
||||
|
||||
MicroPython library for the ST7735(TFT-SPI)
|
||||
=======================================================
|
||||
#Preliminary composition 20230822
|
||||
|
||||
@dahanzimin From the Mixly Team
|
||||
"""
|
||||
import time, uframebuf
|
||||
from machine import Pin, PWM
|
||||
from micropython import const
|
||||
|
||||
_CMD_SWRESET = const(0x01)
|
||||
_CMD_SLPOUT = const(0x11)
|
||||
_CMD_PTLON = const(0x12)
|
||||
_CMD_NORON = const(0x13)
|
||||
_CMD_INVOFF = const(0x20)
|
||||
_CMD_INVON = const(0x21)
|
||||
_CMD_DISPOFF = const(0x28)
|
||||
_CMD_DISPON = const(0x29)
|
||||
_CMD_CASET = const(0x2A)
|
||||
_CMD_RASET = const(0x2B)
|
||||
_CMD_RAMWR = const(0x2C)
|
||||
_CMD_RAMRD = const(0x2E)
|
||||
_CMD_PTLAR = const(0x30)
|
||||
_CMD_COLMOD = const(0x3A)
|
||||
_CMD_MADCTL = const(0x36)
|
||||
_CMD_FRMCTR1 = const(0xB1)
|
||||
_CMD_FRMCTR2 = const(0xB2)
|
||||
_CMD_FRMCTR3 = const(0xB3)
|
||||
_CMD_INVCTR = const(0xB4)
|
||||
_CMD_PWCTR1 = const(0xC0)
|
||||
_CMD_PWCTR2 = const(0xC1)
|
||||
_CMD_PWCTR3 = const(0xC2)
|
||||
_CMD_PWCTR4 = const(0xC3)
|
||||
_CMD_PWCTR5 = const(0xC4)
|
||||
_CMD_VMCTR1 = const(0xC5)
|
||||
_CMD_GMCTRP1 = const(0xE0)
|
||||
_CMD_GMCTRN1 = const(0xE1)
|
||||
|
||||
class ST7735(uframebuf.FrameBuffer_Uincode):
|
||||
def __init__(self, spi, width, height, dc_pin=None, cs_pin=None, bl_pin=None, font_address=0x700000, rotation=0):
|
||||
self.spi = spi
|
||||
self.dc = Pin(dc_pin, Pin.OUT, value=1)
|
||||
self.cs = Pin(cs_pin, Pin.OUT, value=1)
|
||||
self._buffer = bytearray(width * height * 2)
|
||||
super().__init__(self._buffer, width, height, uframebuf.RGB565)
|
||||
self.font(font_address)
|
||||
self._init()
|
||||
self.rotation(rotation)
|
||||
self.fill(0)
|
||||
self.show()
|
||||
time.sleep_ms(100)
|
||||
self._brightness = 0.6
|
||||
self.bl_led = PWM(Pin(bl_pin), duty_u16=int(self._brightness * 60000)) if bl_pin else None
|
||||
|
||||
def _write(self, cmd, dat = None):
|
||||
self.cs.off()
|
||||
self.dc.off()
|
||||
self.spi.write(bytearray([cmd]))
|
||||
self.cs.on()
|
||||
if dat is not None:
|
||||
self.cs.off()
|
||||
self.dc.on()
|
||||
self.spi.write(dat)
|
||||
self.cs.on()
|
||||
|
||||
def _init(self):
|
||||
"""Display initialization configuration"""
|
||||
for cmd, data, delay in [
|
||||
(_CMD_SWRESET, None, 100),
|
||||
(_CMD_SLPOUT, None, 200),
|
||||
(_CMD_FRMCTR1, b'\x01\x2c\x2d', 10),
|
||||
(_CMD_FRMCTR2, b'\x01\x2c\x2d', 10),
|
||||
(_CMD_FRMCTR3, b'\x01\x2c\x2d', 10),
|
||||
(_CMD_INVCTR, b'\x07', None),
|
||||
(_CMD_PWCTR1, b'\xa2\x02\x84', 10),
|
||||
(_CMD_PWCTR2, b'\xc5', None),
|
||||
(_CMD_PWCTR3, b'\x0a\x00', None),
|
||||
(_CMD_PWCTR4, b'\x8a\x2a', None),
|
||||
(_CMD_PWCTR5, b'\x8a\xee', None),
|
||||
(_CMD_VMCTR1, b'\x0e', None),
|
||||
(_CMD_GMCTRP1, b'\x02\x1c\x07\x12\x37\x32\x29\x2d\x29\x25\x2b\x39\x00\x01\x03\x10', None),
|
||||
(_CMD_GMCTRN1, b'\x03\x1d\x07\x06\x2e\x2c\x29\x2d\x2e\x2e\x37\x3f\x00\x00\x02\x10', None),
|
||||
(_CMD_COLMOD, b'\x05', 10),
|
||||
(_CMD_NORON, None, 10),
|
||||
(_CMD_DISPON, None, 200),
|
||||
]:
|
||||
self._write(cmd, data)
|
||||
if delay:
|
||||
time.sleep_us(delay)
|
||||
|
||||
def rotation(self, rotation):
|
||||
self._write(_CMD_MADCTL, b'\x60') if rotation else self._write(_CMD_MADCTL, b'\xa0')
|
||||
self._write(_CMD_CASET, b'\x01\x01\x01\xa0')
|
||||
self._write(_CMD_RASET, b'\x02\x02\x02\x81')
|
||||
|
||||
def get_brightness(self):
|
||||
return self._brightness
|
||||
|
||||
def set_brightness(self, brightness):
|
||||
if not 0.0 <= brightness <= 1.0:
|
||||
raise ValueError("Brightness must be a decimal number in the range: 0.0~1.0")
|
||||
self._brightness = brightness
|
||||
self.bl_led.duty_u16(int(brightness*60000))
|
||||
|
||||
def color(self, red, green=None, blue=None):
|
||||
""" Convert red, green and blue values (0-255) into a 16-bit 565 encoding."""
|
||||
if green is None or blue is None:
|
||||
return red
|
||||
else:
|
||||
return (red & 0xf8) << 8 | (green & 0xfc) << 3 | blue >> 3
|
||||
|
||||
def show(self):
|
||||
"""Refresh the display and show the changes."""
|
||||
self._write(_CMD_RAMWR, self._buffer)
|
||||
330
boards/default/micropython/build/lib/st7789.py
Normal file
330
boards/default/micropython/build/lib/st7789.py
Normal file
@@ -0,0 +1,330 @@
|
||||
"""
|
||||
ST7789
|
||||
|
||||
MicroPython library for the ST7789(TFT-SPI)
|
||||
=======================================================
|
||||
#Preliminary composition 20220830
|
||||
#https://github.com/russhughes/st7789py_mpy
|
||||
|
||||
dahanzimin From the Mixly Team
|
||||
"""
|
||||
|
||||
import time
|
||||
from machine import Pin
|
||||
from micropython import const
|
||||
from uframebuf import Font_Uincode, Image
|
||||
import ustruct as struct
|
||||
|
||||
|
||||
ST7789_NOP = const(0x00)
|
||||
ST7789_SWRESET = const(0x01)
|
||||
ST7789_RDDID = const(0x04)
|
||||
ST7789_RDDST = const(0x09)
|
||||
ST7789_SLPIN = const(0x10)
|
||||
ST7789_SLPOUT = const(0x11)
|
||||
ST7789_PTLON = const(0x12)
|
||||
ST7789_NORON = const(0x13)
|
||||
ST7789_INVOFF = const(0x20)
|
||||
ST7789_INVON = const(0x21)
|
||||
ST7789_DISPOFF = const(0x28)
|
||||
ST7789_DISPON = const(0x29)
|
||||
ST7789_CASET = const(0x2A)
|
||||
ST7789_RASET = const(0x2B)
|
||||
ST7789_RAMWR = const(0x2C)
|
||||
ST7789_RAMRD = const(0x2E)
|
||||
ST7789_PTLAR = const(0x30)
|
||||
ST7789_VSCRDEF = const(0x33)
|
||||
ST7789_COLMOD = const(0x3A)
|
||||
ST7789_MADCTL = const(0x36)
|
||||
ST7789_VSCSAD = const(0x37)
|
||||
ST7789_MADCTL_MY = const(0x80)
|
||||
ST7789_MADCTL_MX = const(0x40)
|
||||
ST7789_MADCTL_MV = const(0x20)
|
||||
ST7789_MADCTL_ML = const(0x10)
|
||||
ST7789_MADCTL_BGR = const(0x08)
|
||||
ST7789_MADCTL_MH = const(0x04)
|
||||
ST7789_MADCTL_RGB = const(0x00)
|
||||
ST7789_RDID1 = const(0xDA)
|
||||
ST7789_RDID2 = const(0xDB)
|
||||
ST7789_RDID3 = const(0xDC)
|
||||
ST7789_RDID4 = const(0xDD)
|
||||
COLOR_MODE_65K = const(0x50)
|
||||
COLOR_MODE_262K = const(0x60)
|
||||
COLOR_MODE_12BIT = const(0x03)
|
||||
COLOR_MODE_16BIT = const(0x05)
|
||||
COLOR_MODE_18BIT = const(0x06)
|
||||
COLOR_MODE_16M = const(0x07)
|
||||
|
||||
# Color definitions
|
||||
BLACK = const(0x0000)
|
||||
BLUE = const(0x001F)
|
||||
RED = const(0xF800)
|
||||
GREEN = const(0x07E0)
|
||||
CYAN = const(0x07FF)
|
||||
MAGENTA = const(0xF81F)
|
||||
YELLOW = const(0xFFE0)
|
||||
WHITE = const(0xFFFF)
|
||||
|
||||
_BUFFER_SIZE = const(256)
|
||||
|
||||
# Rotation tables (width, height, xstart, ystart)[rotation % 4]
|
||||
WIDTH_320 = [(240, 320, 0, 0),(320, 240, 0, 0),(240, 320, 0, 0),(320, 240, 0, 0)]
|
||||
WIDTH_240 = [(240, 240, 0, 0),(240, 240, 0, 0),(240, 240, 0, 80),(240, 240, 80, 0)]
|
||||
WIDTH_135 = [(135, 240, 52, 40),(240, 135, 40, 53),(135, 240, 53, 40),(240, 135, 40, 52)]
|
||||
|
||||
ROTATIONS = [0x00, 0x60, 0xc0, 0xa0]
|
||||
|
||||
def color565(red, green=0, blue=0):
|
||||
""" Convert red, green and blue values (0-255) into a 16-bit 565 encoding."""
|
||||
try:
|
||||
red, green, blue = red # see if the first var is a tuple/list
|
||||
except TypeError:
|
||||
pass
|
||||
return (red & 0xf8) << 8 | (green & 0xfc) << 3 | blue >> 3
|
||||
|
||||
def _encode_pos(x, y):
|
||||
"""Encode a postion into bytes."""
|
||||
return struct.pack(">HH", x, y)
|
||||
|
||||
def _encode_pixel(color):
|
||||
"""Encode a pixel color into bytes."""
|
||||
return struct.pack(">H", color)
|
||||
|
||||
class ST7789():
|
||||
def __init__(self, spi, width, height, dc_pin=None,cs_pin=None, rotation=0, font_address=0x700000):
|
||||
if height != 240 or width not in [320, 240, 135]:
|
||||
raise ValueError("Unsupported display. 320x240, 240x240 and 135x240 are supported.")
|
||||
|
||||
self._font= Font_Uincode(font_address)
|
||||
self._image= Image()
|
||||
self._display_width = self.width = width
|
||||
self._display_height = self.height = height
|
||||
self.xstart = 0
|
||||
self.ystart = 0
|
||||
self.spi = spi
|
||||
self.spi.init(polarity=1)
|
||||
self.dc = Pin(dc_pin, Pin.OUT)
|
||||
self.cs = Pin(cs_pin, Pin.OUT)
|
||||
self._rotation = rotation % 4
|
||||
self.soft_reset()
|
||||
self.sleep_mode(False)
|
||||
|
||||
self._set_color_mode(COLOR_MODE_65K | COLOR_MODE_16BIT)
|
||||
time.sleep_ms(50)
|
||||
self.rotation(self._rotation)
|
||||
self.inversion_mode(True)
|
||||
time.sleep_ms(10)
|
||||
self._write(ST7789_NORON)
|
||||
time.sleep_ms(10)
|
||||
self.fill(0)
|
||||
self._write(ST7789_DISPON)
|
||||
time.sleep_ms(500)
|
||||
|
||||
def _write(self, command=None, data=None):
|
||||
"""SPI write to the device: commands and data."""
|
||||
if self.cs:
|
||||
self.cs.off()
|
||||
if command is not None:
|
||||
self.dc.off()
|
||||
self.spi.write(bytes([command]))
|
||||
if data is not None:
|
||||
self.dc.on()
|
||||
self.spi.write(data)
|
||||
if self.cs:
|
||||
self.cs.on()
|
||||
|
||||
def soft_reset(self):
|
||||
"""Soft reset display."""
|
||||
self._write(ST7789_SWRESET)
|
||||
time.sleep_ms(150)
|
||||
|
||||
def sleep_mode(self, value):
|
||||
"""Enable or disable display sleep mode."""
|
||||
if value:
|
||||
self._write(ST7789_SLPIN)
|
||||
else:
|
||||
self._write(ST7789_SLPOUT)
|
||||
|
||||
def inversion_mode(self, value):
|
||||
"""Enable or disable display inversion mode."""
|
||||
if value:
|
||||
self._write(ST7789_INVON)
|
||||
else:
|
||||
self._write(ST7789_INVOFF)
|
||||
|
||||
def _set_color_mode(self, mode):
|
||||
""" Set display color mode. """
|
||||
self._write(ST7789_COLMOD, bytes([mode & 0x77]))
|
||||
|
||||
def rotation(self, rotation):
|
||||
"""Set display rotation."""
|
||||
rotation %= 4
|
||||
self._rotation = rotation
|
||||
madctl = ROTATIONS[rotation]
|
||||
|
||||
if self._display_width == 320:
|
||||
table = WIDTH_320
|
||||
elif self._display_width == 240:
|
||||
table = WIDTH_240
|
||||
elif self._display_width == 135:
|
||||
table = WIDTH_135
|
||||
else:
|
||||
raise ValueError("Unsupported display. 320x240, 240x240 and 135x240 are supported.")
|
||||
self.width, self.height, self.xstart, self.ystart = table[rotation]
|
||||
self._write(ST7789_MADCTL, bytes([madctl]))
|
||||
|
||||
def _set_columns(self, start, end):
|
||||
"""Send CASET (column address set) command to display."""
|
||||
if start <= end <= self.width:
|
||||
self._write(ST7789_CASET, _encode_pos(
|
||||
start+self.xstart, end + self.xstart))
|
||||
|
||||
def _set_rows(self, start, end):
|
||||
"""Send RASET (row address set) command to display."""
|
||||
if start <= end <= self.height:
|
||||
self._write(ST7789_RASET, _encode_pos(
|
||||
start+self.ystart, end+self.ystart))
|
||||
|
||||
def _set_window(self, x0, y0, x1, y1):
|
||||
"""Set window to column and row address."""
|
||||
self._set_columns(x0, x1)
|
||||
self._set_rows(y0, y1)
|
||||
self._write(ST7789_RAMWR)
|
||||
|
||||
def vline(self, x, y, length, color):
|
||||
"""Draw vertical line at the given location and color."""
|
||||
self.fill_rect(x, y, 1, length, color)
|
||||
|
||||
def hline(self, x, y, length, color):
|
||||
"""Draw horizontal line at the given location and color."""
|
||||
self.fill_rect(x, y, length, 1, color)
|
||||
|
||||
def pixel(self, x, y, color):
|
||||
"""Draw a pixel at the given location and color."""
|
||||
self._set_window(x, y, x, y)
|
||||
pixel_color =_encode_pixel(color) if type(color)==int else _encode_pixel(color565(color))
|
||||
self._write(None, pixel_color)
|
||||
|
||||
def blit_buffer(self, buffer, x, y, width, height):
|
||||
"""Copy buffer to display at the given location."""
|
||||
self._set_window(x, y, x + width - 1, y + height - 1)
|
||||
self._write(None, buffer)
|
||||
|
||||
def rect(self, x, y, w, h, color):
|
||||
"""Draw a rectangle at the given location, size and color."""
|
||||
self.hline(x, y, w, color)
|
||||
self.vline(x, y, h, color)
|
||||
self.vline(x + w - 1, y, h, color)
|
||||
self.hline(x, y + h - 1, w, color)
|
||||
|
||||
def fill_rect(self, x, y, width, height, color):
|
||||
"""Draw a rectangle at the given location, size and filled with color."""
|
||||
self._set_window(x, y, x + width - 1, y + height - 1)
|
||||
chunks, rest = divmod(width * height, _BUFFER_SIZE)
|
||||
pixel = _encode_pixel(color) if type(color)==int else _encode_pixel(color565(color))
|
||||
self.dc.on()
|
||||
if chunks:
|
||||
data = pixel * _BUFFER_SIZE
|
||||
for _ in range(chunks):
|
||||
self._write(None, data)
|
||||
if rest:
|
||||
self._write(None, pixel * rest)
|
||||
|
||||
def fill(self, color):
|
||||
"""Fill the entire FrameBuffer with the specified color."""
|
||||
self.fill_rect(0, 0, self.width, self.height, color)
|
||||
|
||||
def line(self, x0, y0, x1, y1, color):
|
||||
"""Draw a single pixel wide line starting at x0, y0 and ending at x1, y1."""
|
||||
steep = abs(y1 - y0) > abs(x1 - x0)
|
||||
if steep:
|
||||
x0, y0 = y0, x0
|
||||
x1, y1 = y1, x1
|
||||
if x0 > x1:
|
||||
x0, x1 = x1, x0
|
||||
y0, y1 = y1, y0
|
||||
dx = x1 - x0
|
||||
dy = abs(y1 - y0)
|
||||
err = dx // 2
|
||||
ystep = 1 if y0 < y1 else -1
|
||||
while x0 <= x1:
|
||||
if steep:
|
||||
self.pixel(y0, x0, color)
|
||||
else:
|
||||
self.pixel(x0, y0, color)
|
||||
err -= dy
|
||||
if err < 0:
|
||||
y0 += ystep
|
||||
err += dx
|
||||
x0 += 1
|
||||
|
||||
def image(self,path, x=0, y=0, size=1, color=WHITE, invert=0):
|
||||
"""Set buffer to value of Python Imaging Library image"""
|
||||
size=max(round(size),1)
|
||||
if type(path) ==str :
|
||||
buffer_info,(width, height) = self._image.load(path,invert)
|
||||
elif type(path) ==bytes:
|
||||
buffer_info,(width, height) = self._image.load_py(path,invert)
|
||||
else:
|
||||
raise ValueError("invalid input")
|
||||
|
||||
self.bitmap((buffer_info,(width, height)), x, y, size, color)
|
||||
|
||||
def bitmap(self,buffer, x=0, y=0, size=1, color=WHITE):
|
||||
"""Graphic model display(buffer,(width,height))"""
|
||||
buffer_info,(width,height)=buffer
|
||||
if x < -width*size or x >= self.width or y < -height*size or y >= self.height:
|
||||
return #Limit reasonable display area
|
||||
color_buffer = bytearray(0)
|
||||
byteWidth = int((width + 7) / 8)
|
||||
for j in range(height):
|
||||
for i in range(width):
|
||||
if buffer_info[int(j * byteWidth + i / 8)] & (0x80 >> (i & 7)):
|
||||
self.fill_rect(x+i*size, y+j*size, size, size, color)
|
||||
|
||||
def _take_buffer(self,strs,space,size=1):
|
||||
'''Get character lattice information first'''
|
||||
font_buffer=[]
|
||||
font_len=0
|
||||
for c in strs:
|
||||
buffer=self._font.chardata(c)
|
||||
font_buffer.append(buffer)
|
||||
font_len=font_len+buffer[1][0]*size+space
|
||||
return font_len,font_buffer
|
||||
|
||||
def shows(self,data,x=0,y=0,size=1,space=0,center=False, color=WHITE):
|
||||
"""Display character"""
|
||||
if data:
|
||||
size=max(round(size),1)
|
||||
font_len,font_buffer=self._take_buffer(str(data),space,size)
|
||||
x=(self.width-font_len+space)//2 if center else x
|
||||
#self.fill_rect(x-1,y-1,font_len+2,font_buffer[0][1][1]*size+2,0)
|
||||
for buffer in font_buffer: #Display character
|
||||
self.bitmap(buffer,x,y,size,color)
|
||||
x=buffer[1][0]*size+x+space
|
||||
|
||||
def frame(self, data, delay=500, size=5, color=WHITE):
|
||||
"""Display one frame per character"""
|
||||
if data:
|
||||
size=max(round(size),1)
|
||||
_,font_buffer=self._take_buffer(str(data),0)
|
||||
for buffer in font_buffer:
|
||||
x=(self.width - buffer[1][0]*size)//2
|
||||
y=(self.height - buffer[1][1]*size)//2
|
||||
self.fill_rect(x-1,y-1,buffer[1][0]*size+2,buffer[1][1]*size+2,0)
|
||||
self.bitmap(buffer,x,y,size,color)
|
||||
#self.show()
|
||||
time.sleep_ms(delay)
|
||||
|
||||
def scroll(self, data, y=0, size=1, space=0, speed=5, color=WHITE):
|
||||
"""Scrolling characters"""
|
||||
if data:
|
||||
size=max(round(size),1)
|
||||
font_len,font_buffer=self._take_buffer(str(data),space,size)
|
||||
for i in range(font_len-space+self.width):
|
||||
x=-i+self.width
|
||||
self.fill_rect(x-1,y-1,self.width-x+2,font_buffer[0][1][1]*size+2,0)
|
||||
for buffer in font_buffer:
|
||||
self.bitmap(buffer,x,y,size,color)
|
||||
x=buffer[1][0]*size+x+space
|
||||
time.sleep_ms(speed)
|
||||
83
boards/default/micropython/build/lib/syn6288.py
Normal file
83
boards/default/micropython/build/lib/syn6288.py
Normal file
@@ -0,0 +1,83 @@
|
||||
"""
|
||||
SYN6288
|
||||
|
||||
Micropython library for the SYN6288(speech synthesis)
|
||||
=======================================================
|
||||
#Preliminary composition 20220805
|
||||
|
||||
dahanzimin From the Mixly Team
|
||||
"""
|
||||
import time
|
||||
from micropython import const
|
||||
|
||||
REG_PLAY_SST = const(0x01)
|
||||
#REG_BAUD_SST = const(0x31)
|
||||
#REG_STOP_SST = const(0x02)
|
||||
#REG_PAUSE_SST = const(0x03)
|
||||
#REG_RESUME_SST = const(0x04)
|
||||
#EG_QUERY_SST = const(0x21)
|
||||
#EG_DOWN_SST = const(0x88)
|
||||
|
||||
class SYN6288:
|
||||
def __init__(self, uart):
|
||||
self._uart=uart
|
||||
self._uart.init(baudrate=9600)
|
||||
self._state=False
|
||||
self._volume="[v10]"
|
||||
|
||||
def _wreg(self, reg, val5=0,val3=None, data=None):
|
||||
'''Write memory address'''
|
||||
buffer=[0xFD,0x00,0x00,reg]
|
||||
eec=0
|
||||
|
||||
if not val5 is None and not val3 is None :
|
||||
buffer.append((val3 & 0x07) | (val5 << 3))
|
||||
if not data is None:
|
||||
for char in data:
|
||||
buffer.append(ord(char) >> 8)
|
||||
buffer.append(ord(char) & 0xFF)
|
||||
|
||||
buffer[2]= len(buffer)-2
|
||||
for i in range(len(buffer)):
|
||||
eec^=int(buffer[i])
|
||||
buffer.append(eec)
|
||||
|
||||
self._uart.write(bytes(buffer))
|
||||
|
||||
def volume(self,vol=None):
|
||||
if vol is None:
|
||||
return int(self._volume[2:-1])
|
||||
if not 0 <= vol <= 16:
|
||||
raise ValueError("The effective range of volume value is 0~16")
|
||||
else:
|
||||
self._volume="[v{}]".format(vol)
|
||||
|
||||
def synthesis(self, data, music=0, blocking=True):
|
||||
"""Support uincode coded speech synthesis"""
|
||||
self._wreg(REG_PLAY_SST,music,3,self._volume+str(data))
|
||||
time.sleep(0.1)
|
||||
while blocking :
|
||||
if not self.status():
|
||||
break
|
||||
|
||||
def status(self):
|
||||
"""Playback status (true is playing)"""
|
||||
if self._uart.any():
|
||||
state= self._uart.read()
|
||||
if state==b'A':
|
||||
self._state = True
|
||||
if state==b'O':
|
||||
self._state = False
|
||||
return self._state
|
||||
|
||||
def hint_tones(self,number, blocking=True):
|
||||
"""Play built-in prompt tone"""
|
||||
if number <25:
|
||||
tones="sound"+chr(ord("a")+number)
|
||||
elif number <33:
|
||||
tones="msg"+chr(ord("a")+number-25)
|
||||
elif number <48:
|
||||
tones="ring"+chr(ord("a")+number-33)
|
||||
else:
|
||||
raise ValueError("Input out of range")
|
||||
self.synthesis(tones,blocking=blocking)
|
||||
89
boards/default/micropython/build/lib/tm1650.py
Normal file
89
boards/default/micropython/build/lib/tm1650.py
Normal file
@@ -0,0 +1,89 @@
|
||||
"""
|
||||
TM1650 for Four Digit LED Display
|
||||
|
||||
CircuitPython library for the TM1650
|
||||
=======================================================
|
||||
|
||||
#Changed from circuitpython to micropython 20220216
|
||||
|
||||
dahanzimin From the Mixly Team
|
||||
"""
|
||||
import time
|
||||
from micropython import const
|
||||
|
||||
|
||||
COMMAND_I2C_ADDRESS = const(0x24)
|
||||
DISPLAY_I2C_ADDRESS = const(0x34)
|
||||
|
||||
|
||||
buf = (0x3F,0x06,0x5B,0x4F,0x66,0x6D,0x7D,0x07,0x7F,0x6F,0x77,0x7C,0x39,0x5E,0x79,0x71)
|
||||
|
||||
class TM1650:
|
||||
|
||||
def __init__(self, i2c_bus):
|
||||
self.i2c = i2c_bus
|
||||
self._intensity = 2
|
||||
self.dbuf = [0, 0, 0, 0]
|
||||
self.tbuf = bytearray(1)
|
||||
self.on()
|
||||
|
||||
def intensity(self, dat = -1):
|
||||
if dat < 0 or dat > 8:
|
||||
return self._intensity
|
||||
if dat == 0:
|
||||
self.off()
|
||||
else:
|
||||
self._intensity = dat
|
||||
self.cmd((dat<<4)|0x01)
|
||||
|
||||
def cmd(self,command):
|
||||
self.tbuf[0] = command &0xff
|
||||
self.i2c.writeto(COMMAND_I2C_ADDRESS, self.tbuf)
|
||||
|
||||
def dat(self,bit, data):
|
||||
self.tbuf[0] = data&0xff
|
||||
self.i2c.writeto(DISPLAY_I2C_ADDRESS + bit%4, self.tbuf)
|
||||
|
||||
def on(self):
|
||||
self.cmd((self._intensity<<4)|0x01)
|
||||
|
||||
def off(self):
|
||||
self._intensity = 0
|
||||
self.cmd(0)
|
||||
|
||||
def clear(self):
|
||||
self.dat(0, 0)
|
||||
self.dat(1, 0)
|
||||
self.dat(2, 0)
|
||||
self.dat(3, 0)
|
||||
self.dbuf = [0, 0, 0, 0]
|
||||
|
||||
def showbit(self, num, bit = 0):
|
||||
self.dbuf[bit%4] = buf[num%16]
|
||||
self.dat(bit, buf[num%16])
|
||||
|
||||
def shownum(self, num):
|
||||
if num < 0:
|
||||
self.dat(0, 0x40) # '-'
|
||||
num = -num
|
||||
else:
|
||||
self.showbit((num // 1000) % 10)
|
||||
self.showbit(num % 10, 3)
|
||||
self.showbit((num // 10) % 10, 2)
|
||||
self.showbit((num // 100) % 10, 1)
|
||||
|
||||
def showhex(self, num):
|
||||
if num < 0:
|
||||
self.dat(0, 0x40) # '-'
|
||||
num = -num
|
||||
else:
|
||||
self.showbit((num >> 12) % 16)
|
||||
self.showbit(num % 16, 3)
|
||||
self.showbit((num >> 4) % 16, 2)
|
||||
self.showbit((num >> 8) % 16, 1)
|
||||
|
||||
def showDP(self, bit = 1, show = True):
|
||||
if show:
|
||||
self.dat(bit, self.dbuf[bit] | 0x80)
|
||||
else:
|
||||
self.dat(bit, self.dbuf[bit] & 0x7F)
|
||||
78
boards/default/micropython/build/lib/tm1652.py
Normal file
78
boards/default/micropython/build/lib/tm1652.py
Normal file
@@ -0,0 +1,78 @@
|
||||
"""
|
||||
TM1652-framebuf
|
||||
|
||||
Micropython library for the TM1652 Matrix8x5
|
||||
=======================================================
|
||||
|
||||
#Preliminary composition 20230126
|
||||
|
||||
@dahanzimin From the Mixly Team
|
||||
"""
|
||||
import time
|
||||
import uframebuf
|
||||
from machine import Pin
|
||||
from micropython import const
|
||||
|
||||
_TM1652_REG_ADD = const(0x08) #Display address command
|
||||
_TM1652_REG_CMD = const(0x18) #Display control command
|
||||
_TM1652_SET_CUR = const(0x04) #LED current setting 3/8
|
||||
|
||||
class TM1652(uframebuf.FrameBuffer_Ascall):
|
||||
def __init__(self, pin, brightness=0.3, width=8, height=5):
|
||||
self.pin=Pin(pin,Pin.OUT)
|
||||
self.pin.value(1)
|
||||
self._buffer = bytearray((width + 7) // 8 * height)
|
||||
super().__init__(self._buffer, width, height, uframebuf.MONO_HMSB)
|
||||
self.brightness = brightness
|
||||
self._brightness = None
|
||||
self.set_brightness(brightness)
|
||||
time.sleep_ms(5)
|
||||
self.fill(0)
|
||||
self.show()
|
||||
|
||||
def _write_cmd(self, val):
|
||||
'''Serial write command'''
|
||||
falg=0
|
||||
#Start bit
|
||||
self.pin.value(1)
|
||||
time.sleep_us(15)
|
||||
self.pin.value(0)
|
||||
time.sleep_us(30)
|
||||
#Data bits
|
||||
for i in range(8):
|
||||
if (val >> i) & 0x01:
|
||||
self.pin.value(1)
|
||||
falg+=1
|
||||
else:
|
||||
self.pin.value(0)
|
||||
falg+=0
|
||||
time.sleep_us(44)
|
||||
#Check bit
|
||||
self.pin.value(1) if falg%2 == 0 else self.pin.value(0)
|
||||
time.sleep_us(50)
|
||||
#Stop bit
|
||||
self.pin.value(1)
|
||||
time.sleep_us(15)
|
||||
|
||||
def get_brightness(self):
|
||||
return round(self.brightness,2)
|
||||
|
||||
def set_brightness(self, brightness):
|
||||
if not 0.0 <= brightness <= 1.0:
|
||||
raise ValueError("Brightness must be a decimal number in the range: 0.0~1.0")
|
||||
self.brightness = brightness
|
||||
xbright = round(15 * brightness)
|
||||
xbright = ((xbright & 0xA) >>1) | ((xbright & 0x5) <<1)
|
||||
xbright = ((xbright & 0xC) >>2) | ((xbright & 0x3) <<2)
|
||||
self._brightness = (xbright << 4) | _TM1652_SET_CUR #高四位倒序|驱动电流
|
||||
|
||||
def show(self):
|
||||
"""Refresh the display and show the changes."""
|
||||
for _ in range(2):
|
||||
self._write_cmd(_TM1652_REG_ADD)
|
||||
for i in range(5):
|
||||
self._write_cmd(self._buffer[i])
|
||||
time.sleep_ms(3)
|
||||
self._write_cmd(_TM1652_REG_CMD)
|
||||
self._write_cmd(self._brightness)
|
||||
time.sleep_ms(3)
|
||||
68
boards/default/micropython/build/lib/tm1680.py
Normal file
68
boards/default/micropython/build/lib/tm1680.py
Normal file
@@ -0,0 +1,68 @@
|
||||
"""
|
||||
TM1680
|
||||
|
||||
library for the TM1680 Matrix32x12
|
||||
=======================================================
|
||||
|
||||
#Preliminary composition 20230412
|
||||
|
||||
@dahanzimin From the Mixly Team
|
||||
"""
|
||||
import uframebuf
|
||||
from micropython import const
|
||||
|
||||
TM1680_SYS_EN = const(0x81)
|
||||
TM1680_LED_ON = const(0x83)
|
||||
TM1680_COM_16N = const(0xA4)
|
||||
|
||||
class TM1680(uframebuf.FrameBuffer_Uincode):
|
||||
def __init__(self, i2c, address=0x72, brightness=0.3, width=32, height=12):
|
||||
self._device= i2c
|
||||
self._address = address
|
||||
self._blink_rate=0
|
||||
self._brightness=brightness
|
||||
self._buffer = bytearray((width + 7) // 8 * height)
|
||||
super().__init__(self._buffer, width, height, uframebuf.MONO_HMSB)
|
||||
self._write_cmd(TM1680_SYS_EN) #打开系统振荡器
|
||||
self._write_cmd(TM1680_LED_ON) #开启 LED 循环
|
||||
self._write_cmd(TM1680_COM_16N) #16COM Nmos
|
||||
self.blink_rate(0)
|
||||
self.set_brightness(brightness)
|
||||
self.fill(0)
|
||||
self.show()
|
||||
|
||||
def _write_cmd(self, val):
|
||||
'''I2C write command'''
|
||||
self._device.writeto(self._address,val.to_bytes(1, 'little'))
|
||||
|
||||
def blink_rate(self, rate=None):
|
||||
if rate is None:
|
||||
return self._blink_rate
|
||||
if not 0 <= rate <= 3:
|
||||
raise ValueError("Blink rate must be an integer in the range: 0-3")
|
||||
rate = rate & 0x03
|
||||
self._blink_rate = rate
|
||||
self._write_cmd(0x88 | rate)
|
||||
|
||||
def get_brightness(self):
|
||||
return self._brightness
|
||||
|
||||
def set_brightness(self, brightness):
|
||||
if not 0.0 <= brightness <= 1.0:
|
||||
raise ValueError("Brightness must be a decimal number in the range: 0.0-1.0")
|
||||
self._brightness = brightness
|
||||
xbright = round(15 * brightness)
|
||||
xbright = xbright & 0x0F
|
||||
self._write_cmd(0xB0 | xbright)
|
||||
|
||||
def show(self):
|
||||
"""Refresh the display and show the changes."""
|
||||
tm_buffer = bytearray(48)
|
||||
for i in range(len(self._buffer)):
|
||||
if i<24: #Convert the buffer content according to the address of tm1680
|
||||
tm_buffer[i]=self._buffer[i*2-1] if i%2 else self._buffer[i*2]
|
||||
else:
|
||||
tm_buffer[i]=self._buffer[(i-23)*2-1] if i%2 else self._buffer[(i-23)*2]
|
||||
#Convert the high and low 4 bits of the address content
|
||||
tm_buffer[i]= (tm_buffer[i]>>4) | (tm_buffer[i] <<4)
|
||||
self._device.writeto_mem(self._address,0x00,tm_buffer)
|
||||
67
boards/default/micropython/build/lib/tm1931.py
Normal file
67
boards/default/micropython/build/lib/tm1931.py
Normal file
@@ -0,0 +1,67 @@
|
||||
"""
|
||||
TM1931-
|
||||
|
||||
Micropython library for the TM1931 (18 channel IO port extension)
|
||||
=======================================================
|
||||
|
||||
#Preliminary composition 20220614
|
||||
|
||||
dahanzimin From the Mixly Team
|
||||
"""
|
||||
|
||||
import time
|
||||
import framebuf
|
||||
from machine import UART
|
||||
from micropython import const
|
||||
|
||||
_TM1931_ADDRESS = const(0x54)
|
||||
_TM1931_REG_SSD = const(0x00)
|
||||
_TM1931_REG_UPD = const(0x16)
|
||||
_TM1931_REG_RST = const(0x17)
|
||||
|
||||
class TM1931:
|
||||
def __init__(self, i2c_bus, addr=_TM1931_ADDRESS):
|
||||
self._i2c=i2c_bus
|
||||
self._addr = addr
|
||||
self._duty = bytearray(18)
|
||||
self.reset()
|
||||
|
||||
def _wreg(self, reg, val):
|
||||
'''Write memory address'''
|
||||
self._i2c.writeto_mem(self._addr,reg,val.to_bytes(1, 'little'))
|
||||
|
||||
def _rreg(self, reg,nbytes=1):
|
||||
'''Read memory address'''
|
||||
return self._i2c.readfrom_mem(self._addr, reg, nbytes)[0] if nbytes<=1 else self._i2c.readfrom_mem(self._addr, reg, nbytes)[0:nbytes]
|
||||
|
||||
def work(self,start=True):
|
||||
"""Start and open all output channels"""
|
||||
self._wreg(_TM1931_REG_SSD,0x01& start)
|
||||
start=0xff if start else 0
|
||||
for i in range(0x13,0x16,1):
|
||||
self._wreg(i,start)
|
||||
|
||||
def update(self):
|
||||
"""Load PWM register and LED control register data"""
|
||||
self._wreg(_TM1931_REG_UPD,0xff)
|
||||
|
||||
def reset(self):
|
||||
"""Reset all registers to default state"""
|
||||
self._wreg(_TM1931_REG_RST,0x00)
|
||||
self.work(True)
|
||||
|
||||
def duty(self,index):
|
||||
"""Obtain PWM duty cycle"""
|
||||
if not 1 <= index <= 18:
|
||||
raise ValueError("Port must be a number in the range: 1-18")
|
||||
return self._duty[index-1]
|
||||
|
||||
def pwm(self,index,duty):
|
||||
"""18 channel PWM duty cycle data register"""
|
||||
if not 0 <= duty <= 255:
|
||||
raise ValueError("Duty must be a number in the range: 0-255")
|
||||
if not 1 <= index <= 18:
|
||||
raise ValueError("Port must be a number in the range: 1-18")
|
||||
self._duty[index-1] = duty
|
||||
self._wreg(index,duty)
|
||||
self.update()
|
||||
27
boards/default/micropython/build/lib/uart_com.py
Normal file
27
boards/default/micropython/build/lib/uart_com.py
Normal file
@@ -0,0 +1,27 @@
|
||||
"""
|
||||
UART Communication
|
||||
|
||||
MicroPython library for the UART_COM(Board to board communication)
|
||||
=======================================================
|
||||
#Preliminary composition 20220903
|
||||
|
||||
dahanzimin From the Mixly Team
|
||||
"""
|
||||
_sdata=None
|
||||
|
||||
def send(uart,data,repeat=True):
|
||||
global _sdata
|
||||
if data != _sdata:
|
||||
uart.write((str(data)+'\n'))
|
||||
if not repeat:
|
||||
_sdata=data
|
||||
|
||||
def recv(uart):
|
||||
data = uart.readline()
|
||||
if data:
|
||||
data_str = data.strip()
|
||||
try:
|
||||
data_str=data_str.decode()
|
||||
return eval(data_str)
|
||||
except:
|
||||
return data_str
|
||||
453
boards/default/micropython/build/lib/uframebuf.py
Normal file
453
boards/default/micropython/build/lib/uframebuf.py
Normal file
@@ -0,0 +1,453 @@
|
||||
"""
|
||||
framebuf-extend
|
||||
|
||||
Micropython library for the framebuf-extend
|
||||
=======================================================
|
||||
|
||||
#Preliminary composition 20230412
|
||||
|
||||
@dahanzimin From the Mixly Team
|
||||
"""
|
||||
|
||||
import esp, time, gc
|
||||
from framebuf import *
|
||||
|
||||
class Font_Ascall:
|
||||
'''Ascall code font reading data'''
|
||||
#字库格式:2字节字宽和高,后逐列式,按满字节低位在前
|
||||
font4x5_code=b'\x04\x05\x00\x00\x00\x00\x00\x17\x00\x00\x03\x00\x03\x00\x1f\n\x1f\x00\x16\x1f\x1a\x00\x19\x04\x13\x00\n\x15\x1a\x00\x00\x01\x03\x00\x00\x0e\x11\x00\x11\x0e\x00\x00\x15\x0e\x15\x00\x04\x0e\x04\x00\x00\x08\x18\x00\x04\x04\x04\x00\x18\x18\x00\x00\x18\x04\x03\x00\x1f\x11\x1f\x00\x12\x1f\x10\x00\x1d\x15\x17\x00\x15\x15\x1f\x00\x07\x04\x1f\x00\x17\x15\x1d\x00\x1f\x15\x1d\x00\x01\x01\x1f\x00\x1f\x15\x1f\x00\x17\x15\x1f\x00\x1b\x1b\x00\x00\x00\x0b\x1b\x00\x04\n\x11\x00\n\n\n\x00\x11\n\x04\x00\x01\x15\x07\x00\x0e\x15\x16\x00\x1e\x05\x1e\x00\x1f\x15\n\x00\x0e\x11\x11\x00\x1f\x11\x0e\x00\x1f\x15\x15\x00\x1f\x05\x05\x00\x0e\x15\x1d\x00\x1f\x04\x1f\x00\x11\x1f\x11\x00\x08\x11\x0f\x00\x1f\x0c\x12\x00\x1f\x10\x10\x00\x1f\x02\x1f\x00\x1e\x04\x0f\x00\x0e\x11\x0e\x00\x1f\x05\x02\x00\x0e\x19\x1e\x00\x1f\t\x16\x00\x12\x15\t\x00\x01\x1f\x01\x00\x1f\x10\x1f\x00\x0f\x10\x0f\x00\x1f\x08\x1f\x00\x1b\x04\x1b\x00\x07\x1c\x07\x00\x19\x15\x13\x00\x00\x1f\x11\x00\x03\x0c\x10\x00\x11\x1f\x00\x00\x02\x01\x02\x00\x10\x10\x10\x00\x00\x03\x02\x00\n\x16\x1e\x00\x1f\x14\x08\x00\x0c\x12\x12\x00\x08\x14\x1f\x00\x0c\x1a\x14\x00\x04\x1e\x05\x00\x14\x1a\x1e\x00\x1f\x04\x18\x00\x00\x1d\x00\x00\x10\x1d\x00\x00\x1e\x08\x14\x00\x00\x1e\x00\x00\x1e\x04\x1e\x00\x1e\x02\x1e\x00\x0c\x12\x0c\x00\x1e\n\x04\x00\x04\n\x1e\x00\x1e\x04\x02\x00\x12\x15\t\x00\x04\x1e\x14\x00\x1e\x10\x1e\x00\x0e\x10\x0e\x00\x1e\x08\x1e\x00\x12\x0c\x12\x00\x16\x18\x0e\x00\x19\x15\x13\x00\x04\x1f\x11\x00\x00\x1f\x00\x00\x11\x1f\x04\x00\x02\x06\x04\x00\x15\n\x15\x00'
|
||||
font5x5_code=b'\x05\x05\x00\x00\x00\x00\x00\x00\x17\x00\x00\x00\x00\x03\x00\x03\x00\n\x1f\n\x1f\n\n\x17\x15\x1d\n\x13\t\x04\x12\x19\n\x15\x15\n\x10\x00\x03\x00\x00\x00\x00\x0e\x11\x00\x00\x00\x11\x0e\x00\x00\x00\n\x04\n\x00\x00\x04\x0e\x04\x00\x00\x10\x08\x00\x00\x00\x04\x04\x04\x00\x00\x08\x00\x00\x00\x10\x08\x04\x02\x01\x0e\x11\x11\x0e\x00\x00\x12\x1f\x10\x00\x19\x15\x15\x12\x00\t\x11\x15\x0b\x00\x0c\n\t\x1f\x08\x17\x15\x15\x15\t\x08\x14\x16\x15\x08\x11\t\x05\x03\x01\n\x15\x15\x15\n\x02\x15\r\x05\x02\x00\n\x00\x00\x00\x00\x10\n\x00\x00\x00\x04\n\x11\x00\x00\n\n\n\x00\x00\x11\n\x04\x00\x02\x01\x15\x05\x02\x0e\x11\x15\t\x0e\x1e\x05\x05\x1e\x00\x1f\x15\x15\n\x00\x0e\x11\x11\x11\x00\x1f\x11\x11\x0e\x00\x1f\x15\x15\x11\x00\x1f\x05\x05\x01\x00\x0e\x11\x11\x15\x0c\x1f\x04\x04\x1f\x00\x11\x1f\x11\x00\x00\t\x11\x11\x0f\x01\x1f\x04\n\x11\x00\x1f\x10\x10\x10\x00\x1f\x02\x04\x02\x1f\x1f\x02\x04\x08\x1f\x0e\x11\x11\x0e\x00\x1f\x05\x05\x02\x00\x06\t\x19\x16\x00\x1f\x05\x05\n\x10\x12\x15\x15\x08\x00\x01\x01\x1f\x01\x01\x0f\x10\x10\x0f\x00\x07\x08\x10\x08\x07\x07\x08\x10\x08\x07\x1b\x04\x04\x1b\x00\x01\x02\x1c\x02\x01\x19\x15\x13\x11\x00\x00\x1f\x11\x11\x00\x01\x02\x04\x08\x10\x00\x11\x11\x1f\x00\x00\x02\x01\x02\x00\x10\x10\x10\x10\x10\x00\x01\x02\x00\x00\x0c\x12\x12\x1e\x10\x1f\x14\x14\x08\x00\x0c\x12\x12\x12\x00\x08\x14\x14\x1f\x00\x0e\x15\x15\x12\x00\x04\x1e\x05\x01\x00\x02\x15\x15\x0f\x00\x1f\x04\x04\x18\x00\x00\x1d\x00\x00\x00\x00 \x1d\x00\x1f\x04\n\x10\x00\x00\x0f\x10\x10\x00\x1e\x02\x04\x02\x1e\x1e\x02\x02\x1c\x00\x0c\x12\x12\x0c\x00\x1e\n\n\x04\x00\x04\n\n\x1e\x00\x1c\x02\x02\x02\x00\x10\x14\n\x02\x00\x00\x0f\x14\x14\x10\x0e\x10\x10\x1e\x10\x06\x08\x10\x08\x06\x1e\x10\x08\x10\x1e\x12\x0c\x0c\x12\x00\x12\x14\x08\x04\x02\x12\x1a\x16\x12\x00\x00\x04\x1f\x11\x00\x00\x1f\x00\x00\x00\x11\x1f\x04\x00\x00\x00\x04\x04\x08\x08\x02\x06\x06\x06\x06'
|
||||
font5x8_code=b'\x05\x08\x00\x00\x00\x00\x00\x00\x00_\x00\x00\x00\x07\x00\x07\x00\x14\x7f\x14\x7f\x14$*\x7f*\x12#\x13\x08db6IV P\x00\x08\x07\x03\x00\x00\x1c"A\x00\x00A"\x1c\x00*\x1c\x7f\x1c*\x08\x08>\x08\x08\x00\x80p0\x00\x08\x08\x08\x08\x08\x00\x00``\x00 \x10\x08\x04\x02>QIE>\x00B\x7f@\x00rIIIF!AIM3\x18\x14\x12\x7f\x10\'EEE9<JII1A!\x11\t\x076III6FII)\x1e\x00\x00\x14\x00\x00\x00@4\x00\x00\x00\x08\x14"A\x14\x14\x14\x14\x14\x00A"\x14\x08\x02\x01Y\t\x06>A]YN|\x12\x11\x12|\x7fIII6>AAA"\x7fAAA>\x7fIIIA\x7f\t\t\t\x01>AAQs\x7f\x08\x08\x08\x7f\x00A\x7fA\x00 @A?\x01\x7f\x08\x14"A\x7f@@@@\x7f\x02\x1c\x02\x7f\x7f\x04\x08\x10\x7f>AAA>\x7f\t\t\t\x06>AQ!^\x7f\t\x19)F&III2\x03\x01\x7f\x01\x03?@@@?\x1f @ \x1f?@8@?c\x14\x08\x14c\x03\x04x\x04\x03aYIMC\x00\x7fAAA\x02\x04\x08\x10 \x00AAA\x7f\x04\x02\x01\x02\x04@@@@@\x00\x03\x07\x08\x00 TTx@\x7f(DD88DDD(8DD(\x7f8TTT\x18\x00\x08~\t\x02\x18\xa4\xa4\x9cx\x7f\x08\x04\x04x\x00D}@\x00 @@=\x00\x7f\x10(D\x00\x00A\x7f@\x00|\x04x\x04x|\x08\x04\x04x8DDD8\xfc\x18$$\x18\x18$$\x18\xfc|\x08\x04\x04\x08HTTT$\x04\x04?D$<@@ |\x1c @ \x1c<@0@<D(\x10(DL\x90\x90\x90|DdTLD\x00\x086A\x00\x00\x00w\x00\x00\x00A6\x08\x00\x02\x01\x02\x04\x02<&#&<'
|
||||
|
||||
def __init__(self, font_code="4x5"):
|
||||
if type(font_code) in [tuple, list, bytes, bytearray]:
|
||||
self._font_code = font_code
|
||||
elif font_code == "4x5":
|
||||
self._font_code = self.font4x5_code
|
||||
elif font_code == "5x5":
|
||||
self._font_code = self.font5x5_code
|
||||
elif font_code == "5x8":
|
||||
self._font_code = self.font5x8_code
|
||||
else:
|
||||
raise ValueError("This font selection is not supported")
|
||||
self.font_width, self.font_height = self._font_code[0], self._font_code[1]
|
||||
|
||||
def chardata(self, ch):
|
||||
if 0x20 <= ord(ch) <= 0x7f:
|
||||
char_index= 2 + (ord(ch)-32) * self.font_width
|
||||
buffer=self._font_code[char_index : char_index + self.font_width]
|
||||
return buffer, (self.font_width, self.font_height)
|
||||
else:
|
||||
return None, (self.font_width, self.font_height)
|
||||
|
||||
class Font_Uincode:
|
||||
'''uincode code font reading data'''
|
||||
def __init__(self, start_address=0x3A0000):
|
||||
self.start_address = start_address
|
||||
buffer = bytearray(40)
|
||||
esp.flash_read(self.start_address, buffer)
|
||||
|
||||
if buffer[0] != 0x55:
|
||||
raise ValueError("Using font file is not Unicode encoding")
|
||||
self.height=buffer[9]
|
||||
self.no1_char =buffer[16] | buffer[17] << 8
|
||||
self.no1e_char =buffer[18] | buffer[19] << 8
|
||||
self.no1_index =buffer[20] | buffer[21] << 8 | buffer[22] << 16 | buffer[23] << 24
|
||||
self.no2_char =buffer[24] | buffer[25] << 8
|
||||
self.no2e_char =buffer[26] | buffer[27] << 8
|
||||
self.no2_index =buffer[28] | buffer[29] << 8 | buffer[30] << 16 | buffer[31] << 24
|
||||
self.no3_char =buffer[32] | buffer[33] << 8
|
||||
self.no3e_char =buffer[34] | buffer[35] << 8
|
||||
self.no3_index =buffer[36] | buffer[37] << 8 | buffer[38] << 16 | buffer[39] << 24
|
||||
|
||||
def chardata(self, c):
|
||||
uni = ord(c)
|
||||
if self.no1_char <= uni <= self.no1e_char :
|
||||
char_address = self.no1_index + (uni - self.no1_char) * 4
|
||||
elif self.no2_char <= uni <= self.no2e_char :
|
||||
char_address = self.no2_index + (uni - self.no2_char) * 4
|
||||
elif self.no3_char <= uni <= self.no3e_char :
|
||||
char_address = self.no3_index + (uni - self.no3_char) * 4
|
||||
else:
|
||||
return None, (0, self.height)
|
||||
|
||||
buffer = bytearray(4)
|
||||
esp.flash_read(self.start_address + char_address, buffer)
|
||||
font_info=buffer[3] << 24 | buffer[2] << 16 | buffer[1] << 8 | buffer[0]
|
||||
font_address=font_info & 0X3FFFFFF
|
||||
font_width=font_info >> 26
|
||||
buffer = bytearray(self.height*(font_width // 8 + 1))
|
||||
esp.flash_read(self.start_address + font_address, buffer)
|
||||
return buffer, (font_width, self.height)
|
||||
|
||||
class Image:
|
||||
def load(self, path, invert=0):
|
||||
self.invert = invert
|
||||
with open(path, 'rb') as file:
|
||||
image_type = file.read(2).decode()
|
||||
file.seek(0)
|
||||
img_arrays = bytearray(file.read())
|
||||
if image_type == 'P4':
|
||||
buffer = self._pbm_decode(img_arrays)
|
||||
elif image_type == 'BM':
|
||||
buffer = self._bmp_decode(img_arrays)
|
||||
else:
|
||||
raise TypeError("Unsupported image format {}".format(image_type))
|
||||
gc.collect()
|
||||
return buffer
|
||||
|
||||
def load_py(self, name, invert=0):
|
||||
self.invert = invert
|
||||
image_type = name[0:2]
|
||||
if image_type == b'P4':
|
||||
buffer = self._pbm_decode(bytearray(name))
|
||||
elif image_type == b'BM':
|
||||
buffer = self._bmp_decode(bytearray(name))
|
||||
else:
|
||||
raise TypeError("Unsupported image format {}".format(image_type))
|
||||
gc.collect()
|
||||
return buffer
|
||||
|
||||
def _pbm_decode(self, img_arrays):
|
||||
next_value = bytearray()
|
||||
pnm_header = []
|
||||
stat = True
|
||||
index = 3
|
||||
while stat:
|
||||
next_byte = bytes([img_arrays[index]])
|
||||
if next_byte == b"#":
|
||||
while bytes([img_arrays[index]]) not in [b"", b"\n"]:
|
||||
index += 1
|
||||
if not next_byte.isdigit():
|
||||
if next_value:
|
||||
pnm_header.append(int("".join(["%c" % char for char in next_value])))
|
||||
next_value = bytearray()
|
||||
else:
|
||||
next_value += next_byte
|
||||
if len(pnm_header) == 2:
|
||||
stat = False
|
||||
index += 1
|
||||
pixel_arrays = img_arrays[index:]
|
||||
if self.invert == 1:
|
||||
for i in range(len(pixel_arrays)):
|
||||
pixel_arrays[i] = (~pixel_arrays[i]) & 0xff
|
||||
return pixel_arrays,(pnm_header[0], pnm_header[1])
|
||||
|
||||
def _bmp_decode(self, img_arrays):
|
||||
file_size = int.from_bytes(img_arrays[2:6], 'little')
|
||||
offset = int.from_bytes(img_arrays[10:14], 'little')
|
||||
width = int.from_bytes(img_arrays[18:22], 'little')
|
||||
height = int.from_bytes(img_arrays[22:26], 'little')
|
||||
bpp = int.from_bytes(img_arrays[28:30], 'little')
|
||||
if bpp != 1:
|
||||
raise TypeError("Only support 1 bit color bmp")
|
||||
line_bytes_size = (bpp * width + 31) // 32 * 4
|
||||
array_size = width * abs(height) // 8
|
||||
pixel_arrays = bytearray(array_size)
|
||||
array_row = width // 8 + 1 if width % 8 else width // 8
|
||||
array_col = height
|
||||
for i in range(array_col):
|
||||
for j in range(array_row):
|
||||
index = -(array_row * (i + 1) - j)
|
||||
_offset = offset + i * line_bytes_size + j
|
||||
if self.invert == 0:
|
||||
pixel_byte = (~img_arrays[_offset]) & 0xff
|
||||
else:
|
||||
pixel_byte = img_arrays[_offset]
|
||||
pixel_arrays[index] = pixel_byte
|
||||
return pixel_arrays,(width, height)
|
||||
|
||||
class FrameBuffer_Base(FrameBuffer):
|
||||
"""Inheritance and Extension"""
|
||||
def __init__(self, buf, width, height, *args, **kw):
|
||||
super().__init__(buf, width, height, *args, **kw)
|
||||
self.width = width
|
||||
self.height = height
|
||||
self._buffer = buf
|
||||
self.auto_show = True
|
||||
|
||||
def __getitem__(self, key):
|
||||
x, y = key
|
||||
return self.pixel(x, y)
|
||||
|
||||
def __setitem__(self, key, value):
|
||||
x, y = key
|
||||
self.pixel(x, y, value)
|
||||
|
||||
def show(self):
|
||||
print("External inheritance is required to override this method")
|
||||
|
||||
def shift(self, x, y, rotate=False):
|
||||
"""Shift pixels by x and y"""
|
||||
if x > 0: # Shift Right
|
||||
for _ in range(x):
|
||||
for row in range(0, self.height):
|
||||
last_pixel = self[self.width - 1, row] if rotate else 0
|
||||
for col in range(self.width - 1, 0, -1):
|
||||
self[col, row] = self[col - 1, row]
|
||||
self[0, row] = last_pixel
|
||||
elif x < 0: # Shift Left
|
||||
for _ in range(-x):
|
||||
for row in range(0, self.height):
|
||||
last_pixel = self[0, row] if rotate else 0
|
||||
for col in range(0, self.width - 1):
|
||||
self[col, row] = self[col + 1, row]
|
||||
self[self.width - 1, row] = last_pixel
|
||||
if y > 0: # Shift Up
|
||||
for _ in range(y):
|
||||
for col in range(0, self.width):
|
||||
last_pixel = self[col, self.height - 1] if rotate else 0
|
||||
for row in range(self.height - 1, 0, -1):
|
||||
self[col, row] = self[col, row - 1]
|
||||
self[col, 0] = last_pixel
|
||||
elif y < 0: # Shift Down
|
||||
for _ in range(-y):
|
||||
for col in range(0, self.width):
|
||||
last_pixel = self[col, 0] if rotate else 0
|
||||
for row in range(0, self.height - 1):
|
||||
self[col, row] = self[col, row + 1]
|
||||
self[col, self.height - 1] = last_pixel
|
||||
if self.auto_show: self.show()
|
||||
|
||||
def shift_right(self, num, rotate=False):
|
||||
"""Shift all pixels right"""
|
||||
self.shift(num, 0, rotate)
|
||||
|
||||
def shift_left(self, num, rotate=False):
|
||||
"""Shift all pixels left"""
|
||||
self.shift(-num, 0, rotate)
|
||||
|
||||
def shift_up(self, num, rotate=False):
|
||||
"""Shift all pixels up"""
|
||||
self.shift(0, -num, rotate)
|
||||
|
||||
def shift_down(self, num, rotate=False):
|
||||
"""Shift all pixels down"""
|
||||
self.shift(0, num, rotate)
|
||||
|
||||
def map_invert(self, own):
|
||||
"""Graph invert operation"""
|
||||
if type(own) in [list, bytes, tuple, bytearray]:
|
||||
result=bytearray()
|
||||
for i in range(len(own)):
|
||||
result.append(~ own[i])
|
||||
return result
|
||||
else:
|
||||
raise ValueError("This graphic operation is not supported")
|
||||
|
||||
def map_add(self, own, other):
|
||||
"""Graph union operation"""
|
||||
if type(own) in [list, bytes, tuple, bytearray] and type(other) in [list, bytes, tuple, bytearray]:
|
||||
result=bytearray()
|
||||
for i in range(min(len(own), len(other))):
|
||||
result.append(own[i] | other[i])
|
||||
return result
|
||||
else:
|
||||
raise ValueError("This graphic operation is not supported")
|
||||
|
||||
def map_sub(self, own, other):
|
||||
"""Graphic subtraction operation"""
|
||||
if type(own) in [list, bytes, tuple, bytearray] and type(other) in [list, bytes, tuple, bytearray]:
|
||||
result=bytearray()
|
||||
for i in range(min(len(own), len(other))):
|
||||
result.append((own[i] ^ other[i]) & own[i])
|
||||
return result
|
||||
else:
|
||||
raise ValueError("This graphic operation is not supported")
|
||||
|
||||
def set_buffer(self, buffer):
|
||||
for i in range(min(len(buffer),len(self._buffer))):
|
||||
self._buffer[i] = self._buffer[i] | buffer[i]
|
||||
|
||||
def get_buffer(self):
|
||||
return self._buffer
|
||||
|
||||
class FrameBuffer_Ascall(FrameBuffer_Base):
|
||||
'''FrameBuffer for Ascall'''
|
||||
def font(self, font):
|
||||
"""Font selection or externally defined font code"""
|
||||
self._font = Font_Ascall(font)
|
||||
|
||||
def bitmap(self, buffer, x=0, y=0):
|
||||
"""Graphic model display(buffer,(width,height))"""
|
||||
buffer_info, (width, height) = buffer
|
||||
if x < -width or x >= self.width or y < -height or y >= self.height:
|
||||
return #Limit reasonable display area
|
||||
for char_x in range(width):
|
||||
for char_y in range(height):
|
||||
if (buffer_info[char_x] >> char_y) & 0x1:
|
||||
self.pixel(x + char_x, y + char_y, 1) if height <= self.height else self.pixel(y + char_y, self.height-(x + char_x), 1)
|
||||
|
||||
def shows(self, data, space=0, center=True):
|
||||
"""Display character"""
|
||||
if data is not None:
|
||||
self.fill(0)
|
||||
if type(data) in [list, bytes, tuple, bytearray]:
|
||||
self.set_buffer(data)
|
||||
if self.auto_show: self.show()
|
||||
else:
|
||||
data=str(data)
|
||||
x = (self.width - len(data) * (self._font.font_width + space) + space) // 2 if center else 0
|
||||
for char in data:
|
||||
self.bitmap(self._font.chardata(char), x)
|
||||
x=self._font.font_width + x + space
|
||||
if self.auto_show: self.show()
|
||||
|
||||
def frame(self, data, delay=500):
|
||||
"""Display one frame per character"""
|
||||
if data is not None:
|
||||
if type(data) in [list,tuple]:
|
||||
for dat in data:
|
||||
if type(dat) in [list,bytes,tuple,bytearray]:
|
||||
self.fill(0)
|
||||
self.set_buffer(dat)
|
||||
self.show()
|
||||
time.sleep_ms(delay)
|
||||
else:
|
||||
data=str(data)
|
||||
x=(self.width - self._font.font_width) // 2
|
||||
for char in data:
|
||||
self.fill(0)
|
||||
self.bitmap(self._font.chardata(char), x)
|
||||
self.show()
|
||||
time.sleep_ms(delay)
|
||||
|
||||
def scroll(self, data, space=0, speed=100):
|
||||
"""Scrolling characters"""
|
||||
if data is not None:
|
||||
data = str(data)
|
||||
str_len = len(data) * (self._font.font_width + space) - space
|
||||
for i in range(str_len + self.width + 1):
|
||||
x = -i + self.width
|
||||
self.fill(0)
|
||||
for char in data:
|
||||
self.bitmap(self._font.chardata(char),x)
|
||||
x = self._font.font_width + x + space
|
||||
self.show()
|
||||
time.sleep_ms(speed)
|
||||
|
||||
class FrameBuffer_Uincode(FrameBuffer_Base):
|
||||
'''FrameBuffer for Uincode'''
|
||||
def font(self, font_address):
|
||||
"""Font selection or externally defined font code"""
|
||||
self._font = Font_Uincode(font_address)
|
||||
|
||||
def image(self, path, x=None, y=None, size=None, invert=0, color=0xffff):
|
||||
"""Set buffer to value of Python Imaging Library image"""
|
||||
if type(path) is str :
|
||||
buffer_info, (width, height) = Image().load(path, invert)
|
||||
elif type(path) in [bytes, bytearray]:
|
||||
buffer_info, (width, height) = Image().load_py(path, invert)
|
||||
else:
|
||||
raise ValueError("invalid input")
|
||||
if width > self.width or height > self.height:
|
||||
raise ValueError("Image must be less than display ({0}x{1}).".format(self.width, self.height))
|
||||
size = min(self.height // height, self.width // width) if size is None else size
|
||||
size = max(round(size), 1)
|
||||
x =(self.width - width * size) // 2 if x is None else x
|
||||
y =(self.height - height * size) // 2 if y is None else y
|
||||
self.fill_rect(x, y, width * size, height * size, 0)
|
||||
self.bitmap((buffer_info,(width, height)), x, y, size, color)
|
||||
if self.auto_show: self.show()
|
||||
|
||||
def bitmap(self, buffer, x=0, y=0, size=1, color=0xffff):
|
||||
"""Graphic model display(buffer,(width,height))"""
|
||||
buffer_info,(width,height)=buffer
|
||||
if x < -width*size or x >= self.width or y < -height*size or y >= self.height:
|
||||
return #Limit reasonable display area
|
||||
bytewidth = (width + 7) // 8
|
||||
for j in range(height):
|
||||
for i in range(width):
|
||||
if buffer_info[j * bytewidth + i // 8] & (0x80 >> (i & 7)):
|
||||
self.fill_rect(x + i * size, y + j * size, size, size, color)
|
||||
|
||||
def _take_buffer(self, strs, space, size=1):
|
||||
'''Get character lattice information first'''
|
||||
font_buffer = []
|
||||
font_len = 0
|
||||
for c in strs:
|
||||
buffer = self._font.chardata(c)
|
||||
font_buffer.append(buffer)
|
||||
font_len = font_len + buffer[1][0] * size + space
|
||||
return font_len, font_buffer
|
||||
|
||||
def shows(self, data, space=0, center=True, x=0, y=None, size=None, color=0xffff):
|
||||
"""Display character"""
|
||||
if data is not None:
|
||||
if type(data) in [list, bytes, tuple, bytearray]:
|
||||
self.fill(0)
|
||||
self.set_buffer(data)
|
||||
if self.auto_show: self.show()
|
||||
else:
|
||||
yy = y
|
||||
size = self.height // (self._font.height * 3) if size is None else size
|
||||
size = max(round(size), 1)
|
||||
font_len, font_buffer = self._take_buffer(str(data), space, size)
|
||||
x = (self.width - font_len + space) // 2 if center else x
|
||||
y = (self.height - self._font.height * size) // 2 if y is None else y
|
||||
if yy is None:
|
||||
self.fill(0)
|
||||
else:
|
||||
self.fill_rect(x - 1, y - 1, font_len + 2, font_buffer[0][1][1] * size + 2, 0)
|
||||
for buffer in font_buffer: #Display character
|
||||
self.bitmap(buffer, x, y, size, color)
|
||||
x = buffer[1][0] * size + x + space
|
||||
if self.auto_show: self.show()
|
||||
|
||||
def texts(self, data, space_x=0, space_y=1, x=0, y=0, size=1, color=0xffff):
|
||||
size = max(round(size), 1)
|
||||
lines = data.split('\n')
|
||||
self.fill(0)
|
||||
for line in lines:
|
||||
for char in line:
|
||||
buffer = self._font.chardata(char)
|
||||
if x > self.width - buffer[1][0]:
|
||||
x = 0
|
||||
y = buffer[1][1] * size + y + space_y
|
||||
if y > self.height:
|
||||
if self.auto_show: self.show()
|
||||
return None
|
||||
self.bitmap(buffer, x, y, size, color)
|
||||
x = buffer[1][0] * size + x + space_x
|
||||
x = 0
|
||||
y = self._font.height * size + y + space_y
|
||||
if self.auto_show: self.show()
|
||||
|
||||
def frame(self, data, delay=500, size=None, color=0xffff):
|
||||
"""Display one frame per character"""
|
||||
if data is not None:
|
||||
if type(data) in [list, tuple]:
|
||||
for dat in data:
|
||||
if type(dat) in [list, bytes, tuple, bytearray]:
|
||||
self.fill(0)
|
||||
self.set_buffer(dat)
|
||||
self.show()
|
||||
time.sleep_ms(delay)
|
||||
else:
|
||||
size = self.height // (self._font.height * 3) if size is None else size
|
||||
size = max(round(size), 1)
|
||||
_, font_buffer = self._take_buffer(str(data), 0)
|
||||
for buffer in font_buffer:
|
||||
x=(self.width - buffer[1][0] * size) // 2
|
||||
y=(self.height - buffer[1][1] * size) // 2
|
||||
self.fill_rect(x - 1, y - 1, buffer[1][0] * size + 2, buffer[1][1] * size + 2, 0)
|
||||
self.bitmap(buffer, x, y, size, color)
|
||||
self.show()
|
||||
time.sleep_ms(delay)
|
||||
|
||||
def scroll(self, data, space=0, speed=20, y=None, size=None, step= None, color=0xffff):
|
||||
"""Scrolling characters"""
|
||||
if data is not None:
|
||||
size = self.height // (self._font.height * 3) if size is None else size
|
||||
size = max(round(size), 1)
|
||||
step = max(self.width // 30, 1)if step is None else step
|
||||
font_len, font_buffer = self._take_buffer(str(data), space, size)
|
||||
for i in range(0, font_len - space + self.width, step):
|
||||
x = -i + self.width
|
||||
y = (self.height - self._font.height * size) // 2 if y is None else y
|
||||
self.fill_rect(x - 1 , y - 1 , self.width -x + 2, font_buffer[0][1][1] * size + 2, 0)
|
||||
for buffer in font_buffer:
|
||||
self.bitmap(buffer, x, y, size, color)
|
||||
x = buffer[1][0] * size + x + space
|
||||
self.show()
|
||||
time.sleep_ms(speed)
|
||||
205
boards/default/micropython/build/lib/umqtt.py
Normal file
205
boards/default/micropython/build/lib/umqtt.py
Normal file
@@ -0,0 +1,205 @@
|
||||
#Based on the traditional MQTT library
|
||||
#@dahanzimin From the Mixly Team
|
||||
import usocket as socket
|
||||
import ustruct as struct
|
||||
|
||||
# Add by Mixly Team
|
||||
def str_len(object):
|
||||
if isinstance(object, str):
|
||||
return len(object.encode('utf-8'))
|
||||
else:
|
||||
return len(object)
|
||||
|
||||
class MQTTException(Exception):
|
||||
pass
|
||||
|
||||
class MQTTClient:
|
||||
def __init__(self, client_id, server, port=0, user=None, password=None, keepalive=0,ssl=False, ssl_params={}):
|
||||
if port == 0:
|
||||
port = 8883 if ssl else 1883
|
||||
self.client_id = client_id
|
||||
self.sock = socket.socket()
|
||||
self.addr = socket.getaddrinfo(server, port)[0][-1]
|
||||
self.ssl = ssl
|
||||
self.ssl_params = ssl_params
|
||||
self.pid = 0
|
||||
self.cb = None
|
||||
self.user = user
|
||||
self.pswd = password
|
||||
self.keepalive = keepalive
|
||||
self.lw_topic = None
|
||||
self.lw_msg = None
|
||||
self.lw_qos = 0
|
||||
self.lw_retain = False
|
||||
|
||||
def _send_str(self, s):
|
||||
self.sock.write(struct.pack("!H", str_len(s)))
|
||||
self.sock.write(s)
|
||||
|
||||
def _recv_len(self):
|
||||
n = 0
|
||||
sh = 0
|
||||
while 1:
|
||||
b = self.sock.read(1)[0]
|
||||
n |= (b & 0x7f) << sh
|
||||
if not b & 0x80:
|
||||
return n
|
||||
sh += 7
|
||||
|
||||
def set_callback(self, f):
|
||||
self.cb = f
|
||||
|
||||
def set_last_will(self, topic, msg, retain=False, qos=0):
|
||||
assert 0 <= qos <= 2
|
||||
assert topic
|
||||
self.lw_topic = topic
|
||||
self.lw_msg = msg
|
||||
self.lw_qos = qos
|
||||
self.lw_retain = retain
|
||||
|
||||
def connect(self, clean_session=True):
|
||||
self.sock.connect(self.addr)
|
||||
print(self.addr)
|
||||
if self.ssl:
|
||||
import ussl
|
||||
self.sock = ussl.wrap_socket(self.sock, **self.ssl_params)
|
||||
msg_header=bytearray([0x10])
|
||||
msg = bytearray(b"\x04MQTT\x04\x02\0\0")
|
||||
msg_length = 12 + str_len(self.client_id)
|
||||
msg[6] = clean_session << 1
|
||||
if self.user is not None:
|
||||
msg_length += 2 + str_len(self.user) + 2 + str_len(self.pswd)
|
||||
msg[6] |= 0xC0
|
||||
if self.keepalive:
|
||||
assert self.keepalive < 65536
|
||||
msg[7] |= self.keepalive >> 8
|
||||
msg[8] |= self.keepalive & 0x00FF
|
||||
if self.lw_topic:
|
||||
msg_length += 2 + str_len(self.lw_topic) + 2 + str_len(self.lw_msg)
|
||||
msg[6] |= 0x4 | (self.lw_qos & 0x1) << 3 | (self.lw_qos & 0x2) << 3
|
||||
msg[6] |= self.lw_retain << 5
|
||||
if msg_length > 0x7F:
|
||||
while msg_length>0:
|
||||
encoded_byte = msg_length % 0x80
|
||||
msg_length = msg_length // 0x80
|
||||
if msg_length > 0:
|
||||
encoded_byte |= 0x80
|
||||
msg_header.append(encoded_byte)
|
||||
msg_header.append(0x00)
|
||||
else:
|
||||
msg_header.append(msg_length)
|
||||
msg_header.append(0x00)
|
||||
self.sock.write(msg_header)
|
||||
self.sock.write(msg)
|
||||
|
||||
self._send_str(self.client_id)
|
||||
if self.lw_topic:
|
||||
self._send_str(self.lw_topic)
|
||||
self._send_str(self.lw_msg)
|
||||
if self.user is not None:
|
||||
self._send_str(self.user)
|
||||
self._send_str(self.pswd)
|
||||
resp = self.sock.read(4)
|
||||
assert resp[0] == 0x20 and resp[1] == 0x02
|
||||
if resp[3] != 0:
|
||||
raise MQTTException(resp[3])
|
||||
return resp[2] & 1
|
||||
|
||||
def disconnect(self):
|
||||
self.sock.write(b"\xe0\0")
|
||||
self.sock.close()
|
||||
|
||||
def ping(self):
|
||||
self.sock.write(b"\xc0\0")
|
||||
|
||||
def publish(self, topic, msg, retain=False, qos=0):
|
||||
pkt = bytearray(b"\x30\0\0\0")
|
||||
pkt[0] |= qos << 1 | retain
|
||||
sz = 2 + str_len(topic) + str_len(msg)
|
||||
if qos > 0:
|
||||
sz += 2
|
||||
assert sz < 2097152
|
||||
i = 1
|
||||
while sz > 0x7f:
|
||||
pkt[i] = (sz & 0x7f) | 0x80
|
||||
sz >>= 7
|
||||
i += 1
|
||||
pkt[i] = sz
|
||||
self.sock.write(pkt, i + 1)
|
||||
self._send_str(topic)
|
||||
if qos > 0:
|
||||
self.pid += 1
|
||||
pid = self.pid
|
||||
struct.pack_into("!H", pkt, 0, pid)
|
||||
self.sock.write(pkt, 2)
|
||||
self.sock.write(msg)
|
||||
if qos == 1:
|
||||
while 1:
|
||||
op = self.wait_msg()
|
||||
if op == 0x40:
|
||||
sz = self.sock.read(1)
|
||||
assert sz == b"\x02"
|
||||
rcv_pid = self.sock.read(2)
|
||||
rcv_pid = rcv_pid[0] << 8 | rcv_pid[1]
|
||||
if pid == rcv_pid:
|
||||
return
|
||||
elif qos == 2:
|
||||
assert 0
|
||||
|
||||
def subscribe(self, topic, qos=0):
|
||||
pkt = bytearray(b"\x82\0\0\0")
|
||||
self.pid += 1
|
||||
struct.pack_into("!BH", pkt, 1, 2 + 2 + str_len(topic) + 1, self.pid)
|
||||
self.sock.write(pkt)
|
||||
self._send_str(topic)
|
||||
self.sock.write(qos.to_bytes(1, "little"))
|
||||
while 1:
|
||||
op = self.wait_msg()
|
||||
if op == 0x90:
|
||||
resp = self.sock.read(4)
|
||||
assert resp[1] == pkt[2] and resp[2] == pkt[3]
|
||||
if resp[3] == 0x80:
|
||||
raise MQTTException(resp[3])
|
||||
return
|
||||
|
||||
# Wait for a single incoming MQTT message and process it.
|
||||
def wait_msg(self):
|
||||
res = self.sock.read(1)
|
||||
self.sock.setblocking(True)
|
||||
if res is None:
|
||||
return None
|
||||
if res == b"":
|
||||
raise OSError(-1)
|
||||
if res == b"\xd0": # PINGRESP
|
||||
sz = self.sock.read(1)[0]
|
||||
assert sz == 0
|
||||
return None
|
||||
op = res[0]
|
||||
if op & 0xf0 != 0x30:
|
||||
return op
|
||||
sz = self._recv_len()
|
||||
topic_len = self.sock.read(2)
|
||||
topic_len = (topic_len[0] << 8) | topic_len[1]
|
||||
topic = self.sock.read(topic_len).decode('utf-8')
|
||||
sz -= topic_len + 2
|
||||
if op & 6:
|
||||
pid = self.sock.read(2)
|
||||
pid = pid[0] << 8 | pid[1]
|
||||
sz -= 2
|
||||
msg = self.sock.read(sz).decode('utf-8')
|
||||
if op & 6 == 2:
|
||||
pkt = bytearray(b"\x40\x02\0\0")
|
||||
struct.pack_into("!H", pkt, 2, pid)
|
||||
self.sock.write(pkt)
|
||||
elif op & 6 == 4:
|
||||
assert 0
|
||||
|
||||
if self.cb is None:
|
||||
return {"msg":msg, "topic":topic}
|
||||
else:
|
||||
self.cb(topic, msg)
|
||||
|
||||
# Checks whether a pending message from server is available.
|
||||
def check_msg(self):
|
||||
self.sock.setblocking(False)
|
||||
return self.wait_msg()
|
||||
151
boards/default/micropython/build/lib/urequests.py
Normal file
151
boards/default/micropython/build/lib/urequests.py
Normal file
@@ -0,0 +1,151 @@
|
||||
import usocket
|
||||
|
||||
class Response:
|
||||
|
||||
def __init__(self, f):
|
||||
self.raw = f
|
||||
self.encoding = "utf-8"
|
||||
self._cached = None
|
||||
|
||||
def close(self):
|
||||
if self.raw:
|
||||
self.raw.close()
|
||||
self.raw = None
|
||||
self._cached = None
|
||||
|
||||
@property
|
||||
def content(self):
|
||||
if self._cached is None:
|
||||
try:
|
||||
self._cached = self.raw.read()
|
||||
finally:
|
||||
self.raw.close()
|
||||
self.raw = None
|
||||
return self._cached
|
||||
|
||||
@property
|
||||
def text(self):
|
||||
return str(self.content, self.encoding)
|
||||
|
||||
def json(self):
|
||||
import ujson
|
||||
return ujson.loads(self.content)
|
||||
|
||||
|
||||
def request(method, url, data=None, json=None, headers={}, stream=None, parse_headers=True):
|
||||
redir_cnt = 1
|
||||
while True:
|
||||
try:
|
||||
proto, dummy, host, path = url.split("/", 3)
|
||||
except ValueError:
|
||||
proto, dummy, host = url.split("/", 2)
|
||||
path = ""
|
||||
if proto == "http:":
|
||||
port = 80
|
||||
elif proto == "https:":
|
||||
import ussl
|
||||
port = 443
|
||||
else:
|
||||
raise ValueError("Unsupported protocol: " + proto)
|
||||
|
||||
if ":" in host:
|
||||
host, port = host.split(":", 1)
|
||||
port = int(port)
|
||||
|
||||
ai = usocket.getaddrinfo(host, port, 0, usocket.SOCK_STREAM)
|
||||
ai = ai[0]
|
||||
|
||||
resp_d = None
|
||||
if parse_headers is not False:
|
||||
resp_d = {}
|
||||
|
||||
s = usocket.socket(ai[0], ai[1], ai[2])
|
||||
try:
|
||||
s.connect(ai[-1])
|
||||
if proto == "https:":
|
||||
s = ussl.wrap_socket(s, server_hostname=host)
|
||||
s.write(b"%s /%s HTTP/1.0\r\n" % (method, path))
|
||||
if not "Host" in headers:
|
||||
s.write(b"Host: %s\r\n" % host)
|
||||
# Iterate over keys to avoid tuple alloc
|
||||
for k in headers:
|
||||
s.write(k)
|
||||
s.write(b": ")
|
||||
s.write(headers[k])
|
||||
s.write(b"\r\n")
|
||||
if json is not None:
|
||||
assert data is None
|
||||
import ujson
|
||||
data = ujson.dumps(json)
|
||||
s.write(b"Content-Type: application/json\r\n")
|
||||
if data:
|
||||
s.write(b"Content-Length: %d\r\n" % len(data))
|
||||
s.write(b"Connection: close\r\n\r\n")
|
||||
if data:
|
||||
s.write(data)
|
||||
|
||||
l = s.readline()
|
||||
#print(l)
|
||||
l = l.split(None, 2)
|
||||
status = int(l[1])
|
||||
reason = ""
|
||||
if len(l) > 2:
|
||||
reason = l[2].rstrip()
|
||||
while True:
|
||||
l = s.readline()
|
||||
if not l or l == b"\r\n":
|
||||
break
|
||||
#print(l)
|
||||
|
||||
if l.startswith(b"Transfer-Encoding:"):
|
||||
if b"chunked" in l:
|
||||
raise ValueError("Unsupported " + l)
|
||||
elif l.startswith(b"Location:") and 300 <= status <= 399:
|
||||
if not redir_cnt:
|
||||
raise ValueError("Too many redirects")
|
||||
redir_cnt -= 1
|
||||
url = l[9:].decode().strip()
|
||||
#print("redir to:", url)
|
||||
status = 300
|
||||
break
|
||||
|
||||
if parse_headers is False:
|
||||
pass
|
||||
elif parse_headers is True:
|
||||
l = l.decode()
|
||||
k, v = l.split(":", 1)
|
||||
resp_d[k] = v.strip()
|
||||
else:
|
||||
parse_headers(l, resp_d)
|
||||
except OSError:
|
||||
s.close()
|
||||
raise
|
||||
|
||||
if status != 300:
|
||||
break
|
||||
|
||||
resp = Response(s)
|
||||
resp.status_code = status
|
||||
resp.reason = reason
|
||||
if resp_d is not None:
|
||||
resp.headers = resp_d
|
||||
return resp
|
||||
|
||||
|
||||
def head(url, **kw):
|
||||
return request("HEAD", url, **kw)
|
||||
|
||||
def get(url, **kw):
|
||||
return request("GET", url, **kw)
|
||||
|
||||
def post(url, **kw):
|
||||
return request("POST", url, **kw)
|
||||
|
||||
def put(url, **kw):
|
||||
return request("PUT", url, **kw)
|
||||
|
||||
def patch(url, **kw):
|
||||
return request("PATCH", url, **kw)
|
||||
|
||||
def delete(url, **kw):
|
||||
return request("DELETE", url, **kw)
|
||||
350
boards/default/micropython/build/lib/vl53l0x.py
Normal file
350
boards/default/micropython/build/lib/vl53l0x.py
Normal file
@@ -0,0 +1,350 @@
|
||||
"""
|
||||
VL53L0X
|
||||
|
||||
Micropython library for the VL53L0X
|
||||
=======================================================
|
||||
|
||||
#https://github.com/mcauser/deshipu-micropython-vl53l0x.git 20220216
|
||||
|
||||
dahanzimin From the Mixly Team
|
||||
"""
|
||||
from micropython import const
|
||||
import ustruct
|
||||
import utime
|
||||
|
||||
|
||||
_IO_TIMEOUT = 1000
|
||||
_SYSRANGE_START = const(0x00)
|
||||
_EXTSUP_HV = const(0x89)
|
||||
_MSRC_CONFIG = const(0x60)
|
||||
_FINAL_RATE_RTN_LIMIT = const(0x44)
|
||||
_SYSTEM_SEQUENCE = const(0x01)
|
||||
_SPAD_REF_START = const(0x4f)
|
||||
_SPAD_ENABLES = const(0xb0)
|
||||
_REF_EN_START_SELECT = const(0xb6)
|
||||
_SPAD_NUM_REQUESTED = const(0x4e)
|
||||
_INTERRUPT_GPIO = const(0x0a)
|
||||
_INTERRUPT_CLEAR = const(0x0b)
|
||||
_GPIO_MUX_ACTIVE_HIGH = const(0x84)
|
||||
_RESULT_INTERRUPT_STATUS = const(0x13)
|
||||
_RESULT_RANGE_STATUS = const(0x14)
|
||||
_OSC_CALIBRATE = const(0xf8)
|
||||
_MEASURE_PERIOD = const(0x04)
|
||||
|
||||
|
||||
class TimeoutError(RuntimeError):
|
||||
pass
|
||||
|
||||
|
||||
class VL53L0X:
|
||||
def __init__(self, i2c, address=0x29):
|
||||
self.i2c = i2c
|
||||
self.address = address
|
||||
self.init()
|
||||
self._started = False
|
||||
|
||||
def _registers(self, register, values=None, struct='B'):
|
||||
if values is None:
|
||||
size = ustruct.calcsize(struct)
|
||||
data = self.i2c.readfrom_mem(self.address, register, size)
|
||||
values = ustruct.unpack(struct, data)
|
||||
return values
|
||||
data = ustruct.pack(struct, *values)
|
||||
self.i2c.writeto_mem(self.address, register, data)
|
||||
|
||||
def _register(self, register, value=None, struct='B'):
|
||||
if value is None:
|
||||
return self._registers(register, struct=struct)[0]
|
||||
self._registers(register, (value,), struct=struct)
|
||||
|
||||
def _flag(self, register=0x00, bit=0, value=None):
|
||||
data = self._register(register)
|
||||
mask = 1 << bit
|
||||
if value is None:
|
||||
return bool(data & mask)
|
||||
elif value:
|
||||
data |= mask
|
||||
else:
|
||||
data &= ~mask
|
||||
self._register(register, data)
|
||||
|
||||
def _config(self, *config):
|
||||
for register, value in config:
|
||||
self._register(register, value)
|
||||
|
||||
def init(self, power2v8=True):
|
||||
self._flag(_EXTSUP_HV, 0, power2v8)
|
||||
|
||||
# I2C standard mode
|
||||
self._config(
|
||||
(0x88, 0x00),
|
||||
|
||||
(0x80, 0x01),
|
||||
(0xff, 0x01),
|
||||
(0x00, 0x00),
|
||||
)
|
||||
self._stop_variable = self._register(0x91)
|
||||
self._config(
|
||||
(0x00, 0x01),
|
||||
(0xff, 0x00),
|
||||
(0x80, 0x00),
|
||||
)
|
||||
|
||||
# disable signal_rate_msrc and signal_rate_pre_range limit checks
|
||||
self._flag(_MSRC_CONFIG, 1, True)
|
||||
self._flag(_MSRC_CONFIG, 4, True)
|
||||
|
||||
# rate_limit = 0.25
|
||||
self._register(_FINAL_RATE_RTN_LIMIT, int(0.25 * (1 << 7)),
|
||||
struct='>H')
|
||||
|
||||
self._register(_SYSTEM_SEQUENCE, 0xff)
|
||||
|
||||
spad_count, is_aperture = self._spad_info()
|
||||
spad_map = bytearray(self._registers(_SPAD_ENABLES, struct='6B'))
|
||||
|
||||
# set reference spads
|
||||
self._config(
|
||||
(0xff, 0x01),
|
||||
(_SPAD_REF_START, 0x00),
|
||||
(_SPAD_NUM_REQUESTED, 0x2c),
|
||||
(0xff, 0x00),
|
||||
(_REF_EN_START_SELECT, 0xb4),
|
||||
)
|
||||
|
||||
spads_enabled = 0
|
||||
for i in range(48):
|
||||
if i < 12 and is_aperture or spads_enabled >= spad_count:
|
||||
spad_map[i // 8] &= ~(1 << (i >> 2))
|
||||
elif spad_map[i // 8] & (1 << (i >> 2)):
|
||||
spads_enabled += 1
|
||||
|
||||
self._registers(_SPAD_ENABLES, spad_map, struct='6B')
|
||||
|
||||
self._config(
|
||||
(0xff, 0x01),
|
||||
(0x00, 0x00),
|
||||
|
||||
(0xff, 0x00),
|
||||
(0x09, 0x00),
|
||||
(0x10, 0x00),
|
||||
(0x11, 0x00),
|
||||
|
||||
(0x24, 0x01),
|
||||
(0x25, 0xFF),
|
||||
(0x75, 0x00),
|
||||
|
||||
(0xFF, 0x01),
|
||||
(0x4E, 0x2C),
|
||||
(0x48, 0x00),
|
||||
(0x30, 0x20),
|
||||
|
||||
(0xFF, 0x00),
|
||||
(0x30, 0x09),
|
||||
(0x54, 0x00),
|
||||
(0x31, 0x04),
|
||||
(0x32, 0x03),
|
||||
(0x40, 0x83),
|
||||
(0x46, 0x25),
|
||||
(0x60, 0x00),
|
||||
(0x27, 0x00),
|
||||
(0x50, 0x06),
|
||||
(0x51, 0x00),
|
||||
(0x52, 0x96),
|
||||
(0x56, 0x08),
|
||||
(0x57, 0x30),
|
||||
(0x61, 0x00),
|
||||
(0x62, 0x00),
|
||||
(0x64, 0x00),
|
||||
(0x65, 0x00),
|
||||
(0x66, 0xA0),
|
||||
|
||||
(0xFF, 0x01),
|
||||
(0x22, 0x32),
|
||||
(0x47, 0x14),
|
||||
(0x49, 0xFF),
|
||||
(0x4A, 0x00),
|
||||
|
||||
(0xFF, 0x00),
|
||||
(0x7A, 0x0A),
|
||||
(0x7B, 0x00),
|
||||
(0x78, 0x21),
|
||||
|
||||
(0xFF, 0x01),
|
||||
(0x23, 0x34),
|
||||
(0x42, 0x00),
|
||||
(0x44, 0xFF),
|
||||
(0x45, 0x26),
|
||||
(0x46, 0x05),
|
||||
(0x40, 0x40),
|
||||
(0x0E, 0x06),
|
||||
(0x20, 0x1A),
|
||||
(0x43, 0x40),
|
||||
|
||||
(0xFF, 0x00),
|
||||
(0x34, 0x03),
|
||||
(0x35, 0x44),
|
||||
|
||||
(0xFF, 0x01),
|
||||
(0x31, 0x04),
|
||||
(0x4B, 0x09),
|
||||
(0x4C, 0x05),
|
||||
(0x4D, 0x04),
|
||||
|
||||
(0xFF, 0x00),
|
||||
(0x44, 0x00),
|
||||
(0x45, 0x20),
|
||||
(0x47, 0x08),
|
||||
(0x48, 0x28),
|
||||
(0x67, 0x00),
|
||||
(0x70, 0x04),
|
||||
(0x71, 0x01),
|
||||
(0x72, 0xFE),
|
||||
(0x76, 0x00),
|
||||
(0x77, 0x00),
|
||||
|
||||
(0xFF, 0x01),
|
||||
(0x0D, 0x01),
|
||||
|
||||
(0xFF, 0x00),
|
||||
(0x80, 0x01),
|
||||
(0x01, 0xF8),
|
||||
|
||||
(0xFF, 0x01),
|
||||
(0x8E, 0x01),
|
||||
(0x00, 0x01),
|
||||
(0xFF, 0x00),
|
||||
(0x80, 0x00),
|
||||
)
|
||||
|
||||
self._register(_INTERRUPT_GPIO, 0x04)
|
||||
self._flag(_GPIO_MUX_ACTIVE_HIGH, 4, False)
|
||||
self._register(_INTERRUPT_CLEAR, 0x01)
|
||||
|
||||
# XXX Need to implement this.
|
||||
#budget = self._timing_budget()
|
||||
#self._register(_SYSTEM_SEQUENCE, 0xe8)
|
||||
#self._timing_budget(budget)
|
||||
|
||||
self._register(_SYSTEM_SEQUENCE, 0x01)
|
||||
self._calibrate(0x40)
|
||||
self._register(_SYSTEM_SEQUENCE, 0x02)
|
||||
self._calibrate(0x00)
|
||||
|
||||
self._register(_SYSTEM_SEQUENCE, 0xe8)
|
||||
|
||||
def _spad_info(self):
|
||||
self._config(
|
||||
(0x80, 0x01),
|
||||
(0xff, 0x01),
|
||||
(0x00, 0x00),
|
||||
|
||||
(0xff, 0x06),
|
||||
)
|
||||
self._flag(0x83, 3, True)
|
||||
self._config(
|
||||
(0xff, 0x07),
|
||||
(0x81, 0x01),
|
||||
|
||||
(0x80, 0x01),
|
||||
|
||||
(0x94, 0x6b),
|
||||
(0x83, 0x00),
|
||||
)
|
||||
for timeout in range(_IO_TIMEOUT):
|
||||
if self._register(0x83):
|
||||
break
|
||||
utime.sleep_ms(1)
|
||||
else:
|
||||
raise TimeoutError()
|
||||
self._config(
|
||||
(0x83, 0x01),
|
||||
)
|
||||
value = self._register(0x92)
|
||||
self._config(
|
||||
(0x81, 0x00),
|
||||
(0xff, 0x06),
|
||||
)
|
||||
self._flag(0x83, 3, False)
|
||||
self._config(
|
||||
(0xff, 0x01),
|
||||
(0x00, 0x01),
|
||||
|
||||
(0xff, 0x00),
|
||||
(0x80, 0x00),
|
||||
)
|
||||
count = value & 0x7f
|
||||
is_aperture = bool(value & 0b10000000)
|
||||
return count, is_aperture
|
||||
|
||||
def _calibrate(self, vhv_init_byte):
|
||||
self._register(_SYSRANGE_START, 0x01 | vhv_init_byte)
|
||||
for timeout in range(_IO_TIMEOUT):
|
||||
if self._register(_RESULT_INTERRUPT_STATUS) & 0x07:
|
||||
break
|
||||
utime.sleep_ms(1)
|
||||
else:
|
||||
raise TimeoutError()
|
||||
self._register(_INTERRUPT_CLEAR, 0x01)
|
||||
self._register(_SYSRANGE_START, 0x00)
|
||||
|
||||
def start(self, period=0):
|
||||
self._config(
|
||||
(0x80, 0x01),
|
||||
(0xFF, 0x01),
|
||||
(0x00, 0x00),
|
||||
(0x91, self._stop_variable),
|
||||
(0x00, 0x01),
|
||||
(0xFF, 0x00),
|
||||
(0x80, 0x00),
|
||||
)
|
||||
if period:
|
||||
oscilator = self._register(_OSC_CALIBRATE, struct='>H')
|
||||
if oscilator:
|
||||
period *= oscilator
|
||||
self._register(_MEASURE_PERIOD, period, struct='>H')
|
||||
self._register(_SYSRANGE_START, 0x04)
|
||||
else:
|
||||
self._register(_SYSRANGE_START, 0x02)
|
||||
self._started = True
|
||||
|
||||
def stop(self):
|
||||
self._register(_SYSRANGE_START, 0x01)
|
||||
self._config(
|
||||
(0xFF, 0x01),
|
||||
(0x00, 0x00),
|
||||
(0x91, self._stop_variable),
|
||||
(0x00, 0x01),
|
||||
(0xFF, 0x00),
|
||||
)
|
||||
self._started = False
|
||||
|
||||
def read(self):
|
||||
if not self._started:
|
||||
self._config(
|
||||
(0x80, 0x01),
|
||||
(0xFF, 0x01),
|
||||
(0x00, 0x00),
|
||||
(0x91, self._stop_variable),
|
||||
(0x00, 0x01),
|
||||
(0xFF, 0x00),
|
||||
(0x80, 0x00),
|
||||
(_SYSRANGE_START, 0x01),
|
||||
)
|
||||
for timeout in range(_IO_TIMEOUT):
|
||||
if not self._register(_SYSRANGE_START) & 0x01:
|
||||
break
|
||||
utime.sleep_ms(1)
|
||||
else:
|
||||
raise TimeoutError()
|
||||
for timeout in range(_IO_TIMEOUT):
|
||||
if self._register(_RESULT_INTERRUPT_STATUS) & 0x07:
|
||||
break
|
||||
utime.sleep_ms(1)
|
||||
else:
|
||||
raise TimeoutError()
|
||||
value = self._register(_RESULT_RANGE_STATUS + 10, struct='>H')
|
||||
self._register(_INTERRUPT_CLEAR, 0x01)
|
||||
return value
|
||||
|
||||
|
||||
84
boards/default/micropython/build/lib/ws2812.py
Normal file
84
boards/default/micropython/build/lib/ws2812.py
Normal file
@@ -0,0 +1,84 @@
|
||||
"""
|
||||
WS2812 RGB
|
||||
|
||||
Micropython library for the WS2812 NeoPixel-RGB
|
||||
=======================================================
|
||||
|
||||
#Preliminary composition 20240110
|
||||
|
||||
dahanzimin From the Mixly Team
|
||||
"""
|
||||
from time import sleep
|
||||
from machine import bitstream
|
||||
|
||||
class NeoPixel:
|
||||
def __init__(self, pin, n, bpp=3, timing=1, ORDER=(1, 0, 2, 3), default=None, multiplex=False, leds=0):
|
||||
self.pin = pin
|
||||
self.bpp = bpp
|
||||
self.leds = leds
|
||||
self.rgbs = n-leds
|
||||
self.ORDER = ORDER
|
||||
self.multiplex = multiplex
|
||||
self.rgb_buf = bytearray(self.rgbs * bpp)
|
||||
self.led_buf = bytearray(self.leds * bpp)
|
||||
self.timing = (((350, 850, 800, 400) if timing else (800, 1700, 1600, 900)) if isinstance(timing, int) else timing)
|
||||
if not self.multiplex: self.pin.init(self.pin.OUT,value=default)
|
||||
self.write()
|
||||
|
||||
def __len__(self):
|
||||
return self.rgbs
|
||||
|
||||
def __setitem__(self, n, v):
|
||||
for i in range(self.bpp):
|
||||
self.rgb_buf[n * self.bpp + self.ORDER[i]] = v[i]
|
||||
|
||||
def __getitem__(self, n):
|
||||
return tuple(self.rgb_buf[n* self.bpp + self.ORDER[i]] for i in range(self.bpp))
|
||||
|
||||
def led_set(self, n, v):
|
||||
for i in range(self.bpp):
|
||||
self.led_buf[n * self.bpp + self.ORDER[i]] = v[i]
|
||||
|
||||
def led_get(self, n):
|
||||
return tuple(self.led_buf[n * self.bpp + self.ORDER[i]] for i in range(self.bpp))
|
||||
|
||||
def fill(self, v):
|
||||
for i in range(self.bpp):
|
||||
j = self.ORDER[i]
|
||||
while j < self.rgbs * self.bpp:
|
||||
self.rgb_buf[j] = v[i]
|
||||
j += self.bpp
|
||||
|
||||
def write(self):
|
||||
if self.multiplex: self.pin.init(self.pin.OUT)
|
||||
bitstream(self.pin, 0, self.timing, self.rgb_buf + self.led_buf)
|
||||
if self.multiplex: self.pin.init(self.pin.IN)
|
||||
|
||||
def color_chase(self,R, G, B, wait):
|
||||
for i in range(self.rgbs):
|
||||
self.__setitem__(i,(R, G, B))
|
||||
self.write()
|
||||
sleep(wait/1000)
|
||||
|
||||
def rainbow_cycle(self, wait, clear=True):
|
||||
for j in range(255):
|
||||
for i in range(self.rgbs):
|
||||
rc_index = (i * 256 // self.rgbs) + j
|
||||
self.__setitem__(i,self.wheel(rc_index & 255))
|
||||
self.write()
|
||||
sleep(wait / 1000 / 256)
|
||||
if clear:
|
||||
self.fill((0, 0, 0))
|
||||
self.write()
|
||||
|
||||
def wheel(self,pos):
|
||||
if pos < 0 or pos > 255:
|
||||
return (0, 0, 0)
|
||||
elif pos < 85:
|
||||
return (pos * 3, 255 - pos * 3, 0)
|
||||
elif pos < 170:
|
||||
pos -= 85
|
||||
return (255 - pos * 3, 0, pos * 3)
|
||||
else:
|
||||
pos -= 170
|
||||
return (0, pos * 3, 255 - pos * 3)
|
||||
129
boards/default/micropython/build/lib/ws_lora.py
Normal file
129
boards/default/micropython/build/lib/ws_lora.py
Normal file
@@ -0,0 +1,129 @@
|
||||
"""
|
||||
WS_Lora Weather Station
|
||||
|
||||
Micropython library for Weather Station /Lora
|
||||
=======================================================
|
||||
|
||||
#Preliminary composition 20220408
|
||||
|
||||
dahanzimin From the Mixly Team
|
||||
"""
|
||||
from json import dumps
|
||||
from rfm98 import RFM98
|
||||
from ubinascii import hexlify
|
||||
from machine import I2C,SoftI2C,unique_id
|
||||
|
||||
names =(("编号","电量","风速","阵风","风向","雨量","温度","湿度","光照","紫外线指数","气压","信号强度"),
|
||||
("ID","Battery","Wind Speed","Gust","Wind Direction","Rainfall","Temperature","Humidity","Illumination","UVI","Atmospheric","RSSI"))
|
||||
|
||||
class Weather(RFM98):
|
||||
def __init__(self,spi,cs_pin,i2c=None):
|
||||
'''对继承初始化配置'''
|
||||
super().__init__(spi,cs_pin,frequency_mhz=433.92,signal_bandwidth=125E3,coding_rate=5,spreading_factor=11)
|
||||
self._data=(None,None,None,None,None,None,None,None,None,None,None,None,None)
|
||||
self._atmos=None
|
||||
self._labels=[]
|
||||
|
||||
if type(i2c) in [I2C,SoftI2C]:
|
||||
if 0x76 in i2c.scan():
|
||||
import hp203x
|
||||
self._atmos = hp203x.HP203X(i2c)
|
||||
|
||||
def _data_deal(self,buffer):
|
||||
'''对解码数据进行处理'''
|
||||
if self._crc8(buffer[0:14]) == buffer[14]:
|
||||
Device_ID = (buffer[1] & 0x0f) <<4 | buffer[2] >>4
|
||||
State_BAT = (buffer[2] & 0x08) >>3
|
||||
AVG_Swind = (buffer[3] | (buffer[2] & 0x01)<<8)/10
|
||||
Gust_Swind = (buffer[4] | (buffer[2] & 0x02)<<7)/10
|
||||
DIR_wind = buffer[5] | (buffer[2] & 0x04)<<6
|
||||
SUM_Rain = (buffer[7] | buffer[6] <<8 )/10
|
||||
Temp_F = ((buffer[9] | (buffer[8] & 0x0F)<<8)-400)/10
|
||||
Temp_C = round((Temp_F-32)/1.8,2)
|
||||
Humidity = buffer[10]
|
||||
Light_Lux = (buffer[12] | buffer[11] <<8 | (buffer[8] & 0x30)<<12)/10
|
||||
UVI = buffer[13] / 10
|
||||
Pa = self._atmos.pressure() if self._atmos else None
|
||||
#待添加数据值(Temp_F,Humidity,Light_Lux,UVI)报错处理
|
||||
return Device_ID,1-State_BAT,AVG_Swind,Gust_Swind,DIR_wind,SUM_Rain,Temp_C,Humidity,Light_Lux,UVI,Pa,super().packet_rssi(),super().packet_snr()
|
||||
else:
|
||||
return False
|
||||
|
||||
def _crc8(self,buffer):
|
||||
'''对数据进行CRC校验'''
|
||||
crc = 0x00
|
||||
for byte in buffer:
|
||||
crc ^= byte
|
||||
for _ in range(8):
|
||||
if crc & 0x80:
|
||||
crc = (crc << 1) ^ 0x31
|
||||
else:
|
||||
crc = crc << 1
|
||||
return crc & 0xff # return the bottom 8 bits
|
||||
|
||||
def label(self,*args):
|
||||
'''标记气象站标签如 (id,long,lat)'''
|
||||
for arg in args:
|
||||
if len(arg) == 3:
|
||||
flag=True
|
||||
for label in self._labels:
|
||||
if label['ws_id'] == arg[0]:
|
||||
label.update({'long':arg[1],'lat':arg[2]})
|
||||
flag=False
|
||||
if flag:
|
||||
self._labels.append({'ws_id':arg[0],'long':arg[1],'lat':arg[2]})
|
||||
else:
|
||||
raise AttributeError('Invalid Input , format is (id,long,lat)')
|
||||
return self._labels
|
||||
|
||||
def any(self):
|
||||
'''判读是否有数据'''
|
||||
buffer=super().recv()
|
||||
if buffer:
|
||||
if (len(buffer)>=15) & (buffer[0] == 0xD4):
|
||||
self._data=self._data_deal(buffer)
|
||||
return True
|
||||
|
||||
def data(self,chinese=True):
|
||||
'''获取气象数据'''
|
||||
_name=names[0] if chinese else names[1]
|
||||
info_dict={_name[0]:self._data[0],
|
||||
_name[1]:"Normal" if self._data[1]==1 else "Low",
|
||||
_name[2]:str(self._data[2])+'m/s',
|
||||
_name[3]:str(self._data[3])+'m/s',
|
||||
_name[4]:str(self._data[4])+'°',
|
||||
_name[5]:str(self._data[5])+'mm',
|
||||
_name[6]:str(self._data[6])+'℃',
|
||||
_name[7]:str(self._data[7])+'%',
|
||||
_name[8]:str(self._data[8])+'lux',
|
||||
_name[9]:self._data[9],
|
||||
_name[10]:str(self._data[10])+'hPa',
|
||||
_name[11]:str(self._data[11])+'dBm'}
|
||||
|
||||
for label in self._labels:
|
||||
if label['ws_id'] == self._data[0]:
|
||||
msg_list=[]
|
||||
for info in info_dict:
|
||||
msg_list.append({"label":info,"value":info_dict[info]})
|
||||
label_dict={"message":msg_list,'clientid':hexlify(unique_id())}
|
||||
label_dict.update(label)
|
||||
return self._data,dumps(info_dict),dumps(label_dict)
|
||||
return self._data,dumps(info_dict),'null'
|
||||
|
||||
def uart_mixio(self,topic="station"):
|
||||
'''打包气象数据串口转发'''
|
||||
info_dict={topic+"-"+str(self._data[0]):
|
||||
{"电量":"正常" if self._data[1]==1 else "亏电",
|
||||
"风速":self._data[2],
|
||||
"阵风":self._data[3],
|
||||
"风向":self._data[4],
|
||||
"雨量":self._data[5],
|
||||
"温度":self._data[6],
|
||||
"湿度":self._data[7],
|
||||
"光照":self._data[8],
|
||||
"紫外线":self._data[9],
|
||||
"大气压":self._data[10],
|
||||
"信号强度":self._data[11]}}
|
||||
|
||||
print(dumps(info_dict))
|
||||
return info_dict
|
||||
138
boards/default/micropython/build/lib/ws_solo.py
Normal file
138
boards/default/micropython/build/lib/ws_solo.py
Normal file
@@ -0,0 +1,138 @@
|
||||
"""
|
||||
Weather_Solo
|
||||
|
||||
Micropython library for the Weather_Solo(WIND & RAIN)
|
||||
=======================================================
|
||||
|
||||
#Preliminary composition 20231207
|
||||
|
||||
@dahanzimin From the Mixly Team
|
||||
"""
|
||||
import time
|
||||
import math
|
||||
from machine import Pin, ADC
|
||||
|
||||
class Weather_WS:
|
||||
|
||||
def __init__(self, pin, leaf=0.09, pulse=2):
|
||||
Pin(pin, Pin.IN).irq(handler=self._ws_func, trigger=Pin.IRQ_FALLING)
|
||||
self._wtime = time.ticks_ms()
|
||||
self._distance = 2 * math.pi * leaf / pulse
|
||||
self._pulse = 0
|
||||
|
||||
def _ws_func(self, pin):
|
||||
if pin.value() == 0:
|
||||
self._pulse += self._distance
|
||||
|
||||
def _grade(self, speed):
|
||||
if speed <= 0.2:
|
||||
grade=0
|
||||
elif speed <=1.5:
|
||||
grade=1
|
||||
elif speed <=3.3:
|
||||
grade=2
|
||||
elif speed <=5.4:
|
||||
grade=3
|
||||
elif speed <=7.9:
|
||||
grade=4
|
||||
elif speed <=10.7:
|
||||
grade=5
|
||||
elif speed <=13.8:
|
||||
grade=6
|
||||
elif speed <=17.1:
|
||||
grade=7
|
||||
elif speed <=20.7:
|
||||
grade=8
|
||||
elif speed <=24.4:
|
||||
grade=9
|
||||
elif speed <=28.4:
|
||||
grade=10
|
||||
elif speed <=32.6:
|
||||
grade=11
|
||||
else:
|
||||
grade=12
|
||||
return grade
|
||||
|
||||
def wind_speed(self):
|
||||
time.sleep_ms(100)
|
||||
speed = self._pulse / time.ticks_diff(time.ticks_ms(), self._wtime) * 1000 if self._pulse > 0 else 0
|
||||
self._wtime = time.ticks_ms()
|
||||
self._pulse = 0
|
||||
return round(speed, 2), self._grade(speed)
|
||||
|
||||
class Weather_WD:
|
||||
|
||||
_DS = ["N", "NNE", "NE", "ENE", "E", "ESE", "SE", "SSE", "S", "SSW", "SW", "WSW", "W", "WNW", "NW", "NNW"]
|
||||
_DA = [0, 22.5, 45, 67.5, 90, 112.5, 135, 157.5, 180, 202.5, 225, 247.5, 270, 292.5, 315, 337.5]
|
||||
|
||||
def __init__(self, pin):
|
||||
self.adc = ADC(Pin(pin), atten=ADC.ATTN_11DB)
|
||||
|
||||
def wind_direction(self):
|
||||
values = []
|
||||
for _ in range(20):
|
||||
values.append(self.adc.read_uv()/1000000)
|
||||
time.sleep_ms(1)
|
||||
ain = sum(values) / 20
|
||||
|
||||
if ain <=0.083:
|
||||
dir=12
|
||||
elif ain <=0.135:
|
||||
dir=14
|
||||
elif ain <=0.184:
|
||||
dir=13
|
||||
elif ain <=0.253:
|
||||
dir=0
|
||||
elif ain <=0.349:
|
||||
dir=15
|
||||
elif ain <=0.421:
|
||||
dir=10
|
||||
elif ain <=0.568:
|
||||
dir=11
|
||||
elif ain <=0.761:
|
||||
dir=2
|
||||
elif ain <=1.004:
|
||||
dir=1
|
||||
elif ain <=1.273:
|
||||
dir=8
|
||||
elif ain <=1.501:
|
||||
dir=9
|
||||
elif ain <=1.826:
|
||||
dir=6
|
||||
elif ain <=2.137:
|
||||
dir=7
|
||||
elif ain <=2.308:
|
||||
dir=4
|
||||
elif ain <=2.429:
|
||||
dir=3
|
||||
else:
|
||||
dir=5
|
||||
return self._DS[dir], self._DA[dir]
|
||||
|
||||
class Weather_Rain:
|
||||
|
||||
def __init__(self, pin, capacity=0.2794):
|
||||
Pin(pin, Pin.IN).irq(handler=self._rain_func, trigger=Pin.IRQ_FALLING)
|
||||
self._rtime = time.ticks_ms()
|
||||
self._load = capacity
|
||||
self._mean = 0
|
||||
self._count = 0
|
||||
|
||||
def _rain_func(self, pin):
|
||||
if pin.value() == 0:
|
||||
self._count += self._load
|
||||
|
||||
def rain_count(self, time_s=3600):
|
||||
if time.ticks_diff(time.ticks_ms(), self._rtime) // 1000 >= time_s:
|
||||
self._mean = self._count / time.ticks_diff(time.ticks_ms(), self._rtime) * time_s * 1000 if self._count > 0 else 0
|
||||
self._rtime = time.ticks_ms()
|
||||
self._count = 0
|
||||
return round(self._count, 2), round(self._mean, 4)
|
||||
|
||||
#integration
|
||||
class Weather_Solo(Weather_WD, Weather_WS, Weather_Rain):
|
||||
|
||||
def __init__(self, pin_wd, pin_ws, pin_rain):
|
||||
Weather_WD.__init__(self, pin_wd)
|
||||
Weather_WS.__init__(self, pin_ws)
|
||||
Weather_Rain.__init__(self, pin_rain)
|
||||
Reference in New Issue
Block a user