Hi
I have a sketch using arduino uno and smartGPU2 LCD screen.
I need to use software serial at pin 12 and 13, rather than the hardware serial pins (0 and 1).
the smartGPU uses a library (it is in attachment), this library use pin 0 and 1 as Tx and Rx
I cant change the library to use software serial, can any one help me please by doing any needed changes on the library file??
or can you guide me on how to add the software serial?
here is the part I think it needs changing in the .h file
#define SERIALPORT (Serial) //Define the connected serial
and here the method in the library file
//Sends a single character through the serial port(USART)
void putcharTX(char data){
SERIALPORT.write(data);
}
//Returns a single character obtained from the serial port(USART)
char getcharRX(){
while(SERIALPORT.available() == 0);
return SERIALPORT.read();
}
What that #define does is to cause all instances of SERIALPORT in the source code to be replaced with (Serial) so it would be worth a try to create an instance of SoftwareSerial called mySerial and change the #define to
#define SERIALPORT mySerial
Note that I have left the brackets off as I believe that they are not necessary but try it for yourself as you have nothing to lose.
SMARTGPU2\SMARTGPU2.cpp.o: In function `__static_initialization_and_destruction_0':
C:\Program Files (x86)\Arduino\libraries\SMARTGPU2/SMARTGPU2.cpp:1420: multiple definition of `mySerial'
index.cpp.o:(.bss.mySerial+0x0): first defined here