Wiring Forum
Programming Questions & Help >> Programs >> internInterrupts exemple?

Message started by uki on 03/09/07 at 11:07:28

Title: internInterrupts exemple?
Post by uki on 03/09/07 at 11:07:28

Please can someone show me the most basic usage of interrupts() ?

I want to control in precise time intervals stepper motors and write-read from serial port...

thanx in advance,

Title: Re: internInterrupts exemple?
Post by barragan on 03/10/07 at 05:17:09
The The noInterrupts() and interrupts() methods are for disable and enable interrupts in the Wiring board, note that all the Wiring functionality will stop by disabling interrupts. These methods are useful to mark critical sections of code where timing is so important that it can not be interrupted by other tasks (like Serial, Wire, other libraries or timing activities).

I think what you're looking for is a way to generate internal timing interrupts. Please check the code for the Serv library that comes with your distribution, you can also look at it online here: http://wiring.uniandes.edu.co/source/trunk/wiring/lib/Servo/
very precise timing is use to control the servos.

Wiring Forum » Powered by YaBB 2.5 AE!
YaBB Forum Software © 2000-2010. All Rights Reserved.