Jose,

> The problem is that this doesn't seem to work very well. The lights
turn
> on and off at shorter intervals every time and if I try to keep them
on
> for longer periods of time, say, 5 seconds, they will stay on and
never
> come off.
>
> I suspect I might be using the wrong timers... Could anyone give me
some
> tips on how to make this work properly? I'd really appreciate it.

Try to avoid doing anything that is time critical in task context. E.g.
timestamping a message in ReceiveMsg.receive is inadequate, because it's
called from a task. Similarly, Timer.fired is also signaled from a task,
which has a non-negligible jitter if you want to use it for timesync.

Doing as much as possible from within the interrupt handlers would solve
much of your issues. However, syncing with the PC is still kind of
problematic, since the time difference between sending out a message
from your java app and receiving it on the mote has a pretty bad
variance...

Janos

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

Reply via email to