A
A
Alexey Saprin2016-02-22 17:15:48
Arduino
Alexey Saprin, 2016-02-22 17:15:48

Arduino interrupts and stepper motor?

Hello, I would like to know about arduino interrupts specifically on the leonardo board


attachinterrupt Card
____________int.0______int.1____int.2______int.3______int.4______int.5
Uno, Ethernet____2_________3
Mega2560________2_________3 ______21_______20_______19_________18
Leonardo_________3_________2_________0 _________1_________7

I understood how to declare interrupts and so
on, but what are the interrupters on the Leonardo board responsible for?

Check before reconfiguring a timer
Timers are a limited resource. There are only 3 of them on the Arduino UNO and they are used for many things. If you get confused with the timer configuration, some things may stop working. For example, on Arduino UNO:
Timer0 - uses millis (), micros (), delay () and PWM on pins 5 and 6
Timer1 - used for Servo, WaveHC library and PWM on pins 9 and 10
Timer2 - uses Tone and PWM on pins 11 and 13

and the most important question is whether the program resumes from the point where the interrupt occurred or loop() is called from the beginning?
I have a problem with the buttons to control the stepper motor .. I need to consider whether the button was pressed and continue the program from the same place without losing steps, etc.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Gusev, 2016-02-22
@0crash0

After the interrupt is handled, the program will continue from where it left off.
If you have an external interrupt - follow the button (i.e. pin), then by the fact that on which timer it sits you can not be driven.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question