Added completed code from Arduino IDE