Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Xbee thinking. I'm having more trouble just trying to get this to work even with just x-ctu. I have some code below but I'd like to debut prior to that. Link to my post here with my settings. http://www.raspberrypi.org/phpBB3/viewtopic.php?f=63&t=38946&p=322553&hilit=xbee#p322553
import serial
from xbee import XBee
import time
#Init Xbee
serial_port = serial.Serial('/dev/ttyUSB0', 9600)
xbee = XBee(serial_port)
device={
"CO3":'\x00\x13\xa2\x00\x40\x08\xc5\x66',# on the pi
"EP1":'\x00\x13\xa2\x00\x40\x08\xc5\x54' # led one
}
#64 bit address
led=False
while 1:
#set led status
led=not led
if led:
xbee.remote_at(dest_addr_long=device["EP1"],command='D5',parameter='\x04')
else:
xbee.remote_at(dest_addr_long=device["EP1"],command='D5',parameter='\x05')
# wait 1 second
time.sleep(1)
serial_port.close()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment