Shop OBEX P1 Docs P2 Docs Learn Events
Showing Char on the LCD — Parallax Forums

Showing Char on the LCD

SABASABA Posts: 2
edited 2009-12-18 05:57 in Accessories
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

Comments

  • SRLMSRLM Posts: 5,045
    edited 2009-12-18 03:57
    You'll need to consult the manual to the microcontroller. The LCD takes a serial string at various speeds (2400, 9600, 19200). Your best bet would be to figure out how to send a simple string or number that is predefined ("hello world!" comes to mind), then try and have it send the value of the register. In general, forum members here focus on Parallax microcontrollers, and little if any support is available for other uCs. Still, if you paste in your code somebody may be able to spot the problem.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Powered by enthusiasm
  • SABASABA Posts: 2
    edited 2009-12-18 05:57
    i tried to fix this problem based on data sheet; and also contact with freescale;but no helpful.
    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;
Sign In or Register to comment.