The following is a simple program which intend to make LED to blink once 
in every 5.4 minutes.

But the Timer fires very quickly, at least twice in every one second!!!. I 
am I missing something very basic ???

As defined in Timer.nc, the input to StartPeriodic and OneShot is uint32. 
I am using 2.1.1 and Telosb motes.

module BlinkC ()
{
   uses interface Timer<TMilli> as Timer0;
   uses interface Leds;
   uses interface Boot;
}

implementation
{

   uint32_t get_wait_time()
   {
     uint32_t ret;
     ret = (100-18)*4000;
     return(ret);
   }

   event void Boot.booted()
   {
     uint32_t wait_time;

     wait_time = get_wait_time();
     call Timer0.startPeriodic(wait_time);
   }

   event void Timer0.fired()
   {
     dbg("BlinkC", "Timer 0 fired @ %s.\n", sim_time_string());
     call Leds.led2Toggle();
   }

}



Manjunath D

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

Reply via email to