Arduino Software PWM library adapted for Spark