first running version

This commit is contained in:
2025-05-16 15:30:11 +02:00
parent e87a4a291b
commit bce669a225
3 changed files with 204 additions and 9 deletions

30
main.py Normal file
View File

@ -0,0 +1,30 @@
# simple example
#
from machine import Pin
from pxsi import Pxsi
with Pxsi('MyBox'):
t = 0.5 # blink interval
a = 'x'
b = 0 # changes to this variable will be converted to int !
Pxsi.add(d=0.0)
# called whenever a is changed remotely
def change_a(value):
print(f'changed t: {value!r}')
return str(value) # return validated value
led = Pin(6, Pin.OUT)
def main():
while 1:
led.toggle()
Pxsi.handle(t) # wait at most for the given blink interval
Pxsi.vars['b'] += 1
main()