You are here

how do you arm your Vesc in arduino code?

1 post / 0 new
the creator
Offline
Last seen: 5 years 8 months ago
Joined: 2019-02-25 01:36
Posts: 1
how do you arm your Vesc in arduino code?

I am working on a project involving controlling my motor through Arduino. I have my Vesc 4.12 wired to the Arduino and i have tried simple arming techniques that were used for different ESCs but none had worked with the vesc. The arming process in arduino is usually done by just writing the code as if you were coding a servo to move to an angle but the angle, in this case, is used as a motor speed. So at the beginning of the code, you attach the "servo" then set the servo to an angle(which is actually the speed on this case) and that should alert the ESC to begin communicating. Different ESCs have different arming speeds and sometimes different techniques. I have tried finding the arming sequence for a Vesc 4.12 but I've had no luck. Here is a sample of code to arm a hobby king 30A ESC, which didn't work for me but is just an example. Does anyone know how to arm the Vesc 4.12??

#include <Servo.h>
Servo servo;
void setup()
{
servo.attach(9);//this acknowledges that the motor is in pin 9
delay(1);
servo.write(40);//This is what armed the ESC. 
}
void loop()
{
servo.write(90);//In the loop it simply told the motor to go to angle 90 as an example. In this case, the angle is speed.
}