HardwareSerial.h - Practical Examples

I'm trying to work out how to use this library.

The example on the GitHub for this library

[xbox_chatpad_library/examples/Example_1/Example_1.ino at master · vitormhenrique/xbox_chatpad_library · GitHub]

Shows a call to Serial1.

But when compiling I get the following error.

....\HardwareSerial1.cpp:61:74: error: expected primary-expression before ')' token
HardwareSerial Serial1(&UBRR1H, &UBRR1L, &UCSR1A, &UCSR1B, &UCSR1C, &UDR1);

I have not modified the code at all, so I am wondering if it needs some extra config file or something, I've read the documentation, but its not jumping out as to what I need. I will find it but I thought someone here may have some real world working examples of it being used other than this one.

Thanks.
^

Did the libary fits to the Arduino selected.

Hi Paul,

Thanks for your reply, i'm not entirely sure where this is set ?

I am using a Nano

In this case use the libary SoftwareSerial.h simply.

I think the references to "arduino or teensy" on the github page imply that the software is only likely to work with boards that have at least two "serial" ports (ie Teensy, Leonardo, Arduino Micro, etc.) (One HardwareSerial port, one Serial over nativeUSB port.)

It seems to pre-date the implementation of library information describing which boards are compatible...

Thanks for your reply. One would think that available methods of serial communication would be ubiquitous and well documented and that could be the case if you know where to look.

I guess More research is required.

:+1:

This topic was automatically closed 180 days after the last reply. New replies are no longer allowed.