summaryrefslogtreecommitdiff
path: root/AT91SAM7S256/armdebug/nxt-python-fantom/examples/spin.py
diff options
context:
space:
mode:
authorTat-Chee Wan (USM)2011-03-01 17:01:37 +0800
committerTat-Chee Wan (USM)2011-03-01 17:01:37 +0800
commita85e78c4532ad1e9d7c8282334280db5e700b7f0 (patch)
treecfcbf734bb146b8531304e912d91114e914ff831 /AT91SAM7S256/armdebug/nxt-python-fantom/examples/spin.py
parenteae3f8bdb3de377d5e303bffb84238f0d86beee2 (diff)
parent2234d3c1cae095a3a450e7c5bbf0c7b89bb6c346 (diff)
Merge branch 'master' of ssh://svc.cs.usm.my/~/gitrepo-bare/armdebug
Diffstat (limited to 'AT91SAM7S256/armdebug/nxt-python-fantom/examples/spin.py')
-rw-r--r--AT91SAM7S256/armdebug/nxt-python-fantom/examples/spin.py14
1 files changed, 14 insertions, 0 deletions
diff --git a/AT91SAM7S256/armdebug/nxt-python-fantom/examples/spin.py b/AT91SAM7S256/armdebug/nxt-python-fantom/examples/spin.py
new file mode 100644
index 0000000..fc7cb2c
--- /dev/null
+++ b/AT91SAM7S256/armdebug/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)
+