No Random() function in Z-Uno?

Discussion about Z-Uno product. Visit http://z-uno.z-wave.me for more details.
Post Reply
Jiriki
Posts: 2
Joined: 28 Mar 2017 16:18

No Random() function in Z-Uno?

Post by Jiriki »

Hi,

I was in the process of creating some code in the Z-Uno to simulate a candel, suprisingly I could not find any Random() function as in Arduino, this makes it quite complicated to do a simulation.

I would like to do this in the Z-Uno because in the Z-Uno I can define some "multi level switches" to play with the parameter for the simulation.

Can I expect a Random() function to be implemented in Z-Uno or is there a library I can use?

/Mats

User avatar
PoltoS
Posts: 5880
Joined: 26 Jan 2011 19:36

Re: No Random() function in Z-Uno?

Post by PoltoS »

We can add it in next releases (2.0.10). We even have the radio noise to seed it.

Jiriki
Posts: 2
Joined: 28 Mar 2017 16:18

Re: No Random() function in Z-Uno?

Post by Jiriki »

Great, thank you :)

michap
Posts: 374
Joined: 26 Mar 2013 10:35
Contact:

Re: No Random() function in Z-Uno?

Post by michap »

Any news about this ? ;)

Thanks!
Michael

Tillsy
Posts: 29
Joined: 15 Feb 2018 03:51

Re: No Random() function in Z-Uno?

Post by Tillsy »

A year later to the exact day! :)

User avatar
PoltoS
Posts: 5880
Joined: 26 Jan 2011 19:36

Re: No Random() function in Z-Uno?

Post by PoltoS »

rand() is here since last summer, but we forgot to document it ;)

p0lyg0n1
Posts: 183
Joined: 04 Aug 2016 07:14

Re: No Random() function in Z-Uno?

Post by p0lyg0n1 »

Here is an example:

Code: Select all

void setup() {
  Serial.begin();
}
void loop() {
  Serial.println(rand()%100);
  delay(1000);
}

bashNinja
Posts: 2
Joined: 05 Oct 2020 22:09

Re: No Random() function in Z-Uno?

Post by bashNinja »

Any chance of coming back to this and documenting it?

Post Reply