lcd screen code problem

Discussion in 'Programmer's Corner' started by raw_653, Feb 9, 2012.

  1. raw_653

    Thread Starter New Member

    Feb 3, 2012
    10
    0
    hi all :)

    i wrote a code that is supposed to print the following on the screen
    cars number=0
    money=0
    but when i run it i get
    cars number=
    money= 0

    any solutions ?

    the code
    int i=0;
    int x=0;

    char itxt[16];
    char xtxt[16];

    void screen ()
    {inttostr(x,xtxt);
    inttostr(i,itxt);
    Lcd_out(1,1,"cars number=");
    Lcd_out_cp(itxt);
    Lcd_out(2,1,"Money=");
    Lcd_out_cp(xtxt);
    }


    thanks :)
     
  2. spinnaker

    AAC Fanatic!

    Oct 29, 2009
    4,887
    1,016
    You are going to have to post your code for Lcdout_cp if you want someone to help. And use the code tags when posting code.

    Code ( (Unknown Language)):
    1.  
    2. void screen ()
    3. {inttostr(x,xtxt);
    4. inttostr(i,itxt);
    5. Lcd_out(1,1,"cars number=");
    6. Lcd_out_cp(itxt);
    7. Lcd_out(2,1,"Money=");
    8. Lcd_out_cp(xtxt);
    9. }
    10.  
    [​IMG]
     
  3. raw_653

    Thread Starter New Member

    Feb 3, 2012
    10
    0
    which code ?
     
  4. spinnaker

    AAC Fanatic!

    Oct 29, 2009
    4,887
    1,016
    I think I already mentioned it.

    "You are going to have to post your code for Lcdout_cp if you want someone to help. And use the code tags when posting code."
     
  5. raw_653

    Thread Starter New Member

    Feb 3, 2012
    10
    0
    this is the code (on mikroc)

    :)
     
  6. spinnaker

    AAC Fanatic!

    Oct 29, 2009
    4,887
    1,016
    What??????
     
  7. raw_653

    Thread Starter New Member

    Feb 3, 2012
    10
    0
    this the code that is responsible for the data output on the lcd screen
     
  8. spinnaker

    AAC Fanatic!

    Oct 29, 2009
    4,887
    1,016
  9. raw_653

    Thread Starter New Member

    Feb 3, 2012
    10
    0
    the result when replacing the two calls

    cars number=1
    money=2
     
  10. spinnaker

    AAC Fanatic!

    Oct 29, 2009
    4,887
    1,016
    Did you look closely at the link to the IntToStr documentation I posted? What differences did you see?

    If you did not look at it then why not? You need to put some effort into this too.
     
  11. raw_653

    Thread Starter New Member

    Feb 3, 2012
    10
    0
    i did and i couldn`t find any difference but nvm I am working on another code now

    thanks:)
     
  12. spinnaker

    AAC Fanatic!

    Oct 29, 2009
    4,887
    1,016
    Then you did not look close enough

    What is documented: IntToStr
    What you have : inttostr

    You don't see any differences?
     
Loading...