Rotating cubes.

Standard

A couple of days ago I got 3 LIS3LV02DQ accelerometers from Sparkfun electronics.
Today I finished a working demo showing a cube that rotates as you rotate the device.
This accelerometer has some good documentation to learn how to use it. There is also a post in some blog with a specific example for the arduino.
That example didn’t work for me, but when I wasn’t sure about something, it did help to take a peek at it. Reading the datasheet carefully is extremely important.
The arduino has built-in SPI support, which helps a lot since the accelerometer uses SPI (or I^2C) to communicate. However, it is bound to 4 specific pins in the board, and if I’m going to use the 3 accelerometers at the same time without any additional hardware, I am going to have to write a software implementation, since I would be using 12 pins.
The interface to the arduino was written in C++. It uses libSerial, which makes communicating with the arduino almost as trivial as when using Python.


SFCave clone update

Standard

Last night I didn’t sleep since I was at a lan party, so I made a lot of mistakes this morning while working on my little game. I wrote some sprite code to show smoke, after creating a sprite doing some photo-editing in gimp. Then I made a separate display list for the tunnel obstacles so they can cast shadows on the tunnel.
I think it is looking really cool now, so I uploaded a video to YouTube, here it is:

http://www.youtube.com/v/RRrAkE2VQYA&hl=en&fs=1

I am still going to put the video on pyCave’s website.