graycatlabs / PyBBIO

A Python library for Arduino-style hardware IO support on the Beaglebone
https://github.com/graycatlabs/PyBBIO/wiki
MIT License
251 stars 87 forks source link

adds stepper library with an example #32

Open agwatic opened 10 years ago

alexanderhiam commented 10 years ago

Awesome, thanks!

One issue though, on line 28 of Stepper.py:

    def __init__(self,steps = 100 , pin_1, pin_2, pin_3=None, pin_4=None):

if you want steps to have a default value it'll have to come after the pins without defaults. Or would you rather have steps first without a default value? No need to submit another pull request, just let me know what you meant and I'll make the change when I merge it.

agwatic commented 10 years ago

ok , let it

def  __init__(self, pin_1, pin_2, pin_3=None, pin_4=None, steps = 100 ):

I just made it as the stepper library in Arduino

alexanderhiam commented 10 years ago

There seems to be a few other bugs, have you tested this yet? It'll need to be tested before I can pull it into the main branch, and I'm not sure I have an H-bridge on hand.

agwatic commented 10 years ago

This is the only bug I can see because I haven't a beagleboard yet so unfortunately I didn't test my code. can you tell me the bugs you found ?

alexanderhiam commented 10 years ago

It's just a few minor Python bugs, a couple missing self.s, etc.

I can clean that that stuff up, but I'll have to test it with a motor to make sure it works before pushing it to the main branch. I'll see if I can find an H-bridge in my junk bin...