Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add "servo" wrapper class to SoftPWMServo #575

Open
EmbeddedMan opened this issue Jun 26, 2015 · 7 comments
Open

Add "servo" wrapper class to SoftPWMServo #575

EmbeddedMan opened this issue Jun 26, 2015 · 7 comments

Comments

@EmbeddedMan
Copy link
Member

The idea here is that it will have exactly the same interface as the standard Arduino servo class, so you can just drop in SoftPWMServo.h instead of Servo.h and all existing sketches will just work.

EmbeddedMan added a commit to EmbeddedMan/chipKIT32-MAX that referenced this issue Jun 26, 2015
…Servo

* This is needed for the new Firmata support
* Also fixed FubarinoSD analog mapping macro so that the new Firmata would work properly
* Also fixed some subtle bugs in SoftPWMServo that were not exposed until Firmata really exercised it a lot.
@majenkotech
Copy link
Member

You could inherit the Servo class as a parent then and override the relevant functions. That way the SoftPWMServo class can be passed to any functions that expect a Servo object. Means you have to include both Servo and SoftPWMServo (if you're not on UECIDE of course)...

EmbeddedMan added a commit that referenced this issue Jun 26, 2015
Fix for issue #575 : Adding "servo" wrapper class to SoftPMWServo
@EmbeddedMan
Copy link
Member Author

True. I've got everything done, for now, in a simple way. Next step is to
make it cleaner, as you suggest.

On Fri, Jun 26, 2015 at 6:47 AM, Matt Jenkins [email protected]
wrote:

You could inherit the Servo class as a parent then and override the
relevant functions. That way the SoftPWMServo class can be passed to any
functions that expect a Servo object. Means you have to include both Servo
and SoftPWMServo (if you're not on UECIDE of course)...


Reply to this email directly or view it on GitHub
#575 (comment)
.

@majenkotech
Copy link
Member

Personally I'd like to see more interface classes defined in the core - things like the Servo interface, etc, that the libraries then use instead of defining their own interfaces. Makes for a much cleaner system.

@EmbeddedMan
Copy link
Member Author

I completely agree. The trick, of course, is doing it without affecting
existing sketches.

On Fri, Jun 26, 2015 at 6:49 AM, Matt Jenkins [email protected]
wrote:

Personally I'd like to see more interface classes defined in the core -
things like the Servo interface, etc, than the libraries then use instead
of defining their own interfaces. Makes for a much cleaner system.


Reply to this email directly or view it on GitHub
#575 (comment)
.

@majenkotech
Copy link
Member

Yeah, Arduino is a real millstone round our necks...

@ricklon
Copy link
Member

ricklon commented Aug 21, 2015

Confirmed closed?

jasonkajita pushed a commit to jasonkajita/chipKIT32-MAX that referenced this issue Aug 24, 2015
…Servo

* This is needed for the new Firmata support
* Also fixed FubarinoSD analog mapping macro so that the new Firmata would work properly
* Also fixed some subtle bugs in SoftPWMServo that were not exposed until Firmata really exercised it a lot.
@EmbeddedMan
Copy link
Member Author

This should be confirmed by somebody other than me before being closed. At least test it out that it works for them.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants