rachaelnex wrote:Just noticed something about the ear sensor script. It seems that even when the rabbits ears haven't changed position, the tss is still sent. Am I doing something wrong ?
Try this: Open up the program in IDLE, and just before the comment line:
# Get ear positions
type:
print "old ear positions: ", oldPositions[0], oldPositions[1]
Then save and run. This will print out whatever the program thinks the old positions are, and then we can work from there. I just tried downloading the code I posted, and it's working fine for me, but this should help track down the problem. Also, are you getting only the killer rabbit text to speech message, or also the "technology is beautful" mp3 file? If just one, then apparently it's only thinking 1 ear has moved.
Also, I've been trying to figure out how to send messages to a different rabbit if I move my rabbits ears. I have figured that changing the serial and token to that of a different bunny in the wxBunnyFile won't work because the program will be looking for THAT bunny's ear position, not mine, am I right ? I'm guessing some in depth code editing would need to be done to be able to do this !
Actually, just a little code editing, at least for a quick and dirty method:
After the
sn=data[0][:-1]
token=data[1][:-1]
myNab = Nabaztag(sn, token)
lines of code, add:
otherSN = "put the SN for other rabbit in quotes"
otherToken = "put the token for other rabbit in quotes"
otherNab = Nabaztag(otherSN, otherToken)
then, near the end of the program, instead of myNab.say and myNab.send, use otherNab.say and otherNab.send
This creates two instances of the Nabaztag API object, one for your bunny, and one for the other. It will poll your bunny for its ear positions, and if changed, send the appropriate message(s) to the other bunny.