10 years, 2 months ago.

Connect AFRO ESC Speedcontroller with MBED

Hi All,

I am building a quadcopter that uses an MBED LPC4088 controller to connect to pheripherals like gyro, esc's etc.

I've received my 4x AFRO ESC 30A speed controllers and I've removed the shrink wrap and soldered the I2C GND/SDA and SCL and connected it to my controller.

I've read that the default I2C address should be 52. I've configured a little test program to connect to I2c in the MBED but I cannot find any additional information about the values that can be read or written. The manual:

http://www.hobbyking.com/hobbyking/store/uploads/310964900X365809X4.pdf points me to the Github: https://github.com/sim-/tgy/

I don't understand how to recover the data interface (/adresses) from these files.

Is there anyone that managed to read and write data with the AFRO ESC through I2C with MBED ?

Thanks, Julian

I remember (vaguely) 6 months ago checking out your links. The mbed I2C address notation is generally the 7-bit address (assuming it is a 7-bit one) shifted one to the left, but it should be easy enough checking which address it ACKs on.

The main issue is of course figuring out how to communicate with it. And from what I remember my impression was that it is alot of work trying to figure it out. Searching for example code for Arduino and porting that should be easiest.

posted by Erik - 14 Sep 2014

Hi Erik,

Thanks for your response. and thanks for other posts like MODSERIAL. It helped me very much.

I figured it out, I had to send chars to the adresses below. Once you know it is always easy ;)

This is my code cmd1[] = char

cmd1[0] = _motorPower[0]; F1_MotorSpeed; if (i2cMotors.write(0x58, cmd1, 2) != 0) { printf("Failed to write to afro ESC FRONT LEFT "); }

cmd2[0] = _motorPower[1]; F2_MotorSpeed; if (i2cMotors.write(0x52, cmd2, 2) != 0) { printf("Failed to write to afro ESC FRONT RIGHT"); }

cmd3[0] = _motorPower[2]; F3_MotorSpeed; if (i2cMotors.write(0x54, cmd3, 2) != 0) { printf("Failed to write to afro ESC REAR RIGHT"); }

cmd4[0] = _motorPower[3]; F4_MotorSpeed; if (i2cMotors.write(0x56, cmd4, 2) != 0) { printf("Failed to write to afro ESC REAR LEFT"); }

posted by Julian van Basten 02 Oct 2014
Be the first to answer this question.

Assigned to Julian van Basten 9 years, 7 months ago.

This means that the question has been accepted and is being worked on.