*solves* map() in hang up for some seconds the uC/little Stuck Overflow - Why?

Two to five seconds smells like a reboot. It could be rebooting on a voltage droop when the resistance is low. If you put a Serial.println('Here i am"); in the setup() you'll quickly find out if it's restarting.

-br