Send Commands to B-G431B-ESC1 via Serial


I am currently testing my B-G431B-ESC1 in an closed loop with position control.
This part works fine and I am getting my desired velocitys.
My Problem is that in my application I need to send the target angle to the B-G431B-ESC1 from an arduino mega. I was trying to just send e.g. ‘T20’ via Serial with Serial.write().
I am using a logiclevel-converter between the arduino mega and the B-G431B-ESC1.
But the motor is not moving and I cant check what is really transmittited to the B-G431B-ESC1 because I can’t send data to it and open the serial monitor at the same time.

Has anyone done something like this or has an idea if I have to modify the Commander code to recieve data from another serial connection ?

Thanks in advance

The ESC1 can use serial over USB, no need for a second microcontroller unless this is something you need for your project specifically?

You certainly can read and write from serial at the same time, this is why there are two lines (Tx and Rx)

I need to send data to the ESC1 from a second microcrontroller because i can’t connect via usb during use.

What i meant is that I cant send data to the ESC1 via Serial from a microcontroller and at the same time connect it to a pc to monitor via the serial monitor, or is this possible ?

yeah, just use software serial on the arduino. But with the mega you have more than one serial port, so you can just use a different one.

The ESC1 has Serial2 routed through the daughter board and uSB to the PC. Serial1 should be available for communication with your second MCU. Just try sending to Serial1 explicitly (instead of just Serial).

When I try to use Serial1, i get an error when compiling: ‘undefined reference to Serial1’

I am not sure, but you may have to enable the second Serial in the header file with the board configuration. I am on vacation currently and can‘t check it.

I posted a program for this board that used the serial port to send and receive data to this board, if you search my history it’s there.

It is working now. The problem was that one of my reference voltages for the logiclevel converter was not consistent. I am taking this one directly from the arduino now and this works fine.

Thanks everybody for the help :slight_smile:

1 Like