Showing Char on the LCD
SABA
Posts: 2
Hello;
I am using "2 rows x 16 characters Non-backlit (#27976)" LCD; and connect it to CSMB12 microcontroller.
I want to show the value of one of the register to the LCD( the value of this register is contained the value of the sensor); after a value it showed me the symbol like )*;,...
it works fine till show me 14879; after that for showing for example 33765; it showed those symbol. For conversion; I used % (residue) and / (divider).
I know some where over flow is happened; but I don't know where it is exactly and how to fix it.
I appreciate your help.
of my code is necessary I can upload[noparse]:)[/noparse].
Best;
Saaba
I am using "2 rows x 16 characters Non-backlit (#27976)" LCD; and connect it to CSMB12 microcontroller.
I want to show the value of one of the register to the LCD( the value of this register is contained the value of the sensor); after a value it showed me the symbol like )*;,...
it works fine till show me 14879; after that for showing for example 33765; it showed those symbol. For conversion; I used % (residue) and / (divider).
I know some where over flow is happened; but I don't know where it is exactly and how to fix it.
I appreciate your help.
of my code is necessary I can upload[noparse]:)[/noparse].
Best;
Saaba
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Powered by enthusiasm
I pasted the related part of my code;
float atd_value2=0;
float rflex=0;
char data[noparse][[/noparse]32] ={'R '=,' ',' ',' ',' ',' ',' ',' ',' ',' ',' ',' ', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' ', ' ',' ',' ',' ',' ',' ',' ',' ',' ',' '} ;
rflex =(10000*atd_value2)/(5-atd_value2);
data =((char)(((int)rflex%10000)/1000))+'0';
data =((char)(((int)rflex%1000)/100))+'0';
data =((char)(((int)rflex%100)/10))+'0';
data[noparse][[/noparse]6] =((char)(((int)rflex%10)))+'0';
sendDataToSCI(data,32);
//here I have my function sendDataToSCI
rflex has 5digit; the way that I converted it was shown in the copied codes above. I do not have problem till 15000 value after that it showed me symbols!
Thanks;