Artemis Red Board ATP with RoboClaw Motor Controller

I want to upgrade the Arduino Mega 2560 I am using in my prototype omnidirectional standing wheel chair project to an Artemis. The Artemis Red Board ATP is my first Artemis product. I had no trouble loading the Artemis library into the Arduino IDE, Ver 1.8.9. Then I had no trouble getting the Artemis to blink with the Arduino blink example, simply as a test. However, the Artemis will not compile a sketch that the Arduino Mega 2560 had no problems with. The sketch uses serial communications with a Basic Micro RoboClaw motor controller.

The original sketch used pins 10 and 11 for Serial communications, but the Artemis board does not have a pin 11 so I tried to use pin 9. That had nothing to do with the sketch failing to compile because I tried to compile it without the Artemis connected and with pin 9, then pin 11, just to see if the sketch would compile. Here is the pertinent code, and the error message:

#include <SoftwareSerial.h>

#include “RoboClaw.h”

SoftwareSerial serial(10,9);

RoboClaw roboclaw(&serial,10000);

Arduino: 1.8.9 (Windows 10), Board: “SparkFun BlackBoard Artemis ATP, 921600, SparkFun Variable Loader (Recommended)”

Build options changed, rebuilding all

PacketSerialEncoderSpeedDistance:12:32: error: no matching function for call to ‘RoboClaw::RoboClaw(SoftwareSerial*, int)’

RoboClaw roboclaw(&serial,10000);

^

In file included from C:\Users\Dale\AppData\Local\Temp\arduino_modified_sketch_661733\PacketSerialEncoderSpeedDistance.ino:7:

C:\Program Files (x86)\Arduino\libraries\roboclaw_arduino_library-master/RoboClaw.h:128:2: note: candidate: ‘RoboClaw::RoboClaw(HardwareSerial*, uint32_t)’

RoboClaw(HardwareSerial *hserial,uint32_t tout);

^~~~~~~~

C:\Program Files (x86)\Arduino\libraries\roboclaw_arduino_library-master/RoboClaw.h:128:2: note: no known conversion for argument 1 from ‘SoftwareSerial*’ to ‘HardwareSerial*’

C:\Program Files (x86)\Arduino\libraries\roboclaw_arduino_library-master/RoboClaw.h:24:7: note: candidate: ‘constexpr RoboClaw::RoboClaw(const RoboClaw&)’

class RoboClaw : public Stream

^~~~~~~~

C:\Program Files (x86)\Arduino\libraries\roboclaw_arduino_library-master/RoboClaw.h:24:7: note: candidate expects 1 argument, 2 provided

exit status 1

no matching function for call to ‘RoboClaw::RoboClaw(SoftwareSerial*, int)’

This report would have more information with

“Show verbose output during compilation”

option enabled in File → Preferences.

I am very much looking forward to replacing my Arduino Mega with the Spark Fun Artemis.

Thank you.

Ooops, minor edit. I had no trouble adding the Artemis to the Arduino Board Manager, and then updated it. Did not load an Artemis library.

Hi… I had the same problem… In my case, I had succeeded with an Arduino Uno, and wanted to transfer the sketch over to the Artemis Redboard.

I think our problem is illuminated by this:

: error: no matching function for call to ‘RoboClaw::RoboClaw(SoftwareSerial*, int)’

candidate: ‘RoboClaw::RoboClaw(HardwareSerial*, uint32_t)’

If you scroll up just a bit through the compile output, just prior to the errors, you should see this:

Alternatives for RoboClaw.h: [RoboClaw]

ResolveLibrary(RoboClaw.h)

→ candidates: [RoboClaw]

My guess is that , let’s say the Arduino Uno, uses a different processor chip (way different) than the Redboard… I believe the Redboard’s processor is actually a 32bit ARM.

If so, then in a sense, they’re “faking” an Arduino. And I guess they brought in their own libraries… (such as Roboclaw)… but they aren’t supporting the Software Serial.

Either it’s called something else, or they only support Hardware Serial - for (or within) the their version of the Roboclaw library.

I haven’t tried to actually make any change yet to the sketch, but it shouldn’t be too bad… the Redboard does have 2 HW serials I think…

(if i fix it - I will post back here)

ok, fixed it.

This step might be optional: I commented out the

//#include <SoftwareSerial.h>

and also removed the creation of the

//SoftwareSerial serial(rxpin, txpin);

and finally, change the Roboclaw object creation to hardware serial:

RoboClaw roboclaw(&Serial, xxxxx); // or &Serial1 … since there’s 2 serials on the redboard

It did upload.

UPDATE: you’ll probably want to use “&Serial1” and not “&Serial” since the latter is tied to the USB port… and on the Redboard, it’s Serial1 (TX1,RX1) that are exposed on the connector.

Thank you for your response. Your advice got my sketch to compile, although the sketch did not work. I have been working with the SoftwareSerial pins… As soon as I get some test info in the Serial Monitor, I’ll let you know the results. Thanks, again.

Did you get the roboclaw library working with redboard? I keep encountering the error:

“HardwareSerial.h” : No such file or directory

user_20_d:
Did you get the roboclaw library working with redboard? I keep encountering the error:

“HardwareSerial.h” : No such file or directory

never mind the solution is in the link below

https://resources.basicmicro.com/using- … o-library/