kidoman / embd

Embedded Programming Framework in Go
http://embd.kidoman.io
MIT License
1.28k stars 156 forks source link

adding stepper motor example #25

Closed benschw closed 9 years ago

benschw commented 9 years ago

Control a stepper motor (28BJY-48)

(this is a port of Matt Hawkins' example impl from http://www.raspberrypi-spy.co.uk/2012/07/stepper-motor-control-in-python/)

Datasheet: http://www.raspberrypi-spy.co.uk/wp-content/uploads/2012/07/Stepper-Motor-28BJY-48-Datasheet.pdf

kidoman commented 9 years ago

Thanks for the PR. Please have a look at some of the review comments

kunalpowar commented 9 years ago

Thanks for the PR @benschw. I'm thinking if this can be pulled out into a package which exposes something like

stepper, _ := embd.NewStepper(...)
benschw commented 9 years ago

thanks for all the feedback! I'll try to tackle the updates as soon as possible

benschw commented 9 years ago

I've incorporated your feedback, except the idea of creating a Stepper struct. If you'd like me to try that, maybe getting this approved and creating a new PR pulling the Stepper abstraction out and refactoring the sample to use it would make review easier.

Let me know how to proceed.

kidoman commented 9 years ago

Sounds about right

Sent from my iPhone

On 31-Mar-2015, at 5:47 am, Ben Schwartz notifications@github.com wrote:

I've incorporated your feedback, except the idea of creating a Stepper struct. If you'd like me to try that, maybe getting this approved and creating a new PR pulling the Stepper abstraction out and refactoring the sample to use it would make review easier.

Let me know how to proceed.

— Reply to this email directly or view it on GitHub.

benschw commented 9 years ago

sorry - so should I cancel this pr? or do you want to pull it before I get started on the Stepper struct?

kidoman commented 9 years ago

No I am going to merge this. That should be a second PR

benschw commented 9 years ago

Sorry, I wasn't totally clear on the empty lines. Could you let me know line numbers if I got any wrong?

kidoman commented 9 years ago

About the empty lines: I have left line comments whereever I noticed an issue

benschw commented 9 years ago

oops, I'm a little embarrassed about not running that before pushing.

benschw commented 9 years ago

also, I moved ticker.Stop up to a defer defined when i start the ticker; there is no Close implemented on Ticker