Stepper/ DC motor and OLED and Rotary Encoder

General discussions and questions abound development of code with MicroPython that is not hardware specific.
Target audience: MicroPython Users.
Post Reply
martch
Posts: 4
Joined: Sat Nov 27, 2021 9:13 am

Stepper/ DC motor and OLED and Rotary Encoder

Post by martch » Sat Nov 27, 2021 9:30 am

Hello there....
I'm mid way through a build centered around a pi pico and want to drive a stepper motor clockwise or anticlockwise for a given duration. Having done a fair bit of googling, I'm floundering.

The project uses a rotary encoder to select a number between 1 and 100, which is displayed on an OLED (thank you Peter Hinch) and then a motor (ideally a Nema 17 stepper because there is one in front of me) will adjust a dial that will provide limited (but some - 'winding an old alarm clock' level) resistance. I have a DRV8825 for controlling it.

So, my question is twofold: If I use the Nema, am I likely to need to use ramping? Is there some code that a kind soul can point me at to give me a head start?

Thanks

EDIT: I Switched to a DC motor and it works a treat: https://www.youtube.com/watch?v=dQ8bjJROrDo

Post Reply