If it is important for sequence of values generated by random() to differ on subsequent executions of a sketch, use randomSeed() to initialize the random number generator with a fairly random input, such as analogRead() on an unconnected pin.

to:

If it is important for a sequence of values generated by random() to differ, on subsequent executions of a sketch, use randomSeed() to initialize the random number generator with a fairly random input, such as analogRead() on an unconnected pin.

The random function allows convenient access to pseudo-random numbers for use in sketches.

to:

The random function generates pseudo-random numbers.

Changed lines 8-21 from:

min - optional starting range (ie: from "50" - 300).

max - the largest random number returned (plus one).

In the current version of this function, the max parameter will not be returned, although the minimum will, so for example:

random(10); // returns numbers from 0 to 9

random(-5, 5); // returns numbers from -5 to 4

Consequently, enter a maximum parameter one larger than the maximum integer desired.

min and max are long integers so numbers between -2,147,483,648 and 2,147,483,647 are valid.

to:

min - lower bound on the random value, inclusive (optional)

max - upper bound on the random number, exclusive

Changed lines 13-14 from:

long - the random number.

to:

long - a random number between min and max - 1

Changed lines 16-19 from:

If it is important for a random number sequence to begin on a random number, then call the randomSeed() function using something for a parameter that is fairly random, such as millis(), or analogRead() on a pin with no electrical connection.

Conversely, it can occasionally be useful to use pseudo-random numbers that repeat exactly. This can be accomplished by calling randomSeed() with the same number as a parameter.

to:

If it is important for sequence of values generated by random() to differ on subsequent executions of a sketch, use randomSeed() to initialize the random number generator with a fairly random input, such as analogRead() on an unconnected pin.

Conversely, it can occasionally be useful to use sequences pseudo-random numbers that repeat exactly. This can be accomplished by calling randomSeed() with a fixed number.

Added lines 27-31:

// if analog input pin 0 is unconnected, this
// will cause the calls to random() to generate
// different numbers each time the sketch runs.
randomSeed(analogRead(0));

Consequently, enter a maximum parameter one larger than the maximum integer dersired.

to:

Consequently, enter a maximum parameter one larger than the maximum integer desired.

Changed lines 23-24 from:

long - returns the random number.

to:

long - the random number.

Changed lines 26-29 from:

If it is important for a random number series to begin on a random number, then call the randomSeed() function using something for a parameter that is fairly random, such as millis(), or analogRead() on a pin with no electrical connection.

Conversely it can occasionally be useful to use pseudo-random numbers that repeat exactly. This can be accomplished by calling randomSeed with the same number.

to:

If it is important for a random number sequence to begin on a random number, then call the randomSeed() function using something for a parameter that is fairly random, such as millis(), or analogRead() on a pin with no electrical connection.

Conversely, it can occasionally be useful to use pseudo-random numbers that repeat exactly. This can be accomplished by calling randomSeed() with the same number as a parameter.

If it is important for a random number series to begin on a random number, then call the randomSeed() function using something that is fairly random such as millis() or analogRead() on a pin with no electrical connection.

to:

If it is important for a random number series to begin on a random number, then call the randomSeed() function using something for a parameter that is fairly random, such as millis(), or analogRead() on a pin with no electrical connection.

Note: If it is important for a random number series to begin on a random number, then call the randomSeed() function using something that is fairly random such as millis() or analogRead() on a pin with no electrical connection.

to:

Note:

If it is important for a random number series to begin on a random number, then call the randomSeed() function using something that is fairly random such as millis() or analogRead() on a pin with no electrical connection.

Note: If it is important for a random number series to begin on a random number then call the randomSeed() function using something that is fairly random such as millis() or analogRead() on a pin with no electrical connection.

to:

Note: If it is important for a random number series to begin on a random number, then call the randomSeed() function using something that is fairly random such as millis() or analogRead() on a pin with no electrical connection.

The random function allows convenient access to pseudo-random numbers for use in an applications. NOTE: Use this after using the randomSeed() function.

to:

The random function allows convenient access to pseudo-random numbers for use in sketches.

Changed lines 12-13 from:

In the current version of this function, the max parameter will not be returned, although the minimum will so, for example:

to:

In the current version of this function, the max parameter will not be returned, although the minimum will, so for example:

random(10); // returns numbers from 0 to 9

Changed lines 18-19 from:

Consequently enter a maximum parameter one more than the meximum dersired.

to:

Consequently, enter a maximum parameter one larger than the maximum integer dersired.

Added lines 25-28:

Note: If it is important for a random number series to begin on a random number then call the randomSeed() function using something that is fairly random such as millis() or analogRead() on a pin with no electrical connection.

Conversely it can occasionally be useful to use pseudo-random numbers that repeat exactly. This can be accomplished by calling randomSeed with the same number.