Arduino UNO only works with usb cable

int sure=0;
int mesafe=0;
 }

It doesn't seem sensible to define variables you never use, just before they go out of scope.
The globals with the same names are automatically zeroed before setup() executes.