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

All Samples(3)  |  Call(3)  |  Derive(0)  |  Import(0)

src/b/r/BrickPython-0.4/ExamplePrograms/MotorController.py   BrickPython(Download)
    def rotate(self, degrees):
        'Rotate motor A through *degrees*'
        self.stopAllCoroutines()
        motor = self.motor('A')
        logging.info( "Rotating motor A %d degrees" % degrees )
    def setSpeed(self, speed):
        'Set the speed of motor A'
        self.stopAllCoroutines()
        motor = self.motor('A')
        logging.info( "Speed for motor A %.2f" % speed )

src/b/r/BrickPython-0.4/ExamplePrograms/DoorControl.py   BrickPython(Download)
        It uses the flag *doorLocked* to determine whether the user has 'locked' the door.
        '''
        motorA = self.motor('A')
        sensor1 = self.sensor('1')
        motorA.zeroPosition()