Hi,
im trying to make a drone. I started using Servotimer2 after some problem with incompatibility with Servo and VirtualWire library. Im controlling esc through servo.write(microseconds) but i feel like its going by steps even if input is linear from 1000 to 2000. Is there some resolution for this function (with good old Servo.h didnt feel that way) or have you some suggestions how to make work Servo with VirtualWire ?
I expect there's a problem with the code you haven't shown us or the circuit that you haven't shown us or maybe the components you haven't told us anything about. Maybe you have some blocking code in the loop that's writing the "linear from 1000 to 2000" to the servo?
I agree with Steve, it always helps if you post the code (use code tags), wiring diagram and description of the components.
dejvidusx:
Im controlling esc through servo.write(microseconds) but i feel like its going by steps even if input is linear from 1000 to 2000.
I am confused by this. Maybe it is just a bad description of your code (did we mention that you should post your code?).
But if you are trying to send a microsecond command to your servo, you should use servo.WriteMicroseconds() rather than the servo.Write() that you describe.
In fact in ServoTimer2 the write() does take microseconds and NOT the 0-180 "angle" that Servo.h uses.
And of course even Servo.h will treat a write() as writeMicroseconds() if the parameter supplied is outside the 0-180 range. No I don't know why either. It just adds confusion.
slipstick:
And of course even Servo.h will treat a write() as writeMicroseconds() if the parameter supplied is outside the 0-180 range. No I don't know why either. It just adds confusion.
Remember, micros comes in packs of 4, so you may only have 250 steps between 1000 and 2000. 1000, 1004, 1008, 1012, etc. Numbers in between may not work.