0% found this document useful (0 votes)
53 views2 pages

Speed Control of BLDC Motor

Uploaded by

Vasu Thakur
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
53 views2 pages

Speed Control of BLDC Motor

Uploaded by

Vasu Thakur
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 2

#include <Servo.

h>

#include <LiquidCrystal.h>

LiquidCrystal lcd(3, 13, 9, 10, 11, 12);

Servo ESC; // create servo object to control the ESC

float potValue; // value from the analog pin

float percentg=0;

void setup() {

// Attach the ESC on pin 9

ESC.attach(6,1000,2000); // (pin, min pulse width, max pulse width in microseconds)

lcd.begin(16, 2);

// Print a message to the LCD.

lcd.setCursor(0, 0);

lcd.print(" BLDC MOTOR ");

lcd.setCursor(0, 1);

lcd.print("SPEED CONTROLL");

delay(2000);

lcd.clear();

void loop() {

potValue = analogRead(A0); // 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


percentg = (potValue / 180)*100;

lcd.setCursor(0, 0);

lcd.print(" MOTOR SPEED :- ");

lcd.setCursor(4, 1);

lcd.print(" ");

lcd.setCursor(6, 1);

lcd.print(percentg);

delay(1000);

You might also like