Well, look at the micasb version. It wraps Photo (or Temp, I never remember)
which further wraps ADC (which does actually do something in-between...).
I'm going to assume that the telosb internal voltage sensor is implemented
as some kind of ADC as well. The basic pattern is:

        // in some method, often Timer.fired(), start a conversion:
         call ADC.getData();


        // Then create an event to catch the conversion result:
        async event result_t ADC.dataReady( uint16_t data )
        {
                // do something with "data"
                ...

                return SUCCESS;
        }

I too am sure there was a good reason behind the design approach,
however I'm not always clear on what it might be...
MS

Akos Maroy wrote:
Did deeper into DemoSensor. First of course you have to figure out
which one and where it is...I don't (yet) have a tmote dev environment,
but for the Mica's it's in tos/sensorboards/micasb/DemoSensorC.nc

DemoSensorC on telosb simply calls the internal voltage sensor - it's not
related to any of the ADC's :(

What you will find is that it is a dimly veiled layer over an ADC input,
which, IMHO, just obscures and obfuscates the usage...

it's true there are a lot of abstraction layers - and it makes it hard to
figure out what to do :( having said this, I'm sure there is good reason
behind this design approach.


Akos

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

Reply via email to