[SOLVED] ADC conversion problem

Status
Not open for further replies.

Sambarta

Newbie level 2
Joined
Mar 27, 2016
Messages
2
Helped
0
Reputation
0
Reaction score
0
Trophy points
1
Activity points
50
Sir, I am seeing that in this program he has done

Code:
 void convert()     
{
   int    s;
    lcd_cmd(0x81);      
    delay(2);
    lcd_data_string("TEMP:");
    test_final=(((9*test_intermediate3)/5)+32);
    s=test_final/100;
    test_final=test_final%100;
    lcd_cmd(0x88);
    if(s!=0)
    [COLOR=#008000]lcd_data(s+48);[/COLOR]
    else
    lcd_cmd(0x06);
    s=test_final/10;
    test_final=test_final%10;
    lcd_data(s+48);
    lcd_data(test_final+48);
    lcd_data(0);
    lcd_data('F');
    lcd_data(' ');

    test_final=test_intermediate3;
    lcd_cmd(0xc1);        //Setting  cursor to first position of first line
    delay(2);
    lcd_data_string("TEMP:");
    s=test_final/100;
    test_final=test_final%100;
    lcd_cmd(0xc8);
    if(s!=0)[B][COLOR=#0000FF]
    lcd_data(s+48);[/COLOR][/B]
    else
    lcd_cmd(0x06);
    s=test_final/10;
    test_final=test_final%10;
    lcd_data(s+48);
    lcd_data(test_final+48);
    lcd_data(0);
    lcd_data('c');
    lcd_data(' ');
    delay(2);
I cannot understand s+48,test_final+48. Can you explain.
 
Last edited by a moderator:

Hi,

Your problem has nothing to do with ADC conversion.

As far as i can see the +48 forms a 0..9 binary value to '0' ...'9' ASCII values.

Klaus
 

Status
Not open for further replies.

Similar threads

Cookies are required to use this site. You must accept them to continue using the site. Learn more…