Defining Serials


I'm trying to give my serial connections a name, so its easier for me to work with the code..

Assume I have a GPS connected to my Serial1 on Mega. I'm using this code to define the name

define GPS Serial1

When I later on use GPS.available() (an example) I get an error: 'Serial1' was not declared in this scope

The same happens to the devices connected to Serial2 and Serial3. Only using #define GPS Serial works fine..

Maybe I'm making a stupid mistake, but can someone help?


Sounds like you have the wrong board selected in the IDE

It was indeed a stupid mistake. Thanks for reply