cancel
Showing results for 
Search instead for 
Did you mean: 

how to count the 12 bit ADC count

sumalatha
Associate II
Posted on October 03, 2010 at 11:41

how to count the 12 bit ADC count

11 REPLIES 11
Posted on May 17, 2011 at 14:09

       

WriteSerial( DBG_USART, ADC_val );

Perhaps you should convert the number into ASCII before pushing it out to the serial port?

{

  char buffer[32];

  sprintf(buffer,''%d'',ADC_val);

 

WriteSerial( DBG_USART, buffer );

}

Tips, Buy me a coffee, or three.. PayPal Venmo
Up vote any posts that you find helpful, it shows what's working..
Andrew Neil
Evangelist III
Posted on May 17, 2011 at 14:09

''Perhaps you should convert the number into ASCII before pushing it out to the serial port?''

 

Indeed!

The commented-out lines suggest that she might have been trying to do that:

       //strcat(ADC_val,'':'');

       

//sprif(ADC_val,ADC_val);

But there seem to be some basic problems there with (lack of) understanding how strings work in the 'C' programming language...?