How to combine program?? can someone help me with it

PaulS:

samples[i] = ( 4.4 * analogRead(tempPin) * 100.0) / 1024.0; // conversion math of LM35 sample to readable temperature and stores result to samples array. 1024 is the Bit depth (quantization) of Arduino.

// 5 is the supply volts of LM35. Change appropriatelly to have correct measurement. My case is 4.4Volts.



If your Arduino is operating at 4.4 volts, it's either damaged or needs new batteries powering it. It should be at very close to 5.0 V or 3.3 V, depending on which Arduino you have.

4.4vs is lm35 voltage fyi...my arduino do run 5volts

    for (int y=turn; y <= turn; y++)

{ //Limited by the turn variable



How many times is this going to loop?

it depends on how many time the user can play how many turn ...

it depends on how many time the user can play how many turn ...

Read it again.

Read it again.

I'll second that.

The statement says "starting with y equal to turn, while y is less than or equal to turn, do some stuff, then increment y, and check again.". Suppose turn is 8. The loop index starts at 8, and the loop is executed over and over, with y incrementing by 1 each time, while y is less than or equal to 8. So, y is set to 8, and the loop body executes. Then, y is incremented to 9. It is no longer less than or equal to 8, so the loop body is skipped.

So, I'll ask again, how many times is that loop executed? Keep trying until you come up with the correct answer of once. Then, explain why you need a for loop to do something once.