Working code using Adafruit library.