Roboclaw & Nucleo 64 Issues
Posted: Tue Mar 31, 2020 2:38 pm
I am having a difficult time getting my STM32F446 Nucelo-64 to control my 2x15A Roboclaw Motorcontroller.
The code I am using does not seem to be working, the motors do not turn on. I have verified that the motors do turn on in the Motion Studio, works like a charm. I have also verified the buadrate and the address. The code compiles but nothing else. I am a novice here so hopefully I am missing something obvious. Here is my code:
///////////////////////////////////
// Include the RoboClaw Arduino library
#include "RoboClaw.h"
// Create the RoboClaw object, passing it the hardware serial pointer
RoboClaw roboclaw(&Serial, 10000);
#define address 0x80
void setup() {
// Start serial communication
roboclaw.begin(38400);
}
void loop() {
// Call command on RoboClaw object, in this case turning motor 1 in the forward direction at full speed
roboclaw.ForwardM1(address, 127);
delay(2000);
roboclaw.ForwardM1(address, 0);
delay(2000);
}
/////////////////////////////////////////////
I have connected TX and RX pins of the Nucleo Board to the S1 and S2 I/O pins. I have connected the ground pin of the S1 pin the the ground of the Nucleo Board. I am using the Hardware serial becuase I was running into some other errors compiling with the Software Serial. Can anyone help?
The code I am using does not seem to be working, the motors do not turn on. I have verified that the motors do turn on in the Motion Studio, works like a charm. I have also verified the buadrate and the address. The code compiles but nothing else. I am a novice here so hopefully I am missing something obvious. Here is my code:
///////////////////////////////////
// Include the RoboClaw Arduino library
#include "RoboClaw.h"
// Create the RoboClaw object, passing it the hardware serial pointer
RoboClaw roboclaw(&Serial, 10000);
#define address 0x80
void setup() {
// Start serial communication
roboclaw.begin(38400);
}
void loop() {
// Call command on RoboClaw object, in this case turning motor 1 in the forward direction at full speed
roboclaw.ForwardM1(address, 127);
delay(2000);
roboclaw.ForwardM1(address, 0);
delay(2000);
}
/////////////////////////////////////////////
I have connected TX and RX pins of the Nucleo Board to the S1 and S2 I/O pins. I have connected the ground pin of the S1 pin the the ground of the Nucleo Board. I am using the Hardware serial becuase I was running into some other errors compiling with the Software Serial. Can anyone help?