How much randomness can be achieved reading analogpin voltage values?

Hello,

I am trying to create a random interval mouse clicker for a video game using a servo. I tried reading voltage from Analog pins 1-15 in a for cycle and using the values as randomSeed(); with hope that this randomises the numbers generated even more.
Just hoping to get some feedback and tips, on how I could improve my code and get undetectable levels of pseudo-randomness.

#include <Servo.h>

Servo myservo;

int pos = 0;
long randNumba;
long randNumbb;
long randNumbc;
int seq;

void setup() {
myservo.attach(9);
Serial.begin(9600);
myservo.write(10);
}

void loop() {

randomSeed(analogRead(15));
randNumbc = random(25, 50);
Serial.println(randNumbc);

for (seq = 0; seq <= 15; seq++)
{
Serial.println(“Sequence started”);
randomSeed(analogRead(seq));
randNumba = random(50, 150);
randNumbb = random(1000, 2250);

myservo.write(45); //servo presses the mouse button
Serial.println(randNumba);
delay(randNumba); //delay while the button is pressed
delay(randNumbc);

myservo.write(30); // moves back and waits for another button press cycle.
Serial.println(randNumbb);
delay(randNumbb);
delay(randNumbc);

}

}

randombuttonpress.ino (873 Bytes)

Check this out: Arduino random seed - A study of entropy

pepperonipizza:
Just hoping to get some feedback and tips...

Reseeding, especially the way you are doing it, is a terrible idea with the Libc generator. Stop doing that.

It is reasonable to assume that the entropy from a single analogRead is either nothing or a single bit.

The linked article is worth reading. In case Scribd still sucks.

The reliable but not very sexy way to seed random.

Walter Anderson's code is an excellent choice for seeding. As I recall it's generally too slow to use for generating.