import pythonosc.osc_server
import pythonosc.dispatcher
# toto ma kazdy ine
ip = "192.168.10.32"
port = 5050
def center(znak, pocetznakov, dlzka_riadku):
dlzka_okraja = (dlzka_riadku - pocetznakov) // 2
okraj = " " * dlzka_okraja
obsah = znak * pocetznakov
riadok = okraj + obsah + okraj
return riadok
def mega(addr, *args):
# print(addr)
data = int(args[0])
print(center("0", data, 500))
# vytvorim dispecera
disp = pythonosc.dispatcher.Dispatcher()
# default co ma robit ked nieco pride
# disp.set_default_handler(print)
disp.map("/orientation/alpha", mega)
# server
server = pythonosc.osc_server.ThreadingOSCUDPServer((ip, port), disp)
server.serve_forever()
aplikacie #
https://apps.apple.com/us/app/data-osc/id6447833736 https://apkcombo.com/oschook/com.hollyhook.oscHook/