[Tinyos-help] How to measured temparature, humidity and light

Aleksandr N. Sadkov axel at wl.unn.ru
Mon Jul 2 08:57:07 PDT 2007


Hello,

 

I am using standard sensors on Tmote Sky.

 

File BaseStationP.nc

 

module BaseStationP {

  uses {

    

..............

// for sensing

            interface Read<uint16_t> as ReadTemperature;

            interface Read<uint16_t> as ReadHumidity;

            interface Read<uint16_t> as ReadIVoltage;

            interface Read<uint16_t> as ReadLight;

}

 

implementation

{

  

...................

// for sensing 

            uint16_t             temperature;

            uint16_t             humidity;

            uint16_t             ivoltage;

            uint16_t             light;

 

 

..................

// for sensing

 

event void ReadTemperature.readDone(error_t result, uint16_t data)

  {

    if (result == SUCCESS){

      temperature = data;

    }

  }

 

  event void ReadHumidity.readDone(error_t result, uint16_t data)

  {

    if (result == SUCCESS){

      humidity = data;

    }

  }

 

  event void ReadIVoltage.readDone(error_t result, uint16_t data)

  {

    if (result == SUCCESS){

      ivoltage = data;

    }

  }

 

    event void ReadLight.readDone(error_t result, uint16_t data)

  {

    if (result == SUCCESS){

      light = data;

    }

  }

  

 

 

............................

 

// for sensing

                        call ReadTemperature.read();

                        call ReadHumidity.read();

                        call ReadIVoltage.read();

                        call ReadLight.read();

.............................

 

// for sensing

                        mess2->tmprt=temperature;

                        mess2->hmdt=humidity;

                        mess2->ivt=ivoltage;

                        mess2->lght=light;

 

 

 

 

file BaseStationC.nc

 

configuration BaseStationC {

}

implementation {

..................

 

// For sensing

  components new SensirionSht11C() as SensorSht;

  components new DemoSensorC() as SensorIVt;

  components new HamamatsuS10871TsrC() as SensorLght;

  

.......................

// for sensing

  BaseStationP.ReadTemperature -> SensorSht.Temperature;

  BaseStationP.ReadHumidity -> SensorSht.Humidity;

  BaseStationP.ReadIVoltage -> SensorIVt.Read;

  BaseStationP.ReadLight -> SensorLght.Read;

 

...................

 

It's all.

 

 

wbr, Sadkov Aleksandr

axel at wl.unn.ru

www.sumkino.com

www.wl.unn.ru

  _____  

From: tinyos-help-bounces at Millennium.Berkeley.EDU
[mailto:tinyos-help-bounces at Millennium.Berkeley.EDU] On Behalf Of Faisal
Farman
Sent: Monday, July 02, 2007 4:35 PM
To: tinyos-help at Millennium.Berkeley.EDU
Subject: [Tinyos-help] How to measured temparature, humidity and light

 

hi all, i m working in a project with tmotesky to measure temparature,
humidity and light and to display it on the web, can any body help me doing
that, it will be great if any body can guide me.
 
Thanks in advance
 
Faisal

  _____  

Change is good. See what's different about Windows Live Hotmail. Check it
out!
<http://www.windowslive-hotmail.com/learnmore/default.html?locale=en-us&ocid
=RMT_TAGLM_HMWL_reten_changegood_0607> 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.millennium.berkeley.edu/pipermail/tinyos-help/attachments/20070702/aa885d1d/attachment-0001.htm


More information about the Tinyos-help mailing list