I am new to programming in C and want to know how to:
convert an analogue voltage from 0 to 5V to display in 0.1 steps to give 50 possible outputs to two 7seg displays.
The A/D converter is 10 bit so the analogue value of:
0V would be from 0 to 20.47
0.1 = 20.48 to 40.96 etc
I guess it would be possible to have 50 if statements to output the 7seg values but I something about a lookup table is quicker but I'm sure how this is done.
Can someone explain this to me and maybe give some code?
convert an analogue voltage from 0 to 5V to display in 0.1 steps to give 50 possible outputs to two 7seg displays.
The A/D converter is 10 bit so the analogue value of:
0V would be from 0 to 20.47
0.1 = 20.48 to 40.96 etc
I guess it would be possible to have 50 if statements to output the 7seg values but I something about a lookup table is quicker but I'm sure how this is done.
Can someone explain this to me and maybe give some code?