how to store different values of a pot to be called up latter?

I wan't to be able to store the values of one or more pots in groups so I can call up them up latter but I don't find an example on this to look at it. How can this be done?

Simply store the reading in a variable.
Val = analogRead(pin);

Yeha I get that if I where to use just one readout but what I need is for example is this: to store the analogRead in position A, B and C, and then to be able to call back that info without using the pot when I hit bottom 1, 2 and 3.

Think of it like if I'm combining the analogRead of 3 pot that are the primary colors (red, blue and green) to create 3 other colors, so when I move the pots to get the desire new color I want to store the info of the pots in position A, then do the same in positions B and C. And now that I have A, B and C I want to be able to call back that info without moving the pots to the previous values that I stored in bottoms 1, 2 and 3.

And after I get to do that I wan't to be able to access this thru MIDI without having to press the bottom but with a MIDI comand.

You still do the same, you store it in a variable then you can use it whenever you want in the sketch.
I think you are not asking the right question. Have you done a flow diagram about what you want to happen?
It would help if you said exactly what you want to do and why rather than talk about LEDs.
However you still store things in variables until you need to use them.

Sorry for my not so technical language but all of this is new to me and actually just yesterday I started reading about this and order the Arduino. Anyway it's for a guitar project and it's just like the LED example. I want to get X number of combinations of 3 pots to get different sounds and store them in bottoms so I can latter hit a bottom and bring back the info that was in the pot when I got it to the position that I wanted to. After I do this I want it to work thru MIDI.

OK a lot clearer thanks.

While you still use variables it is best to use a special type of variable called an array.

This is a variable you can store many different values in.
There are many ways of doing this and perhaps the best way is a two dimensional array, but to start with you should just use a one dimensional array and have one array variable for each of the pots.
You will need a store button, your program detects when that is pressed that takes the current three readings and puts them into the three arrays using the index (position in the array) of the bank or address of that sound.
Another button when pressed will read the value in the arrays and output them in some way.
So you need another form of control that determines what bank you are dealing with at the current time. Either a multi-position switch or a rotary encoder with some sort of display.

but all of this is new to me

While this is not a difficult project it is not a beginners one. Get to grips with the language, do a few tutorial examples:-
http://arduino.cc/hu/Tutorial/HomePage
Then you will be in a position to ask the right question, BUT MORE IMPORTANTLY, understand the answer when it is given to you.
Good luck

yeha for sure its a bit more difficult than making an LED blink jejeje, I started reading the Getting Started with Arduino book and I got a sense of the language involve, I just have to wait for it to get here to do get son hands on experience.

I'll keep you posted on the results.

its a bit more difficult than making an LED blink

Yes but try making three LEDs blink all at independently determined and different rates. Do that and you are well on your way to beginning to master the language.

Grumpy_Mike:
While you still use variables it is best to use a special type of variable called an array.
http://arduino.cc/en/Tutorial/Array
This is a variable you can store many different values in.
There are many ways of doing this and perhaps the best way is a two dimensional array, but to start with you should just use a one dimensional array and have one array variable for each of the pots.

Geeze Mike, why not just throw the STL at the new guy?

If he knows its always going to be just three values, three separate variables would do nicely.

If he knows its always going to be just three values, three separate variables would do nicely.

But if he wants to recall more than just one sound he will need arrays. They are not that complicated anyway. I used them in my second ever computer program way back in 1971.

Grumpy_Mike:

If he knows its always going to be just three values, three separate variables would do nicely.

But if he wants to recall more than just one sound he will need arrays. They are not that complicated anyway. I used them in my second ever computer program way back in 1971.

Yeah he will, and yeah they are not really that hard, even for a newbie. But the STL is so much nicer than a vanilla array!

well can you tell me about the STL too?

ElChiguete:
well can you tell me about the STL too?

The STL is the Standard Template Library. Without getting into all the fun about how great templates are, this is a series of containers from fairly simple to fairly complex. But, the complexity is largely hidden from the developer. This are not the easiest library to use, but its not the hardest either.

A "container" is a fancy way of saying that its some code that holds and organizes data. With the STL, you can have items sorted, indexed and organized for fast searching in varying ways. Which way you pick will depend on how you want to organize you r data and how you want to search it. What does not matter is what type of data it is (thanks to the magic of templates). The STL works equally well - and the same way - with all kinds of data.

If you want to store your samples in order, you would use a Vector.

There is an implementation of the STL for Arduino here:

If you want to learn more about the STL in general, then Google it and you'll find a wealth of information.

Well today the Arduino is arriving at my PO Box in Miami and if I'm lucky it should get here by friday XD

Still after reading more on how everything works I have questions on my project:

  1. I understand that I will be combining all sort of sketches to make it work, but I still don't find and example of something similar to what I will do. Lets say that I have a RGB LED and using 3 pots to control each base color I make a combination that I store in button A, then I make another combination in button B so now that I have that I can go from one combination to the other when I press button A or B... I think that if I can do THAT my project will be done!

  2. going back to the pot thing, can it be done? can one store the value of a normal analog pot and recall that value without physically moving the pot? or do I need a digital pot?

I can't believe it.
You criticise me for telling a beginner about an array and then you recommend him use a STL!

Grumpy_Mike:
I can't believe it.
You criticise me for telling a beginner about an array and then you recommend him use a STL!

LOL! Well I was joking, but I only explained the STL because he asked. I don't think he should try it. But if he really needs to store a list of numbers the Vector might be easier than an array.

To answer his questions, there is no such thing as a digital pot. All pots are variable resistors. When you measure their value you ger a number, which you then store in memory. What you want to do is very straightforward and is something a beginner to programming can handle.

there is no such thing as a digital pot

Well here is a list of 390 of them. These are just the non volatile ones

Where as these are 350 of the volatile ones

Grumpy_Mike:

there is no such thing as a digital pot

Well here is a list of 390 of them. These are just the non volatile ones
http://ie.farnell.com/jsp/search/browse.jsp?N=2016+202722&Ntk=gensearch&Ntt=digital+pot&Ntx=mode+matchallpartial

Where as these are 350 of the volatile ones
http://ie.farnell.com/jsp/search/browse.jsp?N=2016+204266&Ntk=gensearch&Ntt=digital+pot&Ntx=mode+matchallpartial

Hm, cool!

well the Arduino came a day early!!! so the way I see it I have to first be able to read 3 pots and store those values in button ¨A¨, then do the same to button ¨B¨ and ¨C¨, those stored values on each button have to be stored in the EEPROM so I can use them after I turn off the device and be overwritten if I want new pot values.

I don't know what you mean by "bottom," but let me suggest this. There are examples in the environment under the file menu. Start with the EEPROM example. Forget the pots for now. Make sure you understand everything about the EEPROM example, ask questions, then move on.