Hi friends,

   I'm working in the following apllication:


module vvvvM {
    provides {
        interface StdControl as StdControl6000;
        interface StdControl as StdControl4000;
            }
    uses {
        interface Timer as Timer6000;
        interface ADC as ADC6000;
        interface Timer as Timer4000;
        interface ADC as ADC4000;
        interface Leds as Leds;
    }
}
implementation {

    command result_t StdControl6000.init(){
        return call Leds.init();
    }
    command result_t StdControl6000.start() {
        return call Timer6000.start(TIMER_REPEAT, 6000);
    }
    command result_t StdControl6000.stop() {
        return call Timer6000.stop();
    }
    event result_t Timer6000.fired() {
        call ADC6000.getData();

        return SUCCESS;
    }


    command result_t StdControl4000.init(){
        return call Leds.init();
    }
    command result_t StdControl4000.start() {
        return call Timer4000.start(TIMER_REPEAT, 4000);
    }
    command result_t StdControl4000.stop() {
        return call Timer4000.stop();
    }
    event result_t Timer4000.fired() {
        call ADC4000.getData();

        return SUCCESS;
    }


    async event result_t ADC4000.dataReady(uint16_t data) {
        if(data = 0x400){
            call Leds.yellowOff();
            call Leds.greenOff();
            call Leds.redOff();
            call Leds.greenOn();
            call Leds.redOn();
            call Leds.yellowOn();
        }
        else{
            call Leds.yellowOff();
            call Leds.greenOff();
            call Leds.redOff();
        }
        return SUCCESS;
    }

    async event result_t ADC6000.dataReady(uint16_t data) {
        if(data > 0x600){
            call Leds.yellowOff();
            call Leds.greenOff();
            call Leds.redOff();
            call Leds.yellowOn();
        }
        else{
            call Leds.yellowOff();
            call Leds.greenOff();
            call Leds.redOff();
            call Leds.greenOn();
            call Leds.redOn();
        }
        return SUCCESS;
    }
}

   It compiles correctly but when I put it in the mote just the
ADC4000.dataReady (the first one) is called. I'm using Tinyos 1.x.
   Could Anybody help-me?? it'very urgent.

Thanks

Daniel Coelho
_______________________________________________
Tinyos-help mailing list
Tinyos-help@millennium.berkeley.edu
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to