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?

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

Reply via email to