The function does not work in ESP8266

I agree with @MicroBahner and you can see in #8 how it would be changed