Digital Pot as volume

hey guys, I am using ds1845 as digital pot as a volume controller.
I am not getting the code to run Pl help
check attached code

test_5.ino (3.23 KB)

The code does something. Don't keep us in the dark.

Yes it increases the vol up when press button up key and similarly for down lower key...the logic works but the volume remains the same no change :frowning: Though I am using simple wire library
tried changing the address like 7bit addressing or B10100000 >>1 , 0x50 nothing works.
Basically I am writing to pot 0 assigned to F9 and pot 1 to F8.

Any help??

Yes it increases the vol up when press button up key and similarly for down lower key...the logic works but the volume remains the same no change

It increases and decreases the volume, but the volume remains the same? You lost me right there.

void volumeUp()
{ 
  set_Volume(vol);
  vol++;

Shouldn't you add one before setting the volume?

Can you run the I2C scanner on this page and report the results?

Thank You Nick for the reply.
Here's what my serial monitor displays the result: Its the same address I am using.

.I2C scanner. Scanning ...
.Found address: 80 (0x50)
.Done.
.Found 1 device(s).

Regarding the volume I mean when I press up button the serial monitors prints the vol up in range of 0-100 and decreases when I press down. But no change in the volume which the music is played. Sorry for the confusion.

That confirms that you are using the right address:

#define DS1845_Address1 0x50 //Device address for DS1845 with A2=0 A1=0 A0=0

It also confirms the device is wired up correctly and is responding. How have you wired it? You seem to be using pot 0.

Since you have debugging displays how about copying and pasting them here?

Hi,
Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png or pdf?

Tom... :slight_smile:

My basic test circuit:
Pins:
1 and 2: I am connecting pins 1 and 2 as sda and scl uvia pull ups.
3,4 & 5: A0,A1,A2 to gnd as address is 0x50
6: wp is Internally pulled high left it open
7: Gnd

8 & 10: L0 and L1 = Gnd
9 & 12: W0 and W1 Checking outputs as per pot written for ex if i write to F9 pot 0
11 & 13 H0 & H1 = 5V
14: Vcc 5V

Now using this test circuit I should write to pot0 and read output at w0 varying from 0 to 5V.

But my application circuit is diiferent I can post it once we get over this basic test ircuit working

Hi,

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png or pdf?

What arduino are you programming?

Tom..... :slight_smile:

It worked (DS1803) !! I am using Uno. But not with Ds1845