Go Down

Topic: Softserial problem / using uart possible? (Read 1 time) previous topic - next topic

Matze2211

Hello,
I'm using the GSM-Shield and I want to ask for using another serial port.
With an Uno or Mini Pro everything is working but if I want to use my Mega I've got the problem that I get his error-message:
I want to use UART 2.

C:\Program Files (x86)\Arduino\libraries\GSM\GSM3CircularBuffer.cpp: In member function 'void GSM3CircularBuffer::debugBuffer()':
C:\Program Files (x86)\Arduino\libraries\GSM\GSM3CircularBuffer.cpp:269:2: error: 'Serial' was not declared in this scope
C:\Program Files (x86)\Arduino\libraries\GSM\GSM3CircularBuffer.cpp: In static member function 'static void GSM3CircularBuffer::printCharDebug(uint8_t)':
C:\Program Files (x86)\Arduino\libraries\GSM\GSM3CircularBuffer.cpp:282:3: error: 'Serial' was not declared in this scope
C:\Program Files (x86)\Arduino\libraries\GSM\GSM3CircularBuffer.cpp:285:3: error: 'Serial' was not declared in this scope

How can I use another seriell port than the softserial?

Thanks a lot!

Matze2211

I found in GSM2ShieldV1.cpp this text:

#include <GSM3ShieldV1.h>
#include <HardwareSerial.h>

How can I use it???

davidgoth

If I can remember, Mega has three Serials, Serial1, Serial2 and Serial3. Replace Serial with Serial1, Serial2 or Serial3.

CrossRoads

Mega has 4 serial ports: Serial, Serial1, Serial2 and Serial3.

You initialize them all the same:
Serial.begin(9600);
Serial1.begin(9600);
Serial2.begin(9600);
Serial3.begin(9600);

Subbing them straight in to a library written to support  a software serial implementation may require some other tweaking as well.
Designing & building electrical circuits for over 25 years.  Screw Shield for Mega/Due/Uno,  Bobuino with ATMega1284P, & other '328P & '1284P creations & offerings at  my website.

Go Up