move xbee user code in a separate file