I have some sample code and the person who wrote the sketch actually has both in the same line in places. It would seem you would stick to one or the other. Is there are reason why there are 2 ways to do what seems to be the exact same thing? Am I missing something? Thanks
The only reference to putstring within an Arduino context I could find was for the Waveshield library.
Without seeing any of this sample code you refer to, I can't say for sure, but it sounds like the sample code is simply sending a string to the WaveShield AND out the Serial port, likely for either debugging or information purposes (or both).
For future reference, it's easier to provide answers and assistance when the code in question is provided as well.
puts or putstring sounds like a C standard I/O function. Since arduino has no standard output device (the screen), someone may have to implement it to treat serial as standard output device. I don't quite know how to do that. Does the code have a function definition of this putstring? maybe it is just a function the person wrote.
This reply is just in case someone else has this question, and finds this thread.
I too had this question, and found this thread via Google. I wasn't satisfied, so I kept looking, and found the answer: it's a simple renaming via #define.
If you notice, there are two header files used by the examples that come with the WaveHC library: WaveHC.h and WaveUtil.h. Open up WaveUtil.h and you'll see that the first #define is:
#define putstring(x) SerialPrint_P(PSTR(x))
Followed by:
#define putstring_nl(x) SerialPrintln_P(PSTR(x))
So it looks like Ladyada just prefers to use this syntax, and defined it to make it so. I'm not sure why, maybe it's easier for her to type it in that way, but anyways, the answer then is putstring is the same as SerialPrint.
Hope this puts it to bed :).