modified nimbits library for arduino based on the official one