but also put the library in the same folder as the sketch and in the sketch use #include "LINSerial.h".
however from the arduino output, it was somehow still using hardwareserial library
If anyone ever did something similar (ie use a modified hardware serial lib) without overwriting the original, if they could share their sketch for me to test it would be much appreciated.
That means a differ name for the folder it is in and all the files in it and the call to include the .h file in the .cpp file, and the word highlight file.
Give the whole class a different name, and remove all double #define statements ! there might be a few more things you need to do. It should be possible to redefine the functions since they are declared weak. It is all a little bit above me though, but considering that you probably will never use both the original and the altered version in same sketch you could have 2 versions of the IDE on your computer one with the altered hwSerial and one with the original. (that was my solution and that works with ease of use) Hey but how about you post the other Serial Lib and see if anyone can make it work.
Also have a look at the 'Conceptinetics' DMX library, in there it is done in a very elegant way as well, you can on a 'Mega' run the DMX from 1 Serial port and use the others as normal.
Deva_Rishi:
Also have a look at the 'Conceptinetics' DMX library, in there it is done in a very elegant way as well, you can on a 'Mega' run the DMX from 1 Serial port and use the others as normal.
Thanks! I'll have a look.
Grumpy_Mike:
That means a differ name for the folder it is in and all the files in it and the call to include the .h file in the .cpp file, and the word highlight file.
I have done it many times and it does work.
Oh I'm sure it can be done! just me doing something wrong here... hence my request in my last post to SHARE an example to compare with
I have modified libraries in the past and if you put that new directory in your libraries folder, the IDE will use that instead of the build-in one. It will inform you of the choices it is making. This allows the modified library to be used by throughout your entire project, including other libraries.
blh64:
I have modified libraries in the past and if you put that new directory in your libraries folder, the IDE will use that instead of the build-in one. It will inform you of the choices it is making. This allows the modified library to be used by throughout your entire project, including other libraries.
Deva_Rishi:
does that work with 'core' libraries as well ?
The Wire library comes with the IDE - does that count as core? If so, then the answer is yes. If not, then the answer is no. Give it a try and the IDE will tell you which libraries it is using during linking.
blh64:
I have modified libraries in the past and if you put that new directory in your libraries folder, the IDE will use that instead of the build-in one. It will inform you of the choices it is making. This allows the modified library to be used by throughout your entire project, including other libraries.
In my case it was the i2c (wire) library
Deva_Rishi:
does that work with 'core' libraries as well ?