Hello all
I need to know if it is possible to active time interrupts with netduino and how. Which would be the minimun time elapse between interrupts. Could someone help me with an example, please?
Best regards
One question about interrupts.
Started by irda, Mar 10 2012 08:40 AM
1 reply to this topic
#1
Posted 10 March 2012 - 08:40 AM
#2
Posted 11 March 2012 - 11:05 PM
Hello Irda,
I think what you need is the System.Threading.Timer class. The constructor takes a callback, some state and the parameters that represent when the timer is fired. The first indicates when the timing starts (zero is immediately) and the 2nd is the period in milliseconds.
i.e.
Hope this helps
Glen
I think what you need is the System.Threading.Timer class. The constructor takes a callback, some state and the parameters that represent when the timer is fired. The first indicates when the timing starts (zero is immediately) and the 2nd is the period in milliseconds.
i.e.
using System.Threading; using Microsoft.SPOT; namespace TimerTest { public class Program { public static void Main() { // write your code here Timer timer = new Timer(new TimerCallback(OnTimer), null, 0, 1000); Thread.Sleep(Timeout.Infinite); } public static void OnTimer(object state) { Debug.Print("Timer fired"); } } }
Hope this helps
Glen
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users