> I looked at the document - and it contains a partial sample code. Still, > is there a complete application sample somewhere that configures and reads > from and ADC on telosb, and does something with it? Like TestAdc, just for > real? By that I mean that it really configures the ADC, specifies which > channel it will use, and then really uses it?
As I said, an app does not actively configure the ADC but only provides an event handler returning its configuration. Your application could look like this: configuration MyAppC { } implementation { components AppC, new AdcReadClientC(), MyConfigC; AppC.Read -> AdcReadClientC; AdcReadClientC.AdcConfigure -> MyConfigC; } where MyConfigC returns the ADC configuration (analogous to Msp430InternalVoltageP) and AppC uses the Read interface to read out the data. AppC does not configure the ADC itself and it cannot change its ADC configuration, but every time it calls Read.read, the ADC is automatically configured to what MyConfigC returns (AppC could also implement the AdcConfigure event handler itself - I added such an example to CVS, see below). If an app wants to use different ADC configurations, it can instantiate multiple clients "assigning" to each a different ADC configuration: configuration MyAppC { } implementation { components AppC, new AdcReadClientC() as HumidityClient, HumidityConfigC; new AdcReadClientC() as TemperatureClient, TemperatureConfigC; AppC.ReadHumidity -> HumidityClient; HumidityClient -> HumidityConfigC; AppC.ReadTemperature -> TemperatureClient; TemperatureClient -> TemperatureConfigC; } > BTW, TestAdc is very misleading, as it simply references DemoSensor, thus > all ADC related functionality is hidden from the sample code. The problem with apps/TestAdc is that the AdcConfigure interface is different on e.g. micaz and telosb (it must be!), i.e. there cannot be a truly platform-independent ADC test app. All DemoSensor is doing is abstracting from the AdcConfigure interface. Thus assuming that DemoSensor goes via the ADC apps/TestAdc can test the ADC for different platforms. > A full sample app would really be appreciated. I added (to CVS) a simple ADC test app that does not use any sensor wrappers: tinyos-2.x/apps/tests/msp430/AdcSimple Jan > > > Akos > > > > > _______________________________________________ Tinyos-help mailing list Tinyos-help@Millennium.Berkeley.EDU https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help