I'm new to Arduino and while the tutorials are good they don't give me a clear example of what I want.
I want to be able to manually set the value (brightness) by using a normal pot... but use the digital pot to recall those stored values. I want to use a digital pot (like the AD5206) to be able to control lets say the output values of 2 LEDs and store them in 3 presets, for example:
- boton 1 will have LED A at max value and LED B at half value
- boton 2 will have both LEDs at half value
- and boton 3, have LED A at half value and LED B at max value
These presets will be recalled by presing one of 3 bottons so I can recall the different values (brigthness) of the two LEDs at the same time.
Can someone help me on this?
storing and recalling values on a digital pot using Arduino
Moderators: adafruit_support_bill, adafruit
Please be positive and constructive with your questions and comments.
- el chiguete
- Posts: 1
- Joined: Tue Jul 10, 2012 3:23 pm
- adafruit_support_mike
- Posts: 67454
- Joined: Thu Feb 11, 2010 2:51 pm
Re: storing and recalling values on a digital pot using Arduino
To read the manual-adjust pot, use one of the Arduino's analog inputs. That will give you a number between 0 and 1023 that represents the pot's position.
To drive a digital pot, divide that value by 4 to get a value between 0 and 255 (the AD5206 only has 256 possible output values) and send that value to the AD5206 using SPI.
Now, I'm not all that familiar with the AD5206, but it looks like something that produces a reference voltage, not something that actually throws current around. From what I can see in the datasheet, it prefers to operate below 1mA, which is far too little current to drive an LED.
I think you might want to look at Adafruit's programmable LEDs (and the chips that drive them) and store the preset values digitally (as variables in your Arduino sketch) rather than passing them to a digital pot.
To drive a digital pot, divide that value by 4 to get a value between 0 and 255 (the AD5206 only has 256 possible output values) and send that value to the AD5206 using SPI.
Now, I'm not all that familiar with the AD5206, but it looks like something that produces a reference voltage, not something that actually throws current around. From what I can see in the datasheet, it prefers to operate below 1mA, which is far too little current to drive an LED.
I think you might want to look at Adafruit's programmable LEDs (and the chips that drive them) and store the preset values digitally (as variables in your Arduino sketch) rather than passing them to a digital pot.
Please be positive and constructive with your questions and comments.