Turny is an Elixir port of the Adafruit Python Library for DC + Stepper Motor HAT, which is a Python library for interfacing with the Adafruit Motor HAT for Raspberry Pi to control DC motors with speed control and Stepper motors with single, double, interleave and microstepping, designed specifically to work with the Adafruit Motor Hat.
To reconstruct the Elixir project, execute
mix new turny and then copy mix.exs and lib/turny.ex into place.
Run it with:
$ mix run -e Turny.start (CTRL-c twice to stop it) $ mix run -e Turny.swrst
Note: Be sure to do the software reset or you will leave one or more of the coils energized and the motor will get very hot.
In program code, use something like the stop function to set all the channels you're using to zero, or examine the Python code for "Release"-ing a motor to see if it does something different. I haven't gotten there yet.
The current code is doing double coil stepping where two coils are energized at once. This is much stronger than single coil stepping, but uses more power. Other options are interleaved, which alternates between single and double, and micro-stepping.