Hi guys,
I have a situation on my C programming here and just wondering whether my solution is the correct way:
I have a LED display with particle count sensor and will show 6 digit of seven segment numbers as the count value. The sensor will give voltage input value. The input is from 0V to 10V. So the range of 0V-10V need to be shown in the display as 000000 to 999999 count.
My solution is:
Display number = Input voltage * 99999.9
For example:
Display number = 10.000*99999.9=999999
Display number = 5.500*99999.9=549999
Display number = 2.300*99999.9=229999
Is this the correct solution? I notice that I will get a lot of 9 on the display value.
Display number = 10.000*99999.9=999999;
Display number = 5.500*99999.9=549999;
Display number = 2.300*99999.9=229999;
What you want to do with this logic?If i understand correctly if your input voltage is 10 v you want to display as 10.0000 v then why you multiplying it with 99999.9?what is final display value i mean how many decimal point value to be display ?
Display number = 10.000*99999.9=999999;
Display number = 5.500*99999.9=549999;
Display number = 2.300*99999.9=229999;
What you want to do with this logic?If i understand correctly if your input voltage is 10 v you want to display as 10.0000 v then why you multiplying it with 99999.9?what is final display value i mean how many decimal point value to be display ?
this logic working and reason for getting many 9 is your input voltage reading for example if you can read your input voltage=5.5495 then your output 554949 so i don't know your adc bit resolution if you can read voltage with micro voltage accuracy then this logic work with less 9 or accurately.
this logic working and reason for getting many 9 is your input voltage reading for example if you can read your input voltage=5.5495 then your output 554949 so i don't know your adc bit resolution if you can read voltage with micro voltage accuracy then this logic work with less 9 or accurately.