Did I find the right examples for you? yes no      Crawl my project      Python Jobs

All Samples(4)  |  Call(2)  |  Derive(0)  |  Import(2)

src/b/r/BrickPython-0.4/ExamplePrograms/TrialApp.py   BrickPython(Download)
 
from BrickPython.TkApplication import TkApplication
from BrickPython.Sensor import Sensor, TouchSensor, LightSensor,\
    UltrasonicSensor
import logging

src/b/r/BrickPython-0.4/test/TestSensor.py   BrickPython(Download)
import unittest
from BrickPython.BrickPi import PORT_1
from BrickPython.Sensor import Sensor, TouchSensor, UltrasonicSensor, LightSensor
import TestScheduler
 
    def testUltrasonicSensor(self):
        sensor = UltrasonicSensor( '1' )
        self.assertEquals(sensor.port, 0)
        self.assertEquals( sensor.idChar, '1' )
        for input, output in {0:0, 2:0, 3:5, 4:5, 9:10, 11:10, 14:15, 16:15, 22:20, 23:25, 26:25,
    def testUltrasonicSensorSmoothing(self):
        sensor = UltrasonicSensor( '1' )
        for input in [ 24,14,10,8,10,10,50,10,50,18,50]:
            sensor.updateValue( input )
        print sensor