I am currently trying to do what you have over here i.e. keeping the
detector on for all time.
You might want to modify the detector.start() so that it doesnt stop based
on a timer (as it currently does).
Secondly you are using US.sendPulse() which sends a train of pulses.. using
sendSinglePulse().

Another thing you might want to look at is the fact that the US detection
circuitry is not the most reliable in the world. In order to correctly test
the response you might want to do the following.
event ultrasound.pulseDetected () {
if(count==5){
 call Leds.yellowToggle;
count=0;
}
else count++;

this would show whether the pulse ever get detected (It might be the case,
as it was for me, that you get multiple pulseDetected for a single pulse
sent).

If it still doesnt turn on once, you should try modifying the
ultrasound.startDetector as I suggested above.

Let me know if the above suggestions are helpful.

Affan.



On 5/23/07, roberto pagliari <[EMAIL PROTECTED]> wrote:

Hi All,
I'm trying to make the ultrasound sensors of cricket motes work with a
simple application. I have a couple of motes, each one with its own REPEAT
timer of 1 second. Every time the timer fires the mote send a pulse. The
detector is started and, restarted everytime the timeout occours, in order
to keep all incoming pulses. The pseudo-language of my simple app is the
following

// some code
stdcontrol.start() {
  Timer.start(TIMER_REPEAT, 1000)
  ultrasound.stardDetector(45000)
}

event timer.fired() {
  ultrasound.sendPulse();
}

event ultrasound.pulseDetected () {
  call Leds.yellowToggle;
}

event ultrasound.timeout() {
  ultrasound.startDetector(45000)
}


the problem is that the yellow led doesnt toggle, and I guess the mote
doesnt receive any pulse. What should be the problem in that code?

thank you in advance

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

Reply via email to