Changeset 42 for remote_control/puzzlebox_brainstorms_remote_control.py
- Timestamp:
- 05/18/10 03:42:20 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
remote_control/puzzlebox_brainstorms_remote_control.py
r40 r42 9 9 # For more information please refer to http://www.gnu.org/copyleft/gpl.html 10 10 # 11 # Last Update: 2010.0 2.0511 # Last Update: 2010.05.03 12 12 # 13 13 ##################################################################### … … 26 26 27 27 DEBUG = 2 28 29 DISCRETE_CONTROL_COMMANDS = configuration.DISCRETE_CONTROL_COMMANDS 28 30 29 31 BLUETOOTH_DEVICE = configuration.BLUETOOTH_DEVICE … … 155 157 156 158 # Continue operating motors while control program pauses 157 time.sleep(duration) 159 if DISCRETE_CONTROL_COMMANDS: 160 time.sleep(duration) 161 162 self.stop_motors(connection) 163 164 165 ################################################################## 166 167 def stop_motors(self, connection): 168 169 "Stop both motors" 170 171 left_motor = self.connect_to_port(MOTOR_PORT_LEFT) 172 right_motor = self.connect_to_port(MOTOR_PORT_RIGHT) 158 173 159 174 # Issue command to stop both motors … … 266 281 def run(self, command): 267 282 268 if (command == 'test_drive'): 269 self.test_drive(self.connection) 270 271 elif (command == 'drive_forward'): 283 if (command == 'drive_forward'): 272 284 self.drive_forward(self.connection, duration=3) 273 285 … … 286 298 elif (command == 'turn_right_in_reverse'): 287 299 self.turn_right_in_reverse(self.connection) 300 301 elif (command == 'stop_motors'): 302 self.stop_motors(self.connection) 303 304 elif (command == 'test_drive'): 305 self.test_drive(self.connection) 288 306 289 307
Note: See TracChangeset
for help on using the changeset viewer.