because i'm gonna try to make another project and i need to know how to make a random value
on the pwm. I can't find any help on youtube so i am asking this question on arduino forum
Really impressed that you thought of asking at youtube before reading the reference material over at the main Arduino site.
http://arduino.cc/en/Reference/Random
See the random() function in the reference on the Arduino main site. You'll need a value between 0 and 255, so use something like the following:
int randomValue = random(0, 256);
analogWrite(pin, randomValue);
If you don't want the random value to be the same every time the program starts, you will need to call randomSeed() first, passing it a value that isn't the same for each run. There are various ways of generating a seed, such as using micros() to see how long the program has been running (if the operation concerned is triggered by an external input e.g. push button), doing an analogRead() from an unconnected pin, and reading from the on-chip temperature sensor.