10 years, 8 months ago.

Brushless ESC How to arm?

Hi there,

Is there any code sample to drive brushless ESC with armimg on LPC1768.

P21 is pwm out pin. I have checked this code http://mbed.org/users/MatteoT/code/ESC/ but it does not include how to arm.

Thanks in advance

OK. The given library and with my code works together.

  1. include "mbed.h"
  2. include "esc.h"

ESC esc1(p21); ESC esc2(p22);

Serial pc(USBTX, USBRX); tx, rx

int main() {

pc.baud(19200); char c; int var = 0; esc1 = 0.5; esc2 = 0.5;

while(1) { c = pc.getc(); if (c == 'u') { if (var < 100) var++; } else if (c == 'd') { if (var > 0) var; } else if (c == 'r') var = 0; else if (c == 'p') var = 90; esc1.setThrottle(((float)var)/100); printf("%i\r\n", var); esc1.pulse(); esc2.pulse(); wait_ms(20); 20ms is the default period of the ESC pwm } }

posted by Mscson Mscson 10 Apr 2014
Be the first to answer this question.