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

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.

sorry my bad, it buttons... I was going to fix it but forgot too....

Ok, so I've had a few days testing this and now I'm back to square one... :~

Lets start simple, how do I read the value from an analog pot so I can store different values to different buttons?

My final proyect is to place the Arduino between the outputs of the pots on a pedal and the inputs that go to the board to first save and then load different outputValues of the pots:

... but that is the final idea, now I just wan't to know how to do it on 1 pot. I think I can use this http://arduino.cc/en/Tutorial/AnalogInOutSerial but need a way to save the outputValue that goes to the LED and save it in a button so I can load it when that button gets pressed. After that make it work with different outputValues of the pot to 3 buttons. If you guys can help me on this I can be on my way to complete my project.

I know I'm asking for maybe too much help but I don't seem to find a sketch to base my project from that uses all that I need.

Well yes you are asking a lot.
I have written this to read from the pot and print out the value when it is recalled.
You need two buttons, one to tell the system to store the pot value and the other to tell it to recall it.
Disclaimer:- This code compiles but I have not tested it.

// Sketch to read a pot on A0 and store the value in EEPROM
// when button1 is pressed. When buttonRecall is pressed the value is recoverd from the EEPROM and 
// printed out on the serial port
// Buttons wired between input pin and ground
#include <EEPROM.h>

#define button1 2      // button to store the pot value
#define buttonRecall 3  // button to recall the pot value
#define pot1Input 0     // analog input for pot 1

int pot1Value, lastButton1, recallValue1, lastButtonRecall;

 void setup(){
  pinMode(button1, INPUT); 
  digitalWrite(button1, HIGH); // turn on the internal pull up resistor
  pinMode(buttonRecall, INPUT); 
  digitalWrite(buttonRecall, HIGH); // turn on the internal pull up resistor
  Serial.begin(9600);
// initilise button variables
  lastButtonRecall = digitalRead(buttonRecall);
  lastButton1 = digitalRead(button1);
}

 void loop(){
   // get the value of the buttons
   int button1Value = digitalRead(button1);
   int buttonRecallVlaue = digitalRead(buttonRecall);
  
  if(button1Value == LOW && lastButton1 == HIGH) { // button pressed for the first time
   pot1Value = analogRead(pot1Input); // get the value on the pot
   // use the first two bytes in the EEPROM to store the 10 bit value from the pot
     EEPROM.write(0, pot1Value >> 8); // store the most significant byte
     EEPROM.write(1, pot1Value & 0xff); // store the least significant byte
     delay(20); // debounce dealy
  }
  
   if(buttonRecallVlaue == LOW && lastButtonRecall == HIGH) { // button pressed for the first time 
     recallValue1 = EEPROM.read(0) << 8; // get the most significant byte
     recallValue1 |= EEPROM.read(1); // merge it with the least significant byte
     delay(20); // debounce dealy
     // now do something with the recalled value
     // in this case just print it
     Serial.print("Recalled value is ");
     Serial.println(recallValue1);
  }
  // save for next time round the loop
  lastButtonRecall = buttonRecallVlaue;
  lastButton1 = button1Value; 
}

However, the difficult part in your project is presenting a pot value to the output. This vitally depends on what the output is being connected to and what voltages there are on that device.
This link shows you the basics:-

So I need to use a digital pot to have the different output pot values?

How else did you think you could do it?

Grumpy_Mike:
How else did you think you could do it?

Don't know, since I'm new at this I'm clueless on how all of this works together really! I thougth this works just like a pwm output.

Last couple of days I haven't taken time to make progress on this but I've been giving it thought, and I don't know if I have been looking at it from the wrong point of view. What I want this to do is just to store the value that's coming out of the pots on the pedal in say 3 different positions (at 25%, 60% and 100% of the pot) and use the Arduino to send that value out in to the pedals own board just like if I would have instantly change the pot manually.

PS:
This guy made something similar, but he stored different types of waves to generate different ways to make on pot move.

video: http://www.dailymotion.com/video/xa7til_collin-s-lab-guitar-pedal-hacking-w_school
code: Google Code Archive - Long-term storage for Google Code Project Hosting.

I thougth this works just like a pwm output.

This is what a PWM output does.
http://www.thebox.myzen.co.uk/Tutorial/PWM.html

Yes Colin used a digital pot. But note he did that with one pot on one peddle. Using multiple peddle is a bit more problematic
Read what I had to say about it in this thread:-

Hey guys, this thread seems relevant to me and I'm kind of getting lost here - I'm following all the links and reading the references... So I'd like to introduce my challenge and would appreciate a few pointers to help me sort the relevant things for me. I'm trying to "record" pot movement into an array, while using the data to move a servo. Then I wish to recall the data from the array (with a switch) and re create the same movement of the servo (i.e. move it again in the exact manner). What I can't wrap my around is how to create a process that stacks the continuous data from the servo into the array. I hope my "intrusion" into this thread is fine - It seems relevant here, right? :relaxed:
thank you.

update: figured it out! :smiley: I'm very pleased with myself... :wink:
Now I'm trying to figure out how to call the array in its different order using a switch.

Maybe you can help me out with my project? I'll send you a PM.

ElChiguete I would be happy to assist. Since I'm new at this I can only hope to be able to help. Let's do this here so all can benefit. :slight_smile:

Ok. Based on your project instead of ¨storing¨ a moving servo it would be like storing a couple of fix positions of that servo instead of the actual movement and recall them thru your switch (I want to store them in individual buttons).

So then, if I understand correctly you need to create variables containing the values (i.e. servo positions) and than create an "if.. else if" structure corresponding to each switch that is being pressed. Each switch sends out a different value to the servo. Seems fairly easy. BTW you can check my progress on my code over here:http://arduino.cc/forum/index.php/topic,96056.0.html. This could maybe help you