I am trying to edit the PCD8544 library in order to define different pins to interface with the Nokia. This is to avoid clashing with the Ethernet shield. 5110 display.
I understand that the library typically consists of two files and the header, .h, file is the one to work on. I have seen the lines I need to change.
I opened PSC8544.h with notepad but the editing it was not a proposition. I thought I had things sorted when I opened it in Word 2000 as everything looked OK and I could edit it, but the sketch would not work with the edited file. I suspect that some hidden or format stuff has been stripped out as the file now looks no different if it is opened in NotePad.
So my questions are
is there a practical way to edit a *.h file?
failing that, does defining the pins in the sketch trump the definitions in the library?
I use KWrite with Linux, and it does great. I used WordPad with Windows because the Linux compiler version was having problems when I joined the forum. The Linux version is fine now.
Do not use Word. It puts formatting characters in the text. The compiler does not like that.
...but the sketch would not work with the edited file.
Why do you need to edit a header file to run a sketch called "Hello World"? I did not see that in the examples included with IDE v1.0.2, so I made one up.
You can also copy the library files directly into your actual sketch's folder. When you open the sketch with the Aruino IDE, they will open up in tabs. This can be the best method sometimes.
SurferTim:
Why do you need to edit a header file to run a sketch called "Hello World"? I did not see that in the examples included with IDE v1.0.2, so I made one up.
I wasn't clear enough. It was not just a sketch called hello world that I wanted to use, it was the hello world example that came with the PCD8544 library. It is the best I have found for the Nokia 5110 LCD, giving me six very readable lines of text and data.
Be that as it may, the edit works and the sketch is running, so thanks for that. It is clear that using Word or Notepad would just send you on a fool's errand, and it would never have occurred to me to use Wordpad. I think I last used it in Windows 3.0 and have never seen the point of it since. So we all learn.
Using Notepad should have worked. Of course, you haven't shown the before and after version of the file, nor much evidence for "it didn't work", so we have nothing to go in to try to help you.
You can also copy the library files directly into your actual sketch's folder. When you open the sketch with the Aruino IDE, they will open up in tabs. This can be the best method sometimes.
Thanks for your comment. Right now I have a great swag of sketches and I would rather stick with the conventional procedure. I will eventually junk about 95% of them, and then it might be time to look at a more sophisticated way of dealing with libraries, particularly as it may be a better way to do thing when on the road.
PaulS:
Using Notepad should have worked. Of course, you haven't shown the before and after version of the file, nor much evidence for "it didn't work", so we have nothing to go in to try to help you.
Everybody is telling me it should, but it doesn't. This fact is as clear as the fact that editing with Wordpad does. Of course I haven't shown you, there is nothing to show and, as I said, I thought it was OK and you won't know there is anything wrong with the .h until you try to use it. However, I guess there is a hint of the crocodiles in the billabong when you see how Notepad opens the file. I have no idea if this is normal or merely exclusive to this file, or this particular author.
However, there is a hint of the crocodiles in the billabong when you see how Notepad opens the file. I have no idea if this is normal or merely exclusive to this file, or this particular author.
It is evidence that the file was developed on a system that uses \n between records, as opposed to a system that uses \n\r (as Windows does) between records.
Notepad is a what you see is what you get editor. It does not convert \n to \n\r as Wordpad and notepad++ do. You can still use it to edit the file, although it is not as easy to find the data to change, when it looks like that.
Thank you. I have had a copy of Notepad+ for years, but the opening defaulted to the standard Windowws version. This was from that guy in Ljubljana and I guess an older version. Notepad+ opened the file OK. I will get Notepad++. I see it has colour!
I have no idea if this is normal or merely exclusive to this file, or this particular author.
That's the line wrapping we were talking about earlier.
Use wordpad or better yet, in the gcc installation, there is a programmer's notepad (hardware/tools/avr/pn): one of the best editors any programmer can hope for.