FORUM
The default constructor for the SOLOMotorControllersUart assumes that serial port "Serial" is of type HardwareSerial:
SOLOMotorControllersUart(unsigned char _deviceAddress = 0, HardwareSerial &_serial = Serial, SOLOMotorControllers::UartBaudrate _baudrate = SOLOMotorControllers::UartBaudrate::RATE_115200, long _millisecondsTimeout = 50, int _packetFailureTrialAttempts = 5);
I was getting compile errors that Serial could not be cast to type HardwareSerial which prompted some investigation. Some variants of Arduino (maybe very few, but at least my P1AM-200 and some other SAMD variants I looked at) have Serial as a software port used only for USB and serial monitor function. They then have additional ports like Serial1 which are actual hardware ports.
I intend to use a CAN shield but this error was preventing any use of the SOLO library.
Since you want to have a hardware port, the guidance from Arduino (found in variant.h) is this:
// These serial port names are intended to allow libraries and architecture-neutral // sketches to automatically default to the correct port name for a particular type // of use. For example, a GPS module would normally connect to SERIAL_PORT_HARDWARE_OPEN, // the first hardware serial port whose RX/TX pins are not dedicated to another use. // // SERIAL_PORT_MONITOR Port which normally prints to the Arduino Serial Monitor // // SERIAL_PORT_USBVIRTUAL Port which is USB virtual serial // // SERIAL_PORT_LINUXBRIDGE Port which connects to a Linux system via Bridge library // // SERIAL_PORT_HARDWARE Hardware serial port, physical RX & TX pins. // // SERIAL_PORT_HARDWARE_OPEN Hardware serial ports which are open for use. Their RX & TX // pins are NOT connected to anything by default.
So I changed the above constructor to use SERIAL_PORT_HARDWARE (which on my device is Serial1 rather than Serial) and my compile errors were resolved.
SOLOMotorControllersUart(unsigned char _deviceAddress = 0, HardwareSerial &_serial = SERIAL_PORT_HARDWARE, SOLOMotorControllers::UartBaudrate _baudrate = SOLOMotorControllers::UartBaudrate::RATE_115200, long _millisecondsTimeout = 50, int _packetFailureTrialAttempts = 5);
Hello @jsut,
Thank you for the note, I've forwarded this to the team, they will check it out and let you know.
Milad
If you found the answers helpful and you could solve your problems, please kindly verify here to help others in the future.
One more issue, the documentation links from the Arduino part of the website and from github are currently broken.
http://www.solomotorcontrollers.com/documentation/SOLO_Arduino_Library/ (linked from website) leads to a 403 forbidden error.

