How to use a library (a kind of)

Go To Last Post
4 posts / 0 new
Author
Message
#1
  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Hello all,

First let say that I am learning C (just beginner) and I do not know how to use the WinAvr. I only use the AVRStudio.

I am making a small project, and I need a graphic LCD. The one I chose because is a serial one "Serial Graphic LCD 128x64" http://www.sparkfun.com/products... because it doesn't need too much I/O lines.

In the above page is there also the source code, including Batch files. I do not know how to use all these files and how to install in the AVRStudio, if possible.

Your help is appreciated. If I do not learn how to do it I will give up on this LCD and try to find another one with a library that I know how to use.

Thanks in advance.
Regards,
Manuel

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

It looks like the "library" is simply some functions and data in main.c. Just copy and paste them into your project and use them. Though I would recommend that you put the routines (and the data at the top that these routines use) into a separate file (and put the function prototypes into a .h file).

Regards,
Steve A.

The Board helps those that help themselves.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Maybe a README file would be helpfull in this case... Anyway, the batch files are files that you can use with AVRdude to program a specific device, so I think you can safely ignore them. You only need to care about the .c and .h files, and those two types you can add to your project as usual. The rest of the filetypes .c, .o, .hex etc are what your compiler creates after a succesful compilation. You can ignore those too, unless you use the exact model that the creator of the files used.

edit: The other zip file has a .cpp library. I think this is a C++ library and that complicates things a bit. If that's the library you are looking for, then you need help from someone who uses C++ with AVR Studio.

edit2: Take a look at the comments section on the Sparkfun page. There are some people offering their libraries. Most are Arduino based, but maybe someone is offering a gcc version too.

-Pantelis

Professor of Applied Murphology, University of W.T.F.Justhappened.

  • 1
  • 2
  • 3
  • 4
  • 5
Total votes: 0

Koshchi and Pnp,

Thanks for your inputs/ help.

I am going to order one of these GLCD and try it.

Regards,
Manuel