View previous topic :: View next topic |
Author |
Message |
exodia505
Joined: 07 Feb 2012 Posts: 34
|
How to create a header file for images |
Posted: Sun Mar 25, 2012 11:24 am |
|
|
hello guys !
I'm using more than 5 images (pic18f452+GLCD (ks0108) 128x64)
and when i declare them in my code I don't feel comfortable, so I would like to know how to put them in a header file and use #include to call them !! thanks _________________ NOway!! |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sun Mar 25, 2012 12:53 pm |
|
|
Just make a new file. Every IDE (CCS or MPLAB) has a file menu option
called File / New. It make a new file. Then copy and paste your arrays
into that file. Delete them from the old file. Then save the new file as
images.h or some suitable name. Save it in the same directory as your
main project file. Then edit your main source file and put in an #include
statement for images.h, like this:
Code: |
#include <18F452.h>
#fuses XT,NOWDT,PUT,BROWNOUT,NOLVP
#use delay(clock=4M)
#use rs232(baud=9600, xmit=PIN_C6, rcv=PIN_C7, ERRORS)
#include "images.h"
//======================================
void main(void)
{
while(1);
} |
|
|
|
exodia505
Joined: 07 Feb 2012 Posts: 34
|
|
Posted: Sun Mar 25, 2012 1:27 pm |
|
|
Thanks, is it the same if want to move my procedures or functions that I've created too? _________________ NOway!! |
|
|
PCM programmer
Joined: 06 Sep 2003 Posts: 21708
|
|
Posted: Sun Mar 25, 2012 4:59 pm |
|
|
Yes, do it the same way. |
|
|
|