Hi,
I'm working on tinyOS1.x with Telosb Mote. I'd like obtaining the values of
Temperature, Humidity and Light sensors.
I got the Values of Temperature, but they are around 2880 in oscilloscope and
around 600 in cygwin screen(from 10 to 1005).
When i use the formula (Oscilloscope values), the temperature is around 19°C(It
is logic). but I like display this values (19 °C)
on cygwin screen. What can I DO?
In fact, I'd display the values of Humidity and Light in the same Oscilloscope.
Is it possible (with using three channels 0,1 and 2).
This my code.
implementation {
// declare module static variables here
/**
* Module scoped method. Displays the lowest 3 bits to the LEDs,
* with RED being the most signficant and YELLOW being the least significant.
*
* @return returns <code>SUCCESS</code>
**/
// display is module static function
result_t display(uint16_t value)
{
if (value &1) call Leds.yellowOn();
else call Leds.yellowOff();
if (value &2) call Leds.greenOn();
else call Leds.greenOff();
if (value &4) call Leds.redOn();
else call Leds.redOff();
return SUCCESS;
}
/**
* Initialize the component. Initialize ADCControl, Leds
*
* @return returns <code>SUCCESS</code> or <code>FAILED</code>
**/
// implement StdControl interface
command result_t StdControl.init() {
return call Leds.init();
}
/**
* Start the component. Start the clock.
*
* @return returns <code>SUCCESS</code> or <code>FAILED</code>
**/
command result_t StdControl.start() {
return call Timer.start(TIMER_REPEAT, 500);
}
/**
* Stop the component. Stop the clock.
*
* @return returns <code>SUCCESS</code> or <code>FAILED</code>
**/
command result_t StdControl.stop() {
return call Timer.stop();
}
/**
* Read sensor data in response to the <code>Timer..fired</code> event.
*
* @return The result of calling ADC.getData().
**/
event result_t Timer.fired() {
return call ADC.getData();
}
/**
* Display the upper 3 bits of sensor reading to LEDs
* in response to the <code>ADC.dataReady</code> event.
* @return Always returns <code>SUCCESS</code>
**/
// ADC data ready event handler
async event result_t ADC.dataReady(uint16_t data) {
dbg(DBG_TEMP|DBG_USR1, "Counter: Value is %i\n", (int)data);
display(7-((data>>7) &0x7));
return SUCCESS;
}
}
______________________________
BOUZAYANI Walid
Student Researcher
CES Laboratory, ENIS Tunisia
[email protected]
GSM: (00216) 94 306 603
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help