[Tinyos-help] [tinyos-help]The problem of sampling both temperature and humidity values under Oscilloscope
Ma, Xiao
xma4 at utk.edu
Wed Jul 8 09:07:57 PDT 2009
Hi,
I'm new to tinyos-2.x and nesc and I'm trying to sample temperature and humidity both and display
them on the same java gui.
I change a little bit in the code of Oscilloscope like followings:
in Oscilloscope.h:
add #define UQ_SAMPLER "Sampler"
from NREADINGS = 10 to SENSORS_NO = uniqueCount("Sampler"),
from nx_uint16_t readings[NREADINGS]; to nx_uint16_t readings[uniqueCount(UQ_SAMPLER)];
in OscilloscopeApp.nc:
add #include "Oscilloscope.h"
from new DemoSensor as Sensor to new SensirionSht11C() as Sensor,
OscilloscopeC.Read[unique(UQ_SAMPLER)] -> Sensor.Temperature;
OscilloscopeC.Read[unique(UQ_SAMPLER)] -> Sensor.Humidity;
in OscilloscopeC.nc:
changing all "readings" to "sensor_no";
add
task void sample()
{
if (sensor_no < SENSORS_NO)
{
if (call Read.read[sensor_no]() != SUCCESS)
{
report_problem();
sensor_no++;
post sample();
}
}
}
from if (call Read.read() != SUCCESS) report_problem(); to post sample();
and Read.readDone was changed to:
event void Read.readDone[uint8_t id](error_t result, uint16_t data) {
if (result != SUCCESS)
{
data = 0xffff;
report_problem();
}
//local.readings[reading++] = data;
local.readings[sensor_no] = data;
sensor_no++;
post sample();
}
}
But when I make telosb install,it reports an error saying: Read.read not connected.I have no idea about this.
Anyone can help me?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://www.millennium.berkeley.edu/pipermail/tinyos-help/attachments/20090708/96babe2d/attachment-0001.htm
More information about the Tinyos-help
mailing list