test bldc motor using arduino
Hello friends,
test BLDC motor using arduino.
what you need :-
circuit diagram is here
test BLDC motor using arduino.
what you need :-
- BLDC motor ( i use 1400kv motor)
- 30A esc(any esc you can use)
- Arduino UNO
- power supply ( i use atx power supply)
- 10K potentiometer
- And breadboard
circuit diagram is here
code is here
#include <Servo.h>//Using servo library to control ESC
Servo esc; //Creating a servo class with name as esc
void setup()
{
esc.attach(8); //Specify 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(A1); //Read input from analog pin a0 and store in val
val= map(val, 0, 1023,1000,2000); //mapping val to minimum and maximum(Change if needed)
esc.writeMicroseconds(val); //using val as the signal to esc
}
Comments
Post a Comment