mx: mx = x if y > my: my = y if output: i.save(output) else: i.show()[/python] Use it with a "dump" as argument, and optionnaly an output filename. If no filename is given, the result will be shown (Windowing system needed, of course). The only dependency is PIL (python-imaging). Image boundaries are somehow empiric. I tried to use different levels of gray for different kind of events : "real" touches are whitest, "close" touches are grey, and if there's anything else it should be an even darker shade of gray. And here is an idea of the output. I know it's ugly, but the code has nothing to do with it. permalink: http://dustinthe.net/?p=240" /> mx: mx = x if y > my: my = y if output: i.save(output) else: i.show()[/python] Use it with a "dump" as argument, and optionnaly an output filename. If no filename is given, the result will be shown (Windowing system needed, of course). The only dependency is PIL (python-imaging). Image boundaries are somehow empiric. I tried to use different levels of gray for different kind of events : "real" touches are whitest, "close" touches are grey, and if there's anything else it should be an even darker shade of gray. And here is an idea of the output. I know it's ugly, but the code has nothing to do with it. permalink: http://dustinthe.net/?p=240" /> mx: mx = x if y > my: my = y if output: i.save(output) else: i.show()[/python] Use it with a "dump" as argument, and optionnaly an output filename. If no filename is given, the result will be shown (Windowing system needed, of course). The only dependency is PIL (python-imaging). Image boundaries are somehow empiric. I tried to use different levels of gray for different kind of events : "real" touches are whitest, "close" touches are grey, and if there's anything else it should be an even darker shade of gray. And here is an idea of the output. I know it's ugly, but the code has nothing to do with it. permalink: http://dustinthe.net/?p=240" />
Olivier Migeot
6 ans auparavant

Boogie Board RIP : some more experiments

Ok, so I tried some more things, and managed to get a picture directly from the USB port. Let's see!

First I dumped a whole lot of events from hidraw. In my case, I did it through

\[code\]sudo cat /dev/hidraw3 | hexdump > boogie.dat\[/code\]

Calling hexdump without arguments gives us an interesting display, with some lines being just '*'. But most interesting is that bytes have a more natural order. So I wrote a little Python script that takes the given dump, and tries to convert it to something "pretty".

It should be self explaining, and it's supposed to evolve. But if someone wants to try it, feel free.


[python]from PIL import Image
import sys

sx = 705
sy = 999

if len(sys.argv) < 2:
print "Usage: boogie.py [output filename]"
sys.exit(-1)

if len(sys.argv) == 3:
output = sys.argv
[2]else:
output = None

f = open(sys.argv[1],'r')
i = Image.new('P',(sx,sy)... montrer plus
Signaler un bug