updated version by DFROBOT for use with the Arduino 1.0 IDE