Code to start/stop and adjust speed for Arduino Uno to 1 single drone motor

Right.

It could/should work: What about if I adjust the speeds? Instead of 2000rpm do like 1 per day - just the one single burst on one section. all 4 sections of the stator spoke electromagnets per wire go at the same time same speed and the other 2 sections of the stator spoke electromagnets going at there own respective speeds ??? right? to move the propeller along in a circle, spin harder, lift more. so they all do go at separate speeds. I need to adjust the speed for each wire.

Like for the code would it be like 0.00000001 for like in the code that I previously attached to make ornaments turn on
esc.attach(9);
delay(5000);
esc.write(179); // HI
delay(5000);
esc.write(1); // LO
delay(5000);
esc.write(90); // MID
delay(10000);
esc.write(120); // SPEED

Would I have to adjust those numbers I’m thinking????

It seems like it’s a speed and interval thing that does/would go along and fit with the function of the ESC.

Sorry but I still have no idea what you're trying to achieve. What "prop"? What "ornaments"? What exactly is your project?

Any chance of translating "Like for the code would it be like 0.00000001 for like in the code" or "It seems like it's a speed and interval thing that does/would go along" into English?

If what you're trying to do is make a brushless motor turn very very slowly then forget it. It's not going to happen. The ESC relies on feedback from the motor to tell it when to switch. Moving very slowly doesn't provide enough feedback and the ESC just gives up.

Steve

Ok - so than, how slow can I get this motor to go!

What numbers do I replace in the code I have and where?

Try answering a few of the questions you keep being asked. I've asked several times what you're trying to achieve and you consistently ignore me. Until I get some answers I'm not bothering with you any more.

Good luck with whatever it is you're doing.

Steve

How SLOW can I get this motor to turn with this code: - or add/delete or start over with new code?
(this code turns it on but I have to unplug it to make it stop)

/*** ***/
#include <Servo.h>

Servo esc;

void setup()
{
esc.attach(9);
delay(5000);
esc.write(179); // HI
delay(5000);
esc.write(1); // LO
delay(5000);
esc.write(90); // MID
delay(10000);
esc.write(120); // SPEED
}

void loop()
{
}

I'm using the Arduino IDE; the set up is an Arduino Uno connected to an ESC, battery and brushless motor(for a drone).

Thanks

“How SLOW can I get this motor to turn with this code:”

What happens when you try the code out?

That particular code when pasted in the IDE makes the motor turn on. I have to unplug it to make the motor stop.

I have an Arduino Uno connected to an ESC, battery and a brushless motor for a drone. I am running it through the Arduino IDE.

This code posted below makes the motor turn on. I have to unplug it to make it stop.

/*** ***/
#include <Servo.h>

Servo esc;

void setup()
{
esc.attach(9);
delay(5000);
esc.write(179); // HI
delay(5000);
esc.write(1); // LO
delay(5000);
esc.write(90); // MID
delay(10000);
esc.write(120); // SPEED
}

void loop()
{
}

I am trying to figure out what the numbers in the code mean, e.g.
For each it says delay(5000);
5000 whats? If I change this number, either keep them all the same or make each part (HI, LO, MID) a different delay number? What happens?

What about for these?
esc.write(179); // HI
esc.write(1); // LO
esc.write(90); // MID
What does HI,LO and MID refer to respectively?
Why the numbers for those; 179, 1, 90?

And than this; What happens if I change the number for SPEED - OR 120 whats?
esc.write(120); // SPEED

Looks like it's 5000 milliseconds.

The value passed to esc.write is the desired motor speed. HI/LO/MID are just comments clarifying that the values are the highest speed, lowest speed, and half way inbetween.

The reason the numbers are what they are is because the Servo class is really intended for controlling servos, in which case the value is the angle in degrees that you want the servo to rotate to. But since ESC's use the same communication protocol (pulse period modulation/PPM), you can control them the same way. The values just make slightly less sense.

When and how do you want the motor to stop.

You do realize how a servo motor works do you?

Confused,

The very last thing your arduino does before it stops running is to tell the speed controller.

esc.write(120); // SPEED

So why would you expect it to send a stop command?

So what happens if I change the number for the ‘delay’?

What happens if I change the number for SPEED?

I want like one single push from the electromagnets in the motor and for it to stop right away.

I do NOT realize how a servo motor works.

The beauty of Arduino is that you can change the program, try it out, and learn the answer in far less time than it takes to post questions and get an answer.

However, a little mental effort on your part could go a long way. If delay(5000) waits for 5000 milliseconds (5 seconds), what do you suppose delay(4000) would do?

Ok thanks - 5seconds but 5 secs till what? Every 5 secs what happens?

When I turn it on it’s spinning really really fast.

5seconds but 5 secs till what?

Until the instruction after the delay is executed.

CD_Q:
Ok thanks - 5seconds but 5 secs till what? Every 5 secs what happens?

5 seconds till the next line in your code will be executed.

CD_Q:
When I turn it on it’s spinning really really fast.

No experience with servos. How about shortening the first delay? How about not writing 179 to the servo but e.g. 120?

CD_Q:
I want like one single push from the electromagnets in the motor and for it to stop right away.

I think you'll have to give a better explanation.

So every 5 secs HI, MED, LO ‘happens’ ~ do HI MED and LO correspond to the wires leading into the motor that go around the spokes in the stator to make the electromagnets? There’s 4 sections, 3 electromagnets each.

And by happen I guess mean the electromagnets get current going through them and react against the stationary magnets on the outside, causing the spin.

Adjusting the numbers:
I guess I though the 1, 90 and 179 had something to do with the angle to make it spin in thought those were set numbers.

Changing it from 179 to 120 would do what now? Would it make it spin slower?

What about the delay if I make 100 seconds would that make it go slower. If I made the first one 100 seconds and the next two 0 would they even do anything? Would it just be the one set of electromagnets corresponding to that wire going off every 100secs?

All your code is in setup(). It will only be executed once and never again.

And no, HI, LOW and MED don't refer to the wires.

This tells the Arduino which pin to use to control the servo.

esc.attach(9);

That's the only wire that is relevant (based on your code).