Go Down

Topic: Help with timer interrupt (Read 320 times) previous topic - next topic


Hello people!I'm pretty new to arduino, but I have programming experience in other platforms. I'm doing a robotic arm with 5 degrees of freedom and need to program the paths. Basically the function that I have to make it´s 5th order polynomial that determines the path I wish to make each joint. The function is as follows:

? (t) = a_0 + a_1 + a_2 * t * t ^ 2 + a_3 * t ^ 3 + t ^ a_4 * 4 + a_5 * t ^ 5

My only problem is the variable t (time), i desire that path last two seconds with step 0.05s.
The question is how to perform a routine to perform this function every  0.05s.

I thought a timer interrupt every 0.05s counting interruptions up to 2 seconds.

I hope I explained well. Greetings and Thanks!


That, or just keep monitoring millis() in a loop and act every 50. See the "Blink without delay" example.

Note that you should not do much in an ISR, especially calculate that polynomial!

Go Up

Please enter a valid email to subscribe

Confirm your email address

We need to confirm your email address.
To complete the subscription, please click the link in the email we just sent you.

Thank you for subscribing!

via Egeo 16
Torino, 10131