[chronojump] Added python test for new automatic firmware



commit 682bc35fc752999ffe4cc64aa6c8fa6349e44836
Author: Xavier de Blas <xaviblas gmail com>
Date:   Fri Sep 12 14:18:55 2014 +0200

    Added python test for new automatic firmware

 .../test_chronopic-firmware-automatic.py           |   44 ++++++++++++++++++++
 1 files changed, 44 insertions(+), 0 deletions(-)
---
diff --git a/chronopic-firmware/chronopic-firmware-c/test_chronopic-firmware-automatic.py 
b/chronopic-firmware/chronopic-firmware-c/test_chronopic-firmware-automatic.py
new file mode 100644
index 0000000..81ab454
--- /dev/null
+++ b/chronopic-firmware/chronopic-firmware-c/test_chronopic-firmware-automatic.py
@@ -0,0 +1,44 @@
+import serial
+ser = serial.Serial("/dev/ttyUSB0")
+ser.baudrate = 9600
+
+#get version
+ser.write("V")
+major = ser.read()
+#1
+point = ser.read()
+#.
+minor = ser.read()
+#1
+print "version == '1.1' ?", str(major) + str(point) + str(minor) == '1.1'
+
+#comand_port_scanning
+ser.write("J")
+port = ser.read()
+port == 'J'
+print "port == J ?", port == 'J'
+
+#get debounce time
+ser.write("a")
+debounce = int(ser.read())
+print "current debounce =", debounce * 10
+#5. Ok, it's 5 * 10 ms = 50 ms
+
+#set debounce time
+ser.write("b\x01")
+print "changing to 10 ms"
+
+#get debounce time
+ser.write("a")
+debounce = int(ser.read())
+print "current debounce =", debounce * 10
+
+#set debounce time
+ser.write("b\x05")
+print "changing again to 50 ms"
+
+#get debounce time
+ser.write("a")
+debounce = int(ser.read())
+print "current debounce =", debounce * 10
+


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]