Page 1 of 1

A4988 control velocity Stepper

Posted: Tue May 26, 2026 7:33 am
by Zhmil1789
Hello.
I apologise for bothering you. I’m having a problem with the timer in Flowcode; I don’t understand how to use it to control the speed of a stepper motor. Could you please point out where I’ve gone wrong so that I can correct it?

Kind regards
Zhmill1789

Re: A4988 control velocity Stepper

Posted: Tue May 26, 2026 7:57 am
by chipfryer27
Hi

I have had a brief look at your chart and tried to figure things out. I don't see any call at all to your Timer Macro.

This looks like a snippet of code from a larger chart.

Can you tell us what it is you are trying to achieve and how? I'm guessing that you are trying to measure the speed of a motor using a Hall effect switch? Then perhaps adjust the speed of the stepper?

Regards

Re: A4988 control velocity Stepper

Posted: Tue May 26, 2026 8:07 am
by Zhmil1789
I accidentally deleted the interrupt in the main function. I’ll attach the corrected version.
I wanted the speed of the stepper motor to change gradually, i.e. at first the stepper motor moves slowly, then faster. But when I press the button, nothing happens.

Kind regards

Re: A4988 control velocity Stepper

Posted: Wed May 27, 2026 6:19 am
by chipfryer27
Hi

I still think this is part of a bigger picture as I don't see any initialisation of the MCP2307 IO expander, nor any calls to it. Where is your stepper motor connected to?

Difficult to say what is going wrong as without an explanation of what it should be doing I would need to reverse engineer to try and establish what it is your chart is supposed to do and how.

If you could explain, perhaps with comments, what each section of your chart is supposed to do that may help.

Regards