Go Down

Topic: Saving and re-using values from potmeter (Read 420 times) previous topic - next topic



I'm struggling with code for my project.

Two potentiometers read values and I want to store 10 of these consecutive values, from each potentiometer, so that I can use these values to
write to two digital pins later. This need to repeat for an amount of time and then it chooses 10 new values and writes them to the pins again etc.

Code: [Select]

val1 = analogRead(POT1);
val2 = analogRead(POT2);

// storing part

analogWrite(output, );
analogWrite(output, );


Thanks in advance,



Thank you for your quick reply.

I have looked into arrays but that causes a lot of new random values from the potmeter.

Is it possible to code it that it makes an array of a random sequence from 10 potmeter values?
Then extract the values from the array and write these to the outputs?


I don't know quite what it is you're asking.

What is it that you want to achieve?

Go Up