On Nov 21, 2005, at 7:39 AM, Alex Mason wrote:
Hfor (i = 0; i < n; i++) { post flashGreen; }
The task queue has a fixed size: that is going to overflow it (some posts will return FAIL). The problem there is if some other component wants to post a task queue and can't; there are situations where, due to the implementation, this can cause problems (e.g., the 1.x CC2420 stack). So what you're doing is inadvisable in that regard.
I'll bet that the LED is, in fact, blinking, but doing so faster than your eye can see. E.g., let's say you are able to post 10 flashGreen tasks. Each one takes about 220 cycles to enqueue and execute: that means you're going to use ~2200 cycles, which is ~0.25 ms, or 250us. Your eye has a frame rate of about 24, so you won't see this. If you where to toggle the LED continuously, you might be able to discern that it's dimmer than being on, but that's about it.
What you want to do is store the variable n in the frame. When the timer fires, decrement n, and if it's greater than 0, restart the timer.
Phil ------- "We shall not cease from exploration And the end of all our exploring Will be to arrive where we started And know the place for the first time." - T. S. Eliot, 'Little Gidding' _______________________________________________ Tinyos-help mailing list [email protected] https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
