Comments: Serial Graphic LCD Hookup

Pages

Comments 12 comments

  • I know there are probably more sophiscated ways of doing this but….. I assemble an array of data as follows:

    for(i=0;i<GPS_buffsz;i++)
         {
         GPS_buffer[i]=GPS.read();
          }
    

    Which leaves me with an array of ascii (I think).

    Now I want to display some of the data on the LCD…like

    LCD.printStr(GPS_buffer[45]);
    

    What I get on the display is 48 which is the ascii code for 0. What I want to display is the 0. So I suppose I have some kind of types thing going on but think the only choices for the LCD are printStr and printNum. Print num complaims about a conversion to char* which I dont understand yet but may be right way to go about it?

    • You’ll need to add another function(s) to the library to print other characters. Just copy the printNum function, and modify as needed. If you add some functions that you think should make it into the master, please feel free to make a pull request on GitHub.

  • Is there a printNum() equlivant for printing unsigned int?

    • There is not, but it should be pretty easy to add a function to the library that does what you need. Just copy the printNum function, and modify as needed.

  • Trying to compile SerialGraphicLCDDemo but when hit following line :

    LCD LCD;

    get a bunch of errors complaining “LCD was not declared in this scope”. Think I installed the libary correctly but who knows?

    • Open Arduino. Go to File -> Examples. If the library shows up on this list, you installed the library correctly.

      • Did that, which is how I opened SerialgraphicLCDDemo in the first place. But it won’t compile .

        • Which version of the Arduino IDE are you using?

            • There is Arduino 1.0.5 and Arduino 1.5.6r2. I’ve pulled the latest version of the library from GitHub and tried it on both versions on my Mac. They both compile fine right out of the box. Make sure you don’t have any extra folders in your library structure. If you continue to have difficulties, please contact our technical support team for help.


If you've found a bug or have other constructive feedback for our tutorial authors, please send us your feedback!