From 5b5271e98c6d7f0ffea9d6b3fbf2cec43d283d64 Mon Sep 17 00:00:00 2001 From: Tat-Chee Wan (USM) Date: Tue, 1 Mar 2011 09:10:13 +0800 Subject: Imported nxt-python baseline (v2.1.0) --- nxt-python-fantom/examples/spin.py | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 nxt-python-fantom/examples/spin.py (limited to 'nxt-python-fantom/examples/spin.py') 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) + -- cgit v1.2.3