- Timestamp:
- 02/01/10 21:08:38 (13 years ago)
- Location:
- rc
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
rc/puzzlebox_brainstorms_client_interface.py
r12 r14 162 162 163 163 if self.DEBUG: 164 print "executing: %s" % command s164 print "executing: %s" % command 165 165 166 166 os.system(command) … … 228 228 elif (event.type == pygame.locals.KEYDOWN): 229 229 230 print event.dict230 #print event.dict 231 231 232 232 if 'key' in event.dict.keys(): … … 251 251 commands.append('turn_right') 252 252 253 elif event.dict['key'] == 'c': 253 elif ((event.dict['key'] == pygame.K_PAGEDOWN) or \ 254 (event.dict['key'] == pygame.K_c)):: 254 255 commands.append('turn_in_reverse') 255 256 -
rc/puzzlebox_brainstorms_rc.py
r12 r14 17 17 import sys, time 18 18 import serial 19 19 20 import jaraco.nxt 20 21 import jaraco.nxt.messages 22 21 23 import puzzlebox_brainstorms_configuration as configuration 22 24 … … 49 51 self.command = command 50 52 53 self.connection = None 54 51 55 try: 52 56 self.connection = self.connect_to_nxt(self.device) … … 54 58 if self.DEBUG: 55 59 print "--> [RC] Connection failed to NXT device [%s]" % self.device 56 sys.exit()57 60 58 61 … … 63 66 connection = jaraco.nxt.Connection(self.device) 64 67 65 if self.DEBUG > 1:68 if self.DEBUG: 66 69 battery_voltage = self.get_battery_voltage(connection) 67 70 print "--> [RC] Battery voltage:", … … 303 306 rc = puzzlebox_brainstorms_rc(device=device, command=command, DEBUG=DEBUG) 304 307 308 if rc.connection == None: 309 sys.exit() 310 305 311 rc.run(rc.command) 306 312 rc.stop()
Note: See TracChangeset
for help on using the changeset viewer.