Dear all,
I was looking the other day on the tinyos website regarding the Notify interface
http://www.tinyos.net/tinyos-2.1.0/doc/nesdoc/telosb/ihtml/tos.interfaces.Notify.html

there I found the Notify.disable() call that I wanted to try. What I did is I 
wrote a simple program that once the key at my telosb is pressed the led turns 
on.

Code looks like that

#include <UserButton.h>
module MyFooC {
    uses interface Boot;
    uses interface Leds;
    uses interface Notify<button_state_t>;
}

implementation {

event void Boot.booted() {
            call Leds.led1Toggle();
            call Notify.enable();
            }

event void Notify.notify(button_state_t state) {
if (state == 0) {call Leds.led0Toggle(); }
else call Leds.led2Toggle();
call Notify.disable();
            }

}

as you can see after led turns off I call Notify.disable() so it starts to 
ignore when button is pressed. Unfortunately this did not work out at all. I 
keep pressing the button and the led just toggles. What I am missing here from 
the "theory"?

I would like to thank you in advance for your help

Regards
Alex
P.s If wiring is needen then it was:

configuration MyFooAppC{
}

implementation {

components MyFooC,MainC,LedsC,UserButtonC;

MyFooC.Boot -> MainC.Boot;
MyFooC.Leds -> LedsC;
MyFooC.Notify -> UserButtonC.Notify;

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

Reply via email to