foo 2
This commit is contained in:
parent
63e428ce4d
commit
bf0cc95c33
|
@ -68,19 +68,7 @@ def create_args(name):
|
||||||
add_chaosc_group(arg_parser)
|
add_chaosc_group(arg_parser)
|
||||||
|
|
||||||
args = finalize_arg_parser(arg_parser)
|
args = finalize_arg_parser(arg_parser)
|
||||||
|
return args
|
||||||
|
|
||||||
while 1:
|
|
||||||
try:
|
|
||||||
t = ord(serial_sock.read(1))
|
|
||||||
print "got value", t
|
|
||||||
osc_message = OSCMessage("/%s/ekg" % actor)
|
|
||||||
osc_message.appendTypedArg(t, "i")
|
|
||||||
osc_sock.sendall(osc_message.encode_osc())
|
|
||||||
except socket.error, msg:
|
|
||||||
# got disconnected?
|
|
||||||
print "lost connection!!!"
|
|
||||||
reconnect(args)
|
|
||||||
|
|
||||||
def init(name):
|
def init(name):
|
||||||
args = create_args(name)
|
args = create_args(name)
|
||||||
|
|
|
@ -20,12 +20,14 @@
|
||||||
|
|
||||||
from __future__ import absolute_import
|
from __future__ import absolute_import
|
||||||
|
|
||||||
|
import atexit
|
||||||
|
import socket
|
||||||
from sensors2osc import common
|
from sensors2osc import common
|
||||||
|
|
||||||
atexit.register(close)
|
atexit.register(common.close)
|
||||||
|
|
||||||
def main():
|
def main():
|
||||||
args, osc_sock = init("ekg2osc")
|
args, osc_sock = common.init("ekg2osc")
|
||||||
|
|
||||||
actor = args.actor
|
actor = args.actor
|
||||||
|
|
||||||
|
@ -39,7 +41,7 @@ def main():
|
||||||
except socket.error, msg:
|
except socket.error, msg:
|
||||||
# got disconnected?
|
# got disconnected?
|
||||||
print "lost connection!!!"
|
print "lost connection!!!"
|
||||||
reconnect(args)
|
common.reconnect(args)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue