rebuild
This commit is contained in:
File diff suppressed because one or more lines are too long
1
boards/default/arduino_avr/main.bundle.03b6eab0.js
Normal file
1
boards/default/arduino_avr/main.bundle.03b6eab0.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1 +1 @@
|
|||||||
<script defer=defer src=main.bundle.484e98a9.js></script><link href=styles/main.b29a8ee0.css rel=stylesheet><xml></xml>
|
<script defer=defer src=main.bundle.1079ec46.js></script><link href=styles/main.b29a8ee0.css rel=stylesheet><xml></xml>
|
||||||
1
boards/default/arduino_esp32/main.bundle.1079ec46.js
Normal file
1
boards/default/arduino_esp32/main.bundle.1079ec46.js
Normal file
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -3,13 +3,16 @@ IR-Remote
|
|||||||
|
|
||||||
Micropython library for the IR-Remote/Timer(IR_RX&TX)
|
Micropython library for the IR-Remote/Timer(IR_RX&TX)
|
||||||
===============================================
|
===============================================
|
||||||
#Preliminary composition 20240302
|
|
||||||
|
|
||||||
@dahanzimin From the Mixly Team
|
@dahanzimin From the Mixly Team
|
||||||
"""
|
"""
|
||||||
import array, time, gc
|
import array, time, gc
|
||||||
from esp32 import RMT
|
|
||||||
from machine import Pin, Timer
|
from machine import Pin, Timer
|
||||||
|
try:
|
||||||
|
from esp32 import RMT
|
||||||
|
TX_MOED = 1
|
||||||
|
except:
|
||||||
|
from machine import PWM
|
||||||
|
TX_MOED = 0
|
||||||
|
|
||||||
'''接收部分'''
|
'''接收部分'''
|
||||||
class IR_RX:
|
class IR_RX:
|
||||||
@@ -130,10 +133,30 @@ class RC5_RX(IR_RX):
|
|||||||
'''发射部分'''
|
'''发射部分'''
|
||||||
class IR_TX:
|
class IR_TX:
|
||||||
def __init__(self, pin, cfreq=38000, power=60):
|
def __init__(self, pin, cfreq=38000, power=60):
|
||||||
|
if TX_MOED:
|
||||||
self._rmt = RMT(0, pin=Pin(pin), clock_div=80, tx_carrier = (cfreq, round(power * 0.75), 1))
|
self._rmt = RMT(0, pin=Pin(pin), clock_div=80, tx_carrier = (cfreq, round(power * 0.75), 1))
|
||||||
|
else:
|
||||||
|
self._pwm = PWM(Pin(pin), freq=cfreq, duty_u16=0)
|
||||||
|
self._duty = round(power * 65535 / 100 * 0.75)
|
||||||
|
self._busy = False
|
||||||
self._pulses = array.array('H')
|
self._pulses = array.array('H')
|
||||||
self.carrier = False
|
self.carrier = False
|
||||||
|
|
||||||
|
def _pwm_write_pulses(self, pulses):
|
||||||
|
_flip = True
|
||||||
|
self._busy = True
|
||||||
|
for pulse in pulses:
|
||||||
|
if _flip:
|
||||||
|
self._pwm.duty_u16(self._duty)
|
||||||
|
time.sleep_us(pulse)
|
||||||
|
_flip = False
|
||||||
|
else:
|
||||||
|
self._pwm.duty_u16(0)
|
||||||
|
time.sleep_us(pulse)
|
||||||
|
_flip = True
|
||||||
|
self._pwm.duty_u16(0)
|
||||||
|
self._busy = False
|
||||||
|
|
||||||
def transmit(self, cmd=None, addr=None, toggle=None, pulses=None, raw=None):
|
def transmit(self, cmd=None, addr=None, toggle=None, pulses=None, raw=None):
|
||||||
if pulses is None:
|
if pulses is None:
|
||||||
self.carrier = False
|
self.carrier = False
|
||||||
@@ -141,13 +164,19 @@ class IR_TX:
|
|||||||
self.tx(cmd, addr, toggle)
|
self.tx(cmd, addr, toggle)
|
||||||
else:
|
else:
|
||||||
self.tx_raw(raw)
|
self.tx_raw(raw)
|
||||||
|
if TX_MOED:
|
||||||
self._rmt.write_pulses(tuple(self._pulses))
|
self._rmt.write_pulses(tuple(self._pulses))
|
||||||
|
else:
|
||||||
|
self._pwm_write_pulses(tuple(self._pulses))
|
||||||
self._pulses = array.array('H')
|
self._pulses = array.array('H')
|
||||||
else:
|
else:
|
||||||
|
if TX_MOED:
|
||||||
self._rmt.write_pulses(tuple(pulses))
|
self._rmt.write_pulses(tuple(pulses))
|
||||||
|
else:
|
||||||
|
self._pwm_write_pulses(tuple(pulses))
|
||||||
|
|
||||||
def busy(self):
|
def busy(self):
|
||||||
return not self._rmt.wait_done()
|
return not self._rmt.wait_done() if TX_MOED else self._busy
|
||||||
|
|
||||||
def _append(self, *times):
|
def _append(self, *times):
|
||||||
for t in times:
|
for t in times:
|
||||||
|
|||||||
@@ -362,11 +362,12 @@
|
|||||||
"array",
|
"array",
|
||||||
"time",
|
"time",
|
||||||
"gc",
|
"gc",
|
||||||
|
"machine",
|
||||||
"esp32",
|
"esp32",
|
||||||
"machine"
|
"machine"
|
||||||
],
|
],
|
||||||
"__file__": true,
|
"__file__": true,
|
||||||
"__size__": 6243,
|
"__size__": 6913,
|
||||||
"__name__": "irremote.py"
|
"__name__": "irremote.py"
|
||||||
},
|
},
|
||||||
"ltr308al": {
|
"ltr308al": {
|
||||||
@@ -605,7 +606,7 @@
|
|||||||
"json"
|
"json"
|
||||||
],
|
],
|
||||||
"__file__": true,
|
"__file__": true,
|
||||||
"__size__": 3412,
|
"__size__": 3356,
|
||||||
"__name__": "ollama.py"
|
"__name__": "ollama.py"
|
||||||
},
|
},
|
||||||
"onenet": {
|
"onenet": {
|
||||||
|
|||||||
@@ -4,7 +4,7 @@ import json
|
|||||||
|
|
||||||
|
|
||||||
class Ollama():
|
class Ollama():
|
||||||
def __init__(self, url="", model="", max_history_num=0, max_tokens=1024):
|
def __init__(self, url="", model="", max_history_num=0):
|
||||||
self._heads = {
|
self._heads = {
|
||||||
"Accept": "text/event-stream",
|
"Accept": "text/event-stream",
|
||||||
# "Cache-Control": "no-cache",
|
# "Cache-Control": "no-cache",
|
||||||
@@ -19,8 +19,7 @@ class Ollama():
|
|||||||
self._data = {
|
self._data = {
|
||||||
"stream": True,
|
"stream": True,
|
||||||
"model": model,
|
"model": model,
|
||||||
"messages": self._messages,
|
"messages": self._messages
|
||||||
"max_tokens": max_tokens
|
|
||||||
}
|
}
|
||||||
|
|
||||||
def set_timeout(self, timeout):
|
def set_timeout(self, timeout):
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user