On Mar 29, 2007, at 1:20 AM, Jorge Grande wrote:

Hello everybody,

I'm using TinyOS 2.0 and I'm trying to write an application for two micaz motes using the microphone. One of the two motes (mote 1) will beep each 1000 ms and the other one (mote 2), once it has detected the tone, will toggle the green led (if it doesn't detect the tone, it will turn one the red led). This mote checks every 50 ms if the tone has been detected; I'm using command startPeriodic including in tos/lib/timer and command readToneDetector including in tos/sensorboards/mts300/MicSetting.nc.

Here is part of the mote 2 application:

...

event void Timer.fired() {
if (call MicSetting.readToneDetector() == 0) //tone has been detected
   {call Leds.led1Toggle();}
  else  // tone has not been detected
   {call Leds.led0On();}
 }


async event error_t MicSetting.toneDetected() {
  return SUCCESS;
 }

...


The problem is that mote 2 is continuously toggling the green led, even if mote 1 is not beeping but I don't know why.

Can anyone help me?


The MTS300 code is relatively new; Crossbow just finished the drivers a few weeks ago. I'd recommend emailing the authors of the code (I'm not 100% sure they check this list that regularly).

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

Reply via email to