Updated for Arduino 1.0+