Hallo

int Ref = 5 / 1023; //5V / 8 Bit
int Volt = 0;

sind doch alles ganzzahlige Variablen. Versuch doch mal float.

MFG