Hi guys.
I have a college project to make fan. I used drone's propeller and BLDC motor. This motor is controlled by ESC 30 A and I was using arduino and a 10k potentiometer.
I got the code from YouTube.
But, in that code, I can't provide the BLDC voltage at certain position of potentiometer.
This is my code:
What should I modify so I can know the BLDC voltage? Thanks pal.
I have a college project to make fan. I used drone's propeller and BLDC motor. This motor is controlled by ESC 30 A and I was using arduino and a 10k potentiometer.
I got the code from YouTube.
But, in that code, I can't provide the BLDC voltage at certain position of potentiometer.
This is my code:
Arduino Brushless Motor Control:
#include <Servo.h>
Servo ESC; // create servo object to control the ESC
int potValue; // value from the analog pin
void setup() {
// Attach the ESC on pin 10
ESC.attach(10,1000,2000); // (pin, min pulse width, max pulse width in microseconds)
Serial.begin(9600);
}
void loop() {
potValue = analogRead(A1); // reads the value of the potentiometer (value between 0 and 1023)
potValue = map(potValue, 0, 1023, 0, 180); // scale it to use it with the servo library (value between 0 and 180)
ESC.write(potValue); // Send the signal to the ESC
Serial.println(potValue);
}