| ??? 11/20/02 12:08 Read: times |
#32819 - RE: How to display value read from ADC |
Here's some code that will convert a 16bit INT into individual characters
void calc_16(unsigned int value){ unsigned char temp1,temp2,temp3,temp4,temp5; temp1=value%10; value/=10; temp2=value%10; value /=10; temp3=value%10; value /=10; temp4=value%10; value /=10; temp5=value%10; k0=temp1 + 0x30; k1=temp2 + 0x30; k2=temp3 + 0x30; k3=temp4 + 0x30; k4=temp5 + 0x30; } Have a play , You can work out for yourself which is the MSB (K0 -K4 are external variable to the routine , and can be fed to an LCD etc..) |
| Topic | Author | Date |
| How to display value read from ADC | 01/01/70 00:00 | |
| RE: How to display value read from ADC | 01/01/70 00:00 | |
| RE: How to display value read from ADC | 01/01/70 00:00 | |
| RE: How to display value read from ADC | 01/01/70 00:00 | |
| RE: How to display value read from ADC | 01/01/70 00:00 | |
| RE: How to display value read from ADC | 01/01/70 00:00 | |
| RE: How to display value read from ADC | 01/01/70 00:00 | |
RE: How to display value read from ADC | 01/01/70 00:00 |



