Somewhere, something, probably uses a Timer.start() to set
a sample period, and those defines _might_ have something
to do with it. I'd search for them in the code and see what
they are used for. It might be that APP_RATE is the thing
you want and that you can set it in your main program file.

As to changing the rate based on readings, you will need
to modify the code that sets the timer rate. Look at some
of the simpler app examples like Sense, and search for
doc on the Timer component to see how it's used.

MS

alvindarjit singh wrote:
> Hi guys,
> 
> I am using MIB520, MDA300 and two micaZs to form a simple mote that 
> sends data to my pc.
> I am facing a problem whereby my mote sends data after every 2 seconds.
> my intention is to program micaZ so that it would send readings from MDA300
> every 1 minute when the input to ADC2 is >2.0 volts, and
> every 2 minutes when the input to ADC2 is <2.0 volts.
> 
> I am using Programmer's Notepad 2 to modify the file XMDA300M.nc. And i 
> noticed that
> the supporting file sensorboardApp.h has the following lines in the end 
> of its program
>  "...
> 
> #ifdef APP_RATE
> uint32_t XSENSOR_SAMPLE_RATE = APP_RATE;
> #else
> #ifdef USE_LOW_POWER
> uint32_t XSENSOR_SAMPLE_RATE = 184320;
> #else
> uint32_t XSENSOR_SAMPLE_RATE = 1843; 
> #endif
> #endif
> 
> uint32_t   timer_rate; 
> 
>  ..."
> 
> which might explain why my mote sends back data every 2 seconds.
> 
> how can i modify codings of both or either one files to achieve my 
> desired sampling
> pattern ?
> 
> your help is very much appreciated.
> Thank you.
> 
> Best Regards,
> Alvin
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Tinyos-help mailing list
> [email protected]
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help

-- 
Platform: WinXP/Cygwin
TinyOS version: 1.x, Boomerang
Programmer: MIB510
Device(s): Mica2, MicaZ, Tmote
Sensor board: homebrew

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

Reply via email to