The Gimp is not the only graphical package to have support for Python. Blender, Dia, Scribus and Maya are a few of them. I will probably cover a few of those in the future.
"For anyone who works in a company that has an office in a EU Community member state, we need your help."
So if you work for a company who uses Python, in Europe, do follow the link above and read up about how a company is trying to hijack the Python name, and what you can do to help.
François @f_dion
So, before we get started in writing some python (such as the code I put here: minecraft python ), let's check out block.py in the mcpi/api/python/mcpi directory. It contains the types of materials that can be used:
$ lsusb Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub Bus 001 Device 002: ID 0424:9512 Standard Microsystems Corp. Bus 001 Device 003: ID 0424:ec00 Standard Microsystems Corp. Bus 001 Device 004: ID 08bb:2704 Texas Instruments Japan
mpg123, aplay et d'autres lecteurs audio qui utilisent ALSA vont fonctionner avec la carte, mais il faut effectuer un changement a un fichier de configuration:
$ sudo vi /etc/modprobe.d/alsa-base.conf
et sur la derniere ligne, on change le -2 par un 1:
options snd-usb-audio index=-2
devient options snd-usb-audio index=0 nrpacks=1
et on reboot.
Am I throwing together random words for titles now, in a weird captcha induced moment? No, just condensing my interest in lasers in a few words.
You might have seen the laser digitizer in Tron: Legacy
However, in my case, what triggered my interest in laser, was the original Tron laser digitizer
A few years later, I had the chance to play with a good old HeNe red laser, pumping a mighty 5mW (well, in the 80s, it was impressive) in the college lab. One of the things I did with it was to draw Lissajous figures (or curves) on a wall (a large wall outside, at night - even cooler), using two little speakers and mirrors I had brought (the lab was set up to only do prism and mirror experiments).
Googling, I see a nearby school (Appalachian State) has one such kit in their physics dept:
http://www1.appstate.edu/dept/physics/demos2/oscillations/3a80_40.html
Anyway, fun stuff, making math and physics a lot more interesting...
Electronica
There was the artistic connection that also further fueled my interest in lasers. There is a lot to talk about here, since I've composed and performed electronic music for many years (still write some) and hosted a radio show for about 10 years etc, so that'll be for another time.
I will bring up one point right now though: you cant talk about lasers in music shows, without mentioning Jean Michel Jarre.
Jean Michel Jarre, Houston TX 1986
From his incredible live outdoor shows with lasers, lights and fireworks (one, a tribute to oceanographer Cousteau, had an attendance of over 2 million people in France in 1990) to his laser harp. Jarre without lasers wouldn't be the same.
On the road
The Raspberry Pi has a lot of appeal by itself, but I figured that it would probably be a good idea to add a laser in the mix. Since I had a presentation at PyCarolinas, I figured I'd write a script with Python (laserpulse.py, hence the title of this article) and build a little rig to project interesting patterns on the wall behind me.
So, using a laser in presentations, does it work? Well, at PyCarolinas, I got a lot of feedback on this, both during the presentation, after the presentation and even during other talks (heard during another talk "so we've learned today that lasers are cool")
In the audience: "I just want to say that this is the coolest command, ever."
And so on and so forth. The conclusion is this: Science needs some showmanship. But please, be careful when playing with lasers!
Video
So I'll leave you with a video of my little rig above controlled by the Raspberry Pi, going to the music of a very British band, doing a cover of the theme of a very British TV show. Very apropos, since the Raspberry Pi is a very British computer, afterall.
Youtube video (Music by Orbital, Doctor? live at BBC)
Pour ce faire, il faut un lecteur de carte SD, car le Pi n'a qu'une seule fente SD. Un lecteur comme celui ci, par exemple (ici, avec une carte 16GB, mais on peut faire 4GB ou 8GB ou plus, de la même façon):
Et on le branche (avec un câble ou en direct) au port USB.
Avant de commencer, il faut s'assurer d'avoir au moins 2.5GB de libre (df -h me donne 2.9G ici). On insere la carte SD vide dans le lecteur et on verra apparaitre /dev/sda ou sdb.
fdion@raspberrypi ~ $ df -h
Filesystem Size Used Avail Use% Mounted on
rootfs 15G 11G 2.9G 80% /
/dev/root 15G 11G 2.9G 80% /
devtmpfs 109M 0 109M 0% /dev
tmpfs 22M 248K 22M 2% /run
tmpfs 5.0M 0 5.0M 0% /run/lock
tmpfs 44M 0 44M 0% /run/shm
/dev/mmcblk0p1 56M 35M 22M 62% /boot
fdion@raspberrypi ~ $ wget http://www.gtlib.gatech.edu/pub/raspberrypi/images/raspbian/2012-09-18-wheezy-raspbian/2012-09-18-wheezy-raspbian.zip
fdion@raspberrypi ~ $ unzip 2012-09-18-wheezy-raspbian.zip
fdion@raspberrypi ~ $ ls /dev/sd*
ls: cannot access /dev/sd*: No such file or directory
fdion@raspberrypi ~ $ ls /dev/sd*
ls: cannot access /dev/sd*: No such file or directory
fdion@raspberrypi ~ $ ls /dev/sd*
/dev/sda /dev/sda1
fdion@raspberrypi ~ $ ls *.img
2012-09-18-wheezy-raspbian.img
Ici, le lecteur de carte avec SD est /dev/sda (si c'est sdb, il faut ajuster la commande ci dessous avec of=/dev/sdb). On est pret a faire la copie de l'image de la carte SD (le fichier .img), a partir du Pi (on peut aussi utiliserbs=4Mqui va beaucoup plus vite avec certaines cartes):
fdion@raspberrypi ~ $ sudo dd bs=1M if=2012-09-18-wheezy-raspbian.img of=/dev/sda
1850+0 records in
1850+0 records out
1939865600 bytes (1.9 GB) copied, 428.218 s, 4.5 MB/s
fdion@raspberrypi ~ $ sudo sync
Le sudo sync est très important. Si on ne le fait pas, ça ne fonctionnera pas.
Et c'est tout! On peut maintenant donner cette copie a une autre personne. Tres pratique pour les clubs.
One thing you will notice is that the circles have a kink on each sides (at the interface of each quadrant). With time, it appears that the compensation factor for the slop has to be adjusted. I've demoed this so much that I guess there is a little less slop than there was before. That is quite curious. It also means that I will have to add a calibration mode, perhaps a little jumper or switch, and when the Pi boots, it will run the calibration mode instead of the drawing mode.