Use a function to convert float to unsigned byte