A4988 control velocity Stepper

For general Flowcode discussion that does not belong in the other sections.
Post Reply
Zhmil1789
Posts: 12
http://meble-kuchenne.info.pl
Joined: Sun Mar 01, 2026 6:50 pm
Has thanked: 9 times

Flowcode v10 A4988 control velocity Stepper

Post 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
Attachments
PROTOTYPE1.1.fcfx
(24.08 KiB) Downloaded 27 times

chipfryer27
Valued Contributor
Posts: 1995
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 434 times
Been thanked: 650 times

Re: A4988 control velocity Stepper

Post 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

Zhmil1789
Posts: 12
Joined: Sun Mar 01, 2026 6:50 pm
Has thanked: 9 times

Re: A4988 control velocity Stepper

Post 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
Attachments
PROTOTYPE1.1.fcfx
(24.08 KiB) Downloaded 23 times
Screenshot 2026-05-26 030700.png
Screenshot 2026-05-26 030700.png (182.37 KiB) Viewed 103 times

chipfryer27
Valued Contributor
Posts: 1995
Joined: Thu Dec 03, 2020 10:57 am
Has thanked: 434 times
Been thanked: 650 times

Re: A4988 control velocity Stepper

Post 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

Post Reply