1
USB Infrared Toy / Searching for code examples: python IR Toy MooVee micro heli
I'm looking for help. My intention is writing python code for a MooVee Revell micro helicopter using a pc with USB-serial and the IR Toy from Dangerous Prototypes (V2.2) I want to use it in my classroom for educational purposes. I am a teacher in computer science. My learners learn to programm with python 2.7 using among others serial.py.
I managed (trial and error) to read the packages from the remote control delivered with the micro heli using the IR Toy:
Here I only list the Least significant byte of the 16 bitsvalue read by the IR Toy because the most significant byte is 0 for every reading except for byte 34:
byte 1: startbyte (always 1)
byte 2: throttle on/off (1=off 0=on)
byte 3 to 9: throttle values (0b0000000 to 0b1111110)
byte 10 to 14: left/right value (default 0b1000)
byte 14 to 18: forward/backward value (default 0b1000)
byte 18 and 19: channel A=0b01,B=0b10,C=0b11
byte 20: ?
byte 21: toggle video on/off
byte 22 and 23: ?
byte 24: trim left
byte 25: trim right
byte 26: toggle light
byte 27: toggle turbo
byte 28: take photo
byte 29: demo
byte 30 to 34: checksum (sum all bytes==1) %(mod) 16
byte 34 : total packetlength in microsec = sum(all byte-lengths of byte 1 to 34, bin(ord(least significant readbyte))*21.3333)
Hopefully I have not made to many errors so far.
For the reverse action, that is, to program code for letting the heli exercise some nice movements, I like to get some help from someone who knows how to write python. Some example code would be very nice but any advice is appreciated
gr,
Frank Westland