maybe check what they did here: https://github.com/airgradienthq/arduino/blob/master/AirGradient.cpp