The DemoSensor component is supplied for each kind of sensor board in order to confuse you about how things work...actually to make it possible to reuse upper level code without change depending on the sensor board definition. It fundamentally exposes an ADC interface connected to whatever the original coders thought was a convenient sensor. So to see what your specific system is doing you need to look at the DemoSensor.nc file associated with the platform or attached sensor board, e.g., the sensorboards/mda100 version.
You can just replace DemoSensor with a config for ADC0 in your program if you are attaching directly and don't need to do any other control, like powering up the Photo sensor. Look at how DemoSensor or Photo configs an ADC for an example. MS Li, Haixia wrote: > Hello, > > I am using Tinyos 2.x on IRIS. I read the DemoSensorC component at > \tos\sensorboards\basicsb\. I found there is another DemoSensorC > component at \tos\sensorboards\mda100. I traced the first one. I found > the ADC 6 and PortC1 are used for the sensor. Now I want to connect a > sensor to ADC 0. So Can I just imitate PhotoP, PhotoDeviceP, and PhotoC > to write components for my sensor? > > In addition, I want to connect my sensor by mda 320 or mda 100cb to a > node. So, does it mean I have to imitate the DemoSensorC at > \tos\sensorboards\mda100? Is there anyone can guide me? > > Any help will be appreciated. > > > Haixia Li _______________________________________________ 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
