aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorSudar <sudar@sudarmuthu.com>2013-06-08 17:26:24 +0530
committerSudar <sudar@sudarmuthu.com>2013-06-08 17:26:24 +0530
commit36c32e75cc1a8dd41f769d8576e8cde9cff03dde (patch)
tree148ca61bf2e07790f53f8b0ea2b4370d965fd7a8 /bin
parentca49da9f1d3f39482fbf9bbd7a85b96fff9020ae (diff)
Added leonardo support. Took Code from @guicho271828
Diffstat (limited to 'bin')
-rwxr-xr-xbin/ard-reset-leonardo12
-rwxr-xr-xbin/wait-connection-leonardo15
2 files changed, 27 insertions, 0 deletions
diff --git a/bin/ard-reset-leonardo b/bin/ard-reset-leonardo
new file mode 100755
index 0000000..dc05f06
--- /dev/null
+++ b/bin/ard-reset-leonardo
@@ -0,0 +1,12 @@
+#! /usr/bin/python
+
+import sys
+import serial
+
+ser = serial.Serial(sys.argv[1], 57600)
+ser.close()
+ser.open()
+ser.close()
+ser.setBaudrate(1200)
+ser.open()
+ser.close()
diff --git a/bin/wait-connection-leonardo b/bin/wait-connection-leonardo
new file mode 100755
index 0000000..92d26f7
--- /dev/null
+++ b/bin/wait-connection-leonardo
@@ -0,0 +1,15 @@
+#! /bin/bash
+
+while [ ! -e $1 ]
+do
+ echo Waiting connection at $1
+ sleep 0.2
+done
+
+sleep 1
+# necessary for me...
+# /dev/ttyACM0 used to disappear after the reset
+# but no longer now. How can I tell whether the
+# connection is ready?
+
+echo Connection Established