Arduino hangs mid code and then resets or just gets stuck