with servo library i have achieved to make my motor rotate in one direction by sending a speed from 0 to 180
my question is :how to move it in the other direction without switching any wires?is it by sending negative speeds?
how to move it in the other direction without switching any wires or making any change in the electrical connections?
Use an ESC designed for RC model cars/trucks rather than one designed for RC 'planes or multirotors
thank you UKHeliBob for replying
I am talking about the programming part
i already have an esc designed for model cars
Is it by sending the speed in negative?
ex:
Motor.write(-180);
Is it by sending the speed in negative?
No. The write() function does not accept negative values. I would expect that values from 0 to 90 would cause the motor to rotate in one direction and 90 to 180 to cause it to move in the opposite direction, but I do not have such an ESC
Please post a link to the ESC that you are using.
I am using a T100 brushless motor with built in esc called blueESC
https://bluerobotics.com/store/thrusters/t100-t200-thrusters/t100-thruster-blueesc/
According to the documentation for that blueESC BlueESC Documentation it should behave as UKHeliBob says. But perhaps you should try using wriiteMicroseconds(), 1500 stopped, 1000 full speed reverse, 2000 full speed forward.
Steve
Thank you slipstick for replying
I wil definitely try your suggestion
Tried slipstick's suggestion and it works!!!
thank to all who replied
I am glad that it works but it makes no sense to me (at least) because whether you use write(90) or writeMicroseconds(1500) surely the output will be pulses of length 1500 microseconds
The only thing I can think of is that the default value for write(0) is 544us and for write(180) is 2400 and perhaps the ESC gets confused by the excessively low and high values. But you'd still expect 90 to be stop!
The OP could check that unlikely sounding theory by changing the attach to attach(9, 1000, 2000) to limit the range of write().
Steve