A sample speed sweep Arduino program void setup pinMode5 OU

A sample speed sweep Arduino program:

void setup() {

pinMode(5, OUTPUT);

}

void loop() {

for (int motorspeed = 0; motorspeed < 255; motorspeed++) {

analogWrite(5, motorspeed);

delay(10);

}

for (int motorspeed = 255; motorspeed >= 0; motorspeed--) {

analogWrite(5, motorspeed);

delay(10);

}

delay(1000);

}

This is A sample speed sweep Arduino program.

However, I want to know how to measure the motorspeed.. it isn\'t on the serial monior.

If I want to check the motorspeed, how should I have to put code in it?

Solution

here we are finding the RPM not speed.

1.using tachometer we usally obtained the speed of the motor.

2. using proximity sensor by counting the total number of pulses per second, and multiply the obtained value with 60 gives RPM of the motor,

a)if u required the speed

b)find the diameter of the shaft then

c)find the perimeter of shaft

d)multiply the shaft perimeter with RPM(obtained in step one) then speed gives in meters per minute.

next print the value in the serial moniter using below command, i.e pass the speed parameter in the above to Serial.print(\"Speed parameter\")

Serial.print(Motorspeed) to get the speed of the motor in the serial monitor.

A sample speed sweep Arduino program: void setup() { pinMode(5, OUTPUT); } void loop() { for (int motorspeed = 0; motorspeed < 255; motorspeed++) { analogWri

Get Help Now

Submit a Take Down Notice

Tutor
Tutor: Dr Jack
Most rated tutor on our site