Fix the library to support both arduino and mbed version