Hi all,

I am trying to set up a program called TempAverageM to do an average about 10
temperatures values received from an iris sensor mts310. I am programming with
MoteWorks, TinyOS 1.x.
It seems have declaration variables problem in my program :

TempAverageM.nc:23: warning:   non-atomic write
TempAverageM.nc:49: warning:   non-atomic read
TempAverageM.nc:50: warning:   non-atomic write
TempAverageM.nc:17: warning: non-atomic accesses to shared variable `dataValue':
TempAverageM.nc:51: warning:   non-atomic write
TempAverageM.nc:52: warning:   non-atomic read
TempAverageM.nc:18: warning: non-atomic accesses to shared variable `array':
TempAverageM.nc:52: warning:   non-atomic write
TempAverageM.nc:54: warning:   non-atomic read
TempAverageM.nc:54: warning:   non-atomic read
TempAverageM.nc:54: warning:   non-atomic read
TempAverageM.nc:54: warning:   non-atomic read
TempAverageM.nc:54: warning:   non-atomic read
TempAverageM.nc:54: warning:   non-atomic read
TempAverageM.nc:54: warning:   non-atomic read
TempAverageM.nc:54: warning:   non-atomic read
TempAverageM.nc:54: warning:   non-atomic read
TempAverageM.nc:54: warning:   non-atomic read
TempAverageM.nc:20: warning: non-atomic accesses to shared variable `i':
TempAverageM.nc:52: warning:   non-atomic read
TempAverageM.nc:53: warning:   non-atomic r/w
TempAverageM.nc:55: warning:   non-atomic read
TempAverageM.nc:56: warning:   non-atomic write
TempAverageM.nc:19: warning: non-atomic accesses to shared variable `moy':
TempAverageM.nc:54: warning:   non-atomic write
C:\Crossbow\cygwin\opt\MoteWorks\apps\tutorials\lesson_6\TempAverageM.nc: In
function `TempAverageM$StdControl$start':
C:\Crossbow\cygwin\opt\MoteWorks\apps\tutorials\lesson_6\TempAverageM.nc:35:
warning: no return statement in function returning non-void
C:\Crossbow\cygwin\opt\MoteWorks\apps\tutorials\lesson_6\TempAverageM.nc: In
function `TempAverageM$ADC$dataReady':
C:\Crossbow\cygwin\opt\MoteWorks\apps\tutorials\lesson_6\TempAverageM.nc:48:
error: parameter name omitted
make: *** [exe0] Error 1

Here, this is how I declared my variables :

implementation {

        //variables initialisation

        bool dataPending;
        uint16_t dataValue;
        uint16_t array[10];
        uint16_t moy;
        int i = 0;

and hw I am trying to do average :

async event result_t ADC.dataReady(uint16_t){
                if (!dataPending) {
                        dataPending = TRUE;
                                dataValue = call ADC.getData(); //uint16_t = 
data
                                array[i]=dataValue;
                                i++;
                                moy = ((array[0] + array[1] + array[2] + 
array[3] + array[4] + array[5] +
array[6] + array[7] + array[8] + array[9] )/10);
                                if (i==10){
                                        i=0;
                                }
                post sendData();
                call Leds.yellowToggle();
                return SUCCESS;
                }
        }

I need a table because I have to remplace the first value by the last one every
ten values.

Can someone help me ?

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

Reply via email to