Improved calibration routine

Made calibration routine more robust so it would run without problems on both the Teensy 3.1 and the Pro Mini.

I've had trouble with code compatibility between the Teensy 3.1 and the Pro Mini having to do with my sometimes sloppy treatment of integer types. I made the calibration routine more robust in this regard and it nows gives the same calibration results for both processors.

I hope my constant fiddling with this library is not causing you trouble!