This section describes the BrickPython examples.
Bases: BrickPython.TkApplication.TkApplication
Application to control a lego NXT motor on port A as a servo motor.
Type keystrokes into the application window to make the motor move: Numbers 0-9 make it move forward the corresponding number of quarter-turns. Lower case letters a-p make it go backward the corresponding number of quarter turns. Capital letter A stops the motor. Capital letters B-G make it go forward at a constant speed. B is a quarter turn per second, C a half turn, and so on. Letters xyz and XYZ adjust the settings for the PID Servo Motor algorithm: * X,x increase and decrease the ‘distance multiplier’ - the P setting. * Y,y increase and decrease the ‘speed multiplier’ - the D setting (I think). * Z,z increase and decrease the ‘Integrated distance multimplier’ - the I setting.
Bases: BrickPython.TkApplication.TkApplication
Application to automatically open and close a door using a proximity sensor. It also closes and ‘locks’ it when C is pressed (so the sensor no longer opens it), starting again when S or O is pressed
The door is attached to a motor, which opens it by moving through 90 degrees, and closes it the same way.
The sensor is mounted above the door, so it detects approaching ‘peaple’.