To be honest, I'm hesitant to submit this pull request. I understand it's a lot of code, none of which was discussed in a ticket/issue. This patch set is the result of my actual use case needs for controlling a servo, which resulted in adopting a Event Emitter base prototype that:
supports reading a servo (which actually requires writing to the arduino via the serialport to request a servo.read())
supports detaching a servo
emits an event to indicate a servo has been:
attached
detached
read
supports a flexible sweep that allows setting to and from degree and time lapse
emits an event to indicate a sweep is complete
I wish I could provide unit tests for all of these features, but as no testing suite exists and I already feel as though I my have overstepped, I chose to just create example files that illustrate the use cases.
All of these changes were developed on an Arduino UNO with protoshield and stock servo.
To be honest, I'm hesitant to submit this pull request. I understand it's a lot of code, none of which was discussed in a ticket/issue. This patch set is the result of my actual use case needs for controlling a servo, which resulted in adopting a Event Emitter base prototype that:
servo.read()
)sweep
that allows setting to and from degree and time lapseI wish I could provide unit tests for all of these features, but as no testing suite exists and I already feel as though I my have overstepped, I chose to just create example files that illustrate the use cases.
All of these changes were developed on an Arduino UNO with protoshield and stock servo.