#if* directives control compile time behavior. See a good C manual
for some "direction" on this. Wikibooks might help:
http://en.wikibooks.org/wiki/C_Programming
To fix your specific problem search for XSENSOR_SAMPLE_RATE in
the code and implement some kind of switch based on your detector
input. It will be a little harder then this because I suspect that
XSENSOR_SAMPLE_RATE is set only once, and you want to do it when
your input changes...which then requires sampling and decision
making on some periodic basis...
MS
alvindarjit singh wrote:
> Hi Team,
>
> my name's Alvin.
> I wish to develop a Reactive System of sampling data. The desired system
> would have a sampling rate of every 5 minutes during normal weathers and
> it speeds up the sampling rate of every 30 seconds when it detects rain.
> Currently I am using MicaZ, MDA300, MIB520, EC-5 Soil sensors and a RG50
> Rain Gauge by SEba Hydometrie.
> I have developed a rain sensor using RG50 and PIC16F84A. which outputs a
> high signal when its raining and vice versa,
>
> In order to swap the sampling rate I was thinking of manipulating the
> lines 124-130 of sensorboardApp.h of XMDA300 in Programmers Notepad 2.
> the lines read:
> #ifdef USE_LOW_POWER
> uint32_t XSENSOR_SAMPLE_RATE = 184320;
> #else
> uint32_t XSENSOR_SAMPLE_RATE = 1843;
> #endif
> #endif
> so the idea is to USE_LOW_POWER during normal conditions and disable
> USE_LOW_POWER when it is raining.
> my question is, how do i toggle between USE_LOW_POWER ?
> Is there a way by which the mote which has the rain detector to trigger
> this command, and send it to the base station which later relays it to
> the other motes within the vicinity?
>
> would appreciate the help
> thanks
>
> Best Regards,
> Alvin
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Tinyos-help mailing list
> [email protected]
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help