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/test_sensors.py | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 nxt-python-fantom/examples/test_sensors.py (limited to 'nxt-python-fantom/examples/test_sensors.py') diff --git a/nxt-python-fantom/examples/test_sensors.py b/nxt-python-fantom/examples/test_sensors.py new file mode 100644 index 0000000..4c8d249 --- /dev/null +++ b/nxt-python-fantom/examples/test_sensors.py @@ -0,0 +1,11 @@ +#!/usr/bin/env python + +import nxt.locator +from nxt.sensor import * + +b = nxt.locator.find_one_brick() + +print 'Touch:', Touch(b, PORT_1).get_sample() +print 'Sound:', Sound(b, PORT_2).get_sample() +print 'Light:', Light(b, PORT_3).get_sample() +print 'Ultrasonic:', Ultrasonic(b, PORT_4).get_sample() -- cgit v1.2.3