We are about to switch to a new forum software. Until then we have removed the registration on this forum.
I have managed to generate random numbers between 0 and 100, however, the program keeps on going with this function. It doesn't just pick one random number as needed, it just keeps on going with a list of different numbers. How do I change this?
(Sorry, noob with code here)
Answers
Are you running your random number generator inside your draw() function? That is what it seems it is happening here although it is a guess since you didn't provide your code. In general, draw runs 60 fps. You want to avoid your definition in that function. Instead, use a different approach like the one outlined below.
Kf
Store in a variable
I have it in a void display function
how do you store in a variable? the value will still keep on constantly changing
So you only want to pick one random number? Run random() once in setup(), and store the result in a variable.
ok I gave it more thought, i think i know what i need to do now