foo 2
This commit is contained in:
parent
63e428ce4d
commit
bf0cc95c33
|
@ -68,19 +68,7 @@ def create_args(name):
|
|||
add_chaosc_group(arg_parser)
|
||||
|
||||
args = finalize_arg_parser(arg_parser)
|
||||
|
||||
|
||||
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)
|
||||
return args
|
||||
|
||||
def init(name):
|
||||
args = create_args(name)
|
||||
|
|
|
@ -20,12 +20,14 @@
|
|||
|
||||
from __future__ import absolute_import
|
||||
|
||||
import atexit
|
||||
import socket
|
||||
from sensors2osc import common
|
||||
|
||||
atexit.register(close)
|
||||
atexit.register(common.close)
|
||||
|
||||
def main():
|
||||
args, osc_sock = init("ekg2osc")
|
||||
args, osc_sock = common.init("ekg2osc")
|
||||
|
||||
actor = args.actor
|
||||
|
||||
|
@ -39,7 +41,7 @@ def main():
|
|||
except socket.error, msg:
|
||||
# got disconnected?
|
||||
print "lost connection!!!"
|
||||
reconnect(args)
|
||||
common.reconnect(args)
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue