int n=map(posr, 0,1023,1000,2000);Won't work unless posr can hold a value of 1023, which a byte can't
int n=map(posr, 0,1023,1000,2000);