how to control bldc moter with arduino uno r3
copy this code and paste in your Arduino software or app and upload this code into Arduino board...
#include<Servo.h> //using servo library to control ESC
Servo esc; //Creating a servo class with name as esc
void setup()
{
esc.attach(8); //Sepcify the esc signal pin,Here as D8
esc.writeMicroseconds(1000); //initialize the signal to 1000
Serial.begin(9600);
}
void loop()
{
int val; //Creating a variable val
val= analogRead(A0); //Read input from analog pin a0 and store in val
val= map(val, 0, 1023, 1000, 2000); //mapping the val to minimum and maximum input
esc.writeMicroseconds(val); //using val as the signal to esc
}
detail in last post:- http://secretbehindscience.blogspot.com/2018/09/control-bldc-moter-with-arduino-uno-r3.html
and enjoy😉
#include<Servo.h> //using servo library to control ESC
Servo esc; //Creating a servo class with name as esc
void setup()
{
esc.attach(8); //Sepcify the esc signal pin,Here as D8
esc.writeMicroseconds(1000); //initialize the signal to 1000
Serial.begin(9600);
}
void loop()
{
int val; //Creating a variable val
val= analogRead(A0); //Read input from analog pin a0 and store in val
val= map(val, 0, 1023, 1000, 2000); //mapping the val to minimum and maximum input
esc.writeMicroseconds(val); //using val as the signal to esc
}
image for connection
No comments: