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
A4988 control velocity Stepper
-
Zhmil1789
- Posts: 12
- http://meble-kuchenne.info.pl
- Joined: Sun Mar 01, 2026 6:50 pm
- Has thanked: 9 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
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
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
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
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 (182.37 KiB) Viewed 101 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
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
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