[Tinyos-help] random values

Arik Sapojnik sapojnik at gmail.com
Wed Apr 28 22:40:32 PDT 2010


Never worked with it, but usually you need to initialize a seed.
If you want different values - every time a different one.

Arik



On Thu, Apr 29, 2010 at 04:24, Roberto Pagliari
<robertodemedici at gmail.com>wrote:

> Hi All,
> I tried this code
>
>     value = call Random.rand16();
>     if( (value & 1) == 1 ) {
>       call BitVector.set(0);
>       call Leds.led0On();
>     }
>
>
> several times but, apparently, random always returns the same value. I
> wired RandomC.Init to main. Do I need to do anything else?
>
> Thanks
>
> --
> Roberto
>
> _______________________________________________
> Tinyos-help mailing list
> Tinyos-help at millennium.berkeley.edu
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-help
>



-- 
Best Regards,
Arik Sapojnik
-------------- next part --------------
An HTML attachment was scrubbed...
URL: https://www.millennium.berkeley.edu/pipermail/tinyos-help/attachments/20100429/956f7bdf/attachment.htm 


More information about the Tinyos-help mailing list