def put(self, val):
        '''
        Put a message on port.  Use box to indicate type:
        1 -- string
        2 -- int
        3 -- bool
        '''
        if type(val) == type(''):
            msg = val
            box = 1
        elif type(val) == type(0):
            msg = struct.pack('i', val)
            box = 2
        elif type(val) == type(False):
            msg = struct.pack('b', not not val)
            box = 3
        return Blue.put(self, msg, box)

        Put a message on port.  Use box to indicate type:
        1 -- string
        2 -- int
        3 -- bool
        
recipes/Python/498085_Lego_Mindstorms_Bluetooth/recipe-498085.py