I think this is wrong.
int results = map(raw,0,1096,0,500); // scale voltage to 0-500
I think it should be
int results = map(raw,0,1023,0,500); // scale voltage to 0-500
I think this is wrong.
int results = map(raw,0,1096,0,500); // scale voltage to 0-500
I think it should be
int results = map(raw,0,1023,0,500); // scale voltage to 0-500