print datum
        if command == 'ID':
            datum = unpack('cc', parameter)
            print datum

    #The packet is data recieved from the radio
    elif name == 'rx':
        src_addr = packet.get('source_addr')
        rssi = packet.get('rssi')
        options = packet.get('options')
        data = packet.get('rf_data')
        #Handle packet in whatever way is appropriate
        print 'Packet received on channel:'
        base.getChannel('a')


#Initialize the basestation and the helper functions
xb = BaseStation('/dev/tty.usbserial-A800fdFZ', 230400, DEST_ADDR,
                 xbee_received)
base = BaseFunctions(xb)
robot = RobotFunctions(xb)

if __name__ == '__main__':

    base.setChannel('\x17')

    while true:
        time.sleep(1)

    print '\n'
    sys.exit()
Exemple #2
0
        print command
        print len(parameter)        

    #The packet is data recieved from the radio
    elif name == 'rx':
        src_addr = packet.get('source_addr')
        rssi = packet.get('rssi')
        options = packet.get('options')
        data = packet.get('rf_data')
        #Handle packet in whatever way is appropriate
        print 'Packet received'
        
    
#Initialize the basestation and the helper functions
xb = BaseStation('/dev/tty.usbserial-A800fdFZ', 230400, DEST_ADDR, xbee_received)
base = BaseFunctions(xb)
robot = RobotFunctions(xb)

if __name__ == '__main__':
    
    base.getChannel('a')
    base.getSrcAddr('b')
    base.getPanID('c')
    
    base.setChannel('\x17')

    robot.go(40)
    
    time.sleep(1)
    
    robot.stop()
Exemple #3
0
        if command == 'ID':
            datum = unpack('cc',parameter)
            print datum
            

    #The packet is data recieved from the radio
    elif name == 'rx':
        src_addr = packet.get('source_addr')
        rssi = packet.get('rssi')
        options = packet.get('options')
        data = packet.get('rf_data')
        #Handle packet in whatever way is appropriate
        print 'Packet received on channel:'
        base.getChannel('a')
        
    
#Initialize the basestation and the helper functions
xb = BaseStation('/dev/tty.usbserial-A800fdFZ', 230400, DEST_ADDR, xbee_received)
base = BaseFunctions(xb)
robot = RobotFunctions(xb)

if __name__ == '__main__':
    
    base.setChannel('\x17')
    
    while true:        
        time.sleep(1)
        
    
    print '\n'
    sys.exit()