Hi,

Probably a very simple question (as usual!) but I can't seem to find an
understandable answer.

I was creating a small demo with my motes to show radio comms receiving,
performing a task and then acknowledging completion.  In doing this, I
wanted to flash the Leds quickly in succession.  So, I created a task to do
this - for example:

  task void flashGreen()  {
    call Leds.greenOn(); 
    call greenTimer.start(TIMER_ONE_SHOT, 25);
    }

...

  event result_t greenTimer.fired()  {
    call Leds.greenOff();
    return SUCCESS;
    }

Then, I can just use "post flashGreen" to flash the Led.  However, the
problem I have is that I want to flash the Led 'n' number of times so I
tried:

for (i = 0; i < n; i++)  {
  post flashGreen;
  }

However, this just flashes the Led once, regardless of the value of 'n'.  I
have the feeling the problem is because of the task being posted too many
times in quick succession - but on the other hand I was under the impression
that tasks are processed FIFO, so I'm a little confused.  Of course, this
isn't a major problem (I don't need the Leds to flash in practice) but it
would be nice to know what is causing the problem for future reference.  I
have tried atomic execution also, but this made no difference (unless I am
using it incorrectly).

Cheers,


----------
Alex Mason
Postgraduate Research
RFID & Wireless Sensor Networks
Liverpool John Moores University

Email: [EMAIL PROTECTED]
Phone: +447886389484 

_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to