Fix for higher resolutions
License, requested by Habbie :)
Arduino 1.0 compatibility
Special case, for hi=254, with hard coded values suited for LDR.