Hi,

Here's the scenario, mote 1 gets data from the Nonin
Ipod in serial format, it is connected to the pin 27
of the mica2 mote1.

mote1 transmits this data to mote2. 

For this,I tried the following:

------------------------------------------------
configuration myhpl {
}

implementation
{
   components Main, MyhplM, HPLUARTC, LedsC;
   Main.StdControl -> MyhplM.StdControl;
   MyhplM.HPLUART -> HPLUARTC;
   MyhplM.Leds -> LedsC;
  }
------------------------------------------------

module MyhplM {
   provides {
     interface StdControl;
   }
   uses {
     interface HPLUART;
     interface Leds;
     //interface Timer;
 
  }
}
implementation {

 command result_t StdControl.init() {
        
    call Leds.init();
    call Leds.redOff();
    call Leds.yellowOff();
    call Leds.greenOff();
    return SUCCESS;
    }



   command result_t StdControl.start() {
     call HPLUART.init();          // Initialize UART0
module
    //return call Timer.start(TIMER_REPEAT, 1000); 
   }

   command result_t StdControl.stop() {
     return call HPLUART.stop();      // Disable UART0
module
     
//return call Timer.stop();
   }

   async event result_t HPLUART.get(uint8_t value)
   {
    if (value & 8) call Leds.redOn();
    else call Leds.redOff();
    
    if (value & 16) call Leds.greenOn();
    else call Leds.greenOff();
    if (value & 32) call Leds.yellowOn();
    else call Leds.yellowOff();
                
    return SUCCESS;
   }

   async event result_t HPLUART.putDone()
   {
    
    //call Leds.greenOn();
    return SUCCESS;
   }

/*event result_t Timer.fired()
  {
      call Leds.redOff();
        call Leds.greenOff();
        call Leds.yellowOff();
    
    return 
  }*/

}
-----------------------------------------------------

As expected it doesn't quite work properly. The Leds
light up when I connect both pin 27 and 28 to the
IPOD.

I was thinking more in terms of something like this as
the ideal scnarioe:

since the ipod sends 3 bytes of data per second, the
red Led on mote1 light up when they get the data, and
green lights up when it send the dta to mote2, while
at mote2, since its receiving the data red Led lights
up.

cheers

AG





__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 
_______________________________________________
Tinyos-help mailing list
[email protected]
https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

Reply via email to