You might want to use one of the legacy Arduino IDEs. If you download Arduino-0021 and put the sketch into it, it should save you a lot of work.
Arduino-1.0 and 1.0.1 absorbed quite a few wiring libraries, so you will need to use the arduino.h library and re-work the legacy sketch to bring it up to "code" ![]()