From 7f76c954721a21303e080ef1203f6b1c23e74911 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Ond=C5=99ej=20Hru=C5=A1ka?= Date: Wed, 27 Dec 2017 15:09:43 +0100 Subject: [PATCH] cleaning --- main.py | 54 +++++------------------------------------------------- 1 file changed, 5 insertions(+), 49 deletions(-) diff --git a/main.py b/main.py index f109354..9fc9188 100644 --- a/main.py +++ b/main.py @@ -2,54 +2,10 @@ import time import gex -from gex import PayloadParser -from gex import PayloadBuilder -if False: - pb = PayloadBuilder() - pb.u8(128) - pb.i8(-1) - pb.u16(1) - pb.u32(123456789) - pb.float(3.1415) - pb.bool(True) - pb.bool(False) - pb.str("FUCKLE") +client = gex.Client() +led = gex.Pin(client, 'LED') - buf = pb.close() - print(buf) - - pp = PayloadParser(buf) - - print('>',pp.u8()) - print('>',pp.i8()) - print('>',pp.u16()) - print('>',pp.u32()) - print('>',pp.float()) - print('>',pp.bool()) - print('>',pp.bool()) - print('>',pp.str()) - -if True: - client = gex.Client() - led = gex.Pin(client, 'LED') - - for i in range(0,10): - led.toggle() - time.sleep(.1) - - -# -# port = serial.Serial( -# port='/dev/ttyACM0', -# timeout=0.1 -# ) -# -# print("Send request") -# port.write(b'\x01\x80\x00\x00\x00\x01\x7f') -# -# print("Wait for response") -# rv = port.read(1) -# rv += port.read(port.in_waiting) -# -# print(rv) +for i in range(0,10): + led.toggle() + time.sleep(.1)