[Tinyos-help] Re: Very strange problem!

AIGroup gruppodinfo at gmail.com
Sat Feb 9 08:50:36 PST 2008


Another strange thing:
I'm comparing my code with the app.c file which contains the parsed code.
The line
temp=((chosen[j]>=temp) ||  inconsistent[j] || (j == heldout));

where temp is an integer, is parsed in
temp = (chosen[j] >= temp || inconsistent[j]) || j == heldout;
which is different from the the original!!!!
So, are my problems caused by this uncorrect parsing?



2008/2/9, AIGroup <gruppodinfo at gmail.com>:
>
> Hi all,
>
> I implemented an algorithm for regression based on SVM.
> I tested all using Tossim and now I would like to verify the results using
> a micaz mote.
> I send the firmware to the mote but I have the following problem:
> when mote boots with the event (called with Timer0.startOneShot( 250 ) )
> -----
> event void Timer0.fired()
> {
>     call Leds.led1On();
>     ComputeSVM();
>     call Leds.led2On();
> }
> -----
>
> I see the green led (led1)  toggling!!! (I never see led2On)
> Why?????
> I have verified that the problem is inside a function of mine which is:
> ----
> long compute_index(long int *binfeature, long int range, long int
> *index)
> {
>   int i=0,ii=0;
> /*THE PROBLEM IS HERE: IF I PUT A NUMBER (e.g. 2) INSTEAD OF range THE
> STATEMENT for WORKS WELL */
>   for(i=0;i<range;i++) /* <----T
>   {
>     if(binfeature[i])
>     {
>        index[ii]=i;
>        ii++;
>     }
>   }
>   /* THE PROBLEM IS ALSO HERE WITH i AND ii VARIABLES
>   for(i=0;i<4;i++) { <--------------------
>     index[ii+i]=-1;
>   }
>   return ii;
> }
>
> ------
> I hope you can help me.
> Thanks in advance.
>
> Roberto
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://www.millennium.berkeley.edu/pipermail/tinyos-help/attachments/20080209/978cf99a/attachment.htm


More information about the Tinyos-help mailing list