Python Forum

Full Version: Arduino Code to Python Code
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
Hello,

I am working on integrating a GUI with some Arduino code. It looks like the easiest way to do this is by converting my Arduino code to python code to have everything in one language. I need the code attached written in Python please, including the AccelStepper library. I am not comfortable with Python code, so I am not sure how to go about this.

Any help with this is much appreciated.

Thanks!
We are glad to help with your effort, but won't do the work for you.
Please make an effort to convert your code, and ask questions about specific areas when problems are encountered.
Thank you.
raspberry pi stepper
Here's an example with for linux, maybe it can get you started going through the source code.
This may prove useful:

your c code uses the DRV8825 driver which is available from pololu.

links:
https://www.ti.com/lit/ds/symlink/drv8825.pdf and https://www.pololu.com/product/2133
https://www.pololu.com/file/0J603/drv882...iagram.pdf

software (no python though) https://github.com/pololu/high-power-ste...er-arduino
Adafruit has a driver that they make which uses either arduino C, or CircuitPython it is their own design which used PWM to control the stepper, however comparing the C code vs Python may be helpful. More here: https://www.mouser.com/new/adafruit/adaf...ing-addon/
The pin numbers will be different, but names should be the same