Rose-Hulman Robotics Team

Changeset 219

Show
Ignore:
Timestamp:
09/30/08 20:58:06 (3 years ago)
Author:
mosttw
Message:

Updated serial code for new protocol

Location:
trunk/software
Files:
4 modified

Legend:

Unmodified
Added
Removed
  • trunk/software/rb/gui/__init__.py

    r218 r219  
    4040        ''' 
    4141         
    42         require('rb.motor.motor_controller.serial_motor_controller', '/dev/ttyS0') 
     42        require('rb.motor.motor_controller.serial_motor_controller') 
    4343        require('rb.motor.command.motor_command_relay') 
    4444         
  • trunk/software/rb/motor/command.py

    r200 r219  
    7575                while flag.running: 
    7676                        try: 
     77                                # Check for a new target speed.  Don't block because we 
     78                                # still need to update the motor speed. 
    7779                                event = queue.get(block=False) 
    7880                        except Empty: 
     
    8082                                        if not sp and brake: 
    8183                                                log_debug("motor_command_relay: activating the brake for %s" % addr) 
    82                                                 dispatch("motor:motor_control", (addr, MC_BRAKE)) 
     84                                                dispatch("motor:motor_control", (addr, MC_BRAKE, 0)) 
    8385                                                brake = False 
    8486                                        elif trans: 
  • trunk/software/rb/motor/motor_controller.py

    r200 r219  
    3838 
    3939MC_FORWARD = 0 
    40 MC_REVERSE = 1 
    41 MC_BRAKE  = 2 
     40MC_BRAKE  = 1 
     41MC_REVERSE = 2 
    4242 
    4343 
     
    9696                log_debug("Serial MC: Wrote " + ''.join(' %02x' % ord(c) for c in data)) 
    9797                retval = port.read(size=1) 
    98                 if not retval or retval != '0': 
     98                if not retval or ord(retval): 
    9999                        log_error("Serial MC: Error writing to motor controller. " 
    100100                                          "Response was %r%s" % ( 
  • trunk/software/rbconfig.py

    r201 r219  
    4545 
    4646# Serial port for the motor controller 
    47 motor_controller_port = '/dev/ttyS0' 
     47motor_controller_port = '/dev/ttyUSB0' 
    4848 
    4949# Minimum speed, aside from 0, that the motor controller can be