summaryrefslogtreecommitdiff
path: root/nxt-python-fantom/examples/spin.py
diff options
context:
space:
mode:
authorTat-Chee Wan (USM)2011-03-01 09:10:13 +0800
committerTat-Chee Wan (USM)2011-03-01 09:10:13 +0800
commit5b5271e98c6d7f0ffea9d6b3fbf2cec43d283d64 (patch)
tree87624772defa75852f127d519a252686b2a338ba /nxt-python-fantom/examples/spin.py
parenta017874bb2a7881aaaf57832049fe281191c05c2 (diff)
Imported nxt-python baseline (v2.1.0)
Diffstat (limited to 'nxt-python-fantom/examples/spin.py')
-rw-r--r--nxt-python-fantom/examples/spin.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/nxt-python-fantom/examples/spin.py b/nxt-python-fantom/examples/spin.py
new file mode 100644
index 0000000..fc7cb2c
--- /dev/null
+++ b/nxt-python-fantom/examples/spin.py
@@ -0,0 +1,14 @@
+#!/usr/bin/env python
+
+import nxt.locator
+from nxt.motor import *
+
+def spin_around(b):
+ m_left = Motor(b, PORT_B)
+ m_left.turn(100, 360)
+ m_right = Motor(b, PORT_C)
+ m_right.turn(-100, 360)
+
+b = nxt.locator.find_one_brick()
+spin_around(b)
+