Skip to content

Serial1 or Serial2 in external library reference #407

Closed
@hicotton02

Description

@hicotton02

This very well could be from lack of programming skills, but I am having an issue. In another Arduino Library, there is reference to Serial2

#define mySerial Serial2

but in the esp32 code, there is no reference to such serial. if, in my sketch, I declare

HardwareSerial Serial2(2);

I get this error:

error: 'Serial2' was not declared in this scope (from their h and cpp files)

if I try to manually declare it in their library, I either get the same error, or "redefinition of Serial2". They have this:

#include "Arduino.h"

should I change that to something else? Basically my question is "How do deal with external libraries that reference another serial port (either hardware or software) other than "Serial"?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions