Hi,
If you divide by 1024 you are in effect going to get a number less than 1 and so it goes to zero. This is because you have an integer division.
So convert or cast to float before the division or find an integer way of expressing what you want to do.