Any thing is (im)possible with software...
You can look into the O'scope java code to find where values
are converted for plotting and stick your conversion formula
in there. I'm sure that exercise will lead you to the code
that does a full channel display which you might clone in
order to add a third channel. I suspect you will have to
change the TOS message structure to include that third data
stream, but that is not too difficult if you've been through
the TOS tutorials.
I have some difficulty understanding what you are doing now.
The included code doesn't send any data to the host. Presuming
that you are sending in whatever you are working with, what are
you using to receive on the host end? What exactly is producing
values from 10 to 1005? Can you post your host side conversion
code?
MS
bouzayani walid wrote:
> 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
_______________________________________________
Tinyos-help mailing list
[email protected]
https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help