Hi all hope everyone keeps well.
I am back with another of these annoying newbies questions. I am going arround the ADC modul and i have some basic understandin problems.
After function has read the analog input, puts the binary result on the High and Low address registers which is in binary. Up to here i think i am good understanding. After we assign the binary result to an integer variable through the following: digital = ((ADRESH << 8) + ADRESL); and we return to main. There we assign to a float variable voltage as follows:
voltage= digital*((float)vref/(float)1023); and then we make a sprintf to be able to write on LCD.
From the point ADC puts the results on the address registers and after i am lost. If the binary number lets say is 0011.1(3.5v) when we assign to integer digital is not after like 3. And then the whole calculation line isn't wrong [voltage= digital*((float)vref/(float)1023);]. I am loosing something
.
All this i am asking because i don't want to use sprintf is killing my memory. I wanted to try to write code to make this instead but if i don't know what i have to convert is no meanning. I check the internet a lot about but 99.9% of the tutorials is with sprintf the easier one
.
I don't know if there is any help to post a code for the question or the pic i use. In case is needed asked to do so.
Thanks all for reading i hope you can help me
I am back with another of these annoying newbies questions. I am going arround the ADC modul and i have some basic understandin problems.
After function has read the analog input, puts the binary result on the High and Low address registers which is in binary. Up to here i think i am good understanding. After we assign the binary result to an integer variable through the following: digital = ((ADRESH << 8) + ADRESL); and we return to main. There we assign to a float variable voltage as follows:
voltage= digital*((float)vref/(float)1023); and then we make a sprintf to be able to write on LCD.
From the point ADC puts the results on the address registers and after i am lost. If the binary number lets say is 0011.1(3.5v) when we assign to integer digital is not after like 3. And then the whole calculation line isn't wrong [voltage= digital*((float)vref/(float)1023);]. I am loosing something
All this i am asking because i don't want to use sprintf is killing my memory. I wanted to try to write code to make this instead but if i don't know what i have to convert is no meanning. I check the internet a lot about but 99.9% of the tutorials is with sprintf the easier one
I don't know if there is any help to post a code for the question or the pic i use. In case is needed asked to do so.
Thanks all for reading i hope you can help me