Skip to main content

Show Posts

This section allows you to view all Show Posts made by this member. Note that you can only see Show Posts made in areas you currently have access to.

Messages - FrankWestland

1
USB Infrared Toy / Re: Searching for code examples: python IR Toy MooVee micro
I'm making some progress. here is my output from my commandline when I send the ir toy some chars in python 2.7
Please, respond if you have any suggestions to overcome the buffer underrun after sending the last string (with length = 8 chars) in the package:
Code: [Select]
#run selftest
written hex(ord(byte)) : 1 0x56
respons byte no  1 chr(ord()):  V
respons byte no  2 chr(ord()):  2
respons byte no  3 chr(ord()):  2
respons byte no  4 chr(ord()):  2
written hex(ord(byte)) : 1 0x54
respons byte no  1 chr(ord()):  F
respons byte no  2 chr(ord()):  A
respons byte no  3 chr(ord()):  2
respons byte no  4 chr(ord()):  0
written hex(ord(byte)) : 1 0x53
respons byte no  1 chr(ord()):  S
respons byte no  2 chr(ord()):  0
respons byte no  3 chr(ord()):  1
written hex(ord(byte)) : 1 0x24
written hex(ord(byte)) : 1 0x25
written hex(ord(byte)) : 1 0x26
set the modulation frequency
written hex(ord(byte)) : 1 0x6
written hex(ord(byte)) : 1 0x4e
written hex(ord(byte)) : 1 0x0
==========================
The Packet to be send:
Amount of strings
(with length 62 chrs (except the last one is shorter and ends with 0xFF 0xFF))
to be sent:  2

Iterative part with:
written hex(ord(byte)) : 1 0x3
respons byte no  1 hex(ord()):  0x3e
send string - 0  with length:  62
respons byte no  1 hex(ord()):  0x3e
send string - 1  with length:  8
respons byte no  1 hex(ord()):  0x3e
#'t' = 0x74 for the amount of bytes send
respons byte no  1 hex(ord()):  0x74
respons byte no  2 hex(ord()):  0x0
respons byte no  3 hex(ord()):  0x46
#Here we seem to have and 'F' (for buffer underrun) instead of 'C' for succes
respons byte no  4 hex(ord()):  0x46
respons byte no  5 hex(ord()):  0xff
respons byte no  6 hex(ord()):  0xff
respons byte no  7 hex(ord()):  0xff
respons byte no  8 hex(ord()):  0xff
respons byte no  9 hex(ord()):  0xff
respons byte no  10 hex(ord()):  0xff
==========next packet===============

resetting:
written hex(ord(byte)) : 1 0x0
written hex(ord(byte)) : 1 0x0
written hex(ord(byte)) : 1 0x0
written hex(ord(byte)) : 1 0x0
written hex(ord(byte)) : 1 0x0

end


------------------
(program exited with code: 0)
Press return to continue
2
USB Infrared Toy / Searching for code examples: python IR Toy MooVee micro heli
Hello everybody,

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

( ! ) Fatal error: Uncaught exception 'Elk_Exception' with message 'Please try again. If you come back to this error screen, report the error to an administrator.' in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
( ! ) Elk_Exception: Please try again. If you come back to this error screen, report the error to an administrator. in /var/www/dangerousprototypes/forum/sources/database/Db-mysql.class.php on line 696
Call Stack
#TimeMemoryFunctionLocation
10.01342281768session_write_close ( )...(null):0
20.01372413344ElkArte\sources\subs\SessionHandler\DatabaseHandler->write( )...(null):0
30.01372414120Database_MySQL->query( ).../DatabaseHandler.php:119
40.05692552840Database_MySQL->error( ).../Db-mysql.class.php:273