if boot and try it on linux (ubuntu 12.04 64bit), it compile, upload but results are odd:
Are you using the Ubuntu repository version? I had some issues with that version. I use Ubuntu 12.04 32 bit and the IDE v1.0.1 downloaded from the Arduino site. Unpack it into a local directory. Run the arduino shell script in that directory to run the arduino site version.