Skip to content

Digital Potentiometer code example needs delay added #6395

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
mlfergy opened this issue Jun 19, 2017 · 3 comments
Closed

Digital Potentiometer code example needs delay added #6395

mlfergy opened this issue Jun 19, 2017 · 3 comments
Labels
Component: Documentation Related to Arduino's documentation content

Comments

@mlfergy
Copy link

mlfergy commented Jun 19, 2017

https://www.arduino.cc/en/Tutorial/DigitalPotControl

The code needs a delay to work:

void digitalPotWrite(int address, int value) {
// take the SS pin low to select the chip:
digitalWrite(slaveSelectPin, LOW);
delay(100);
// send in the address and value via SPI:
SPI.transfer(address);
SPI.transfer(value);
delay(100);
// take the SS pin high to de-select the chip:
digitalWrite(slaveSelectPin, HIGH);
}

@matthijskooijman
Copy link
Collaborator

Are you using the exact same chip as mentioned in that tutorial? Did you look up the amount of delay needed in the datasheet? 50ms sounds like a lot more than a typical chip would require.

@mlfergy
Copy link
Author

mlfergy commented Jun 19, 2017 via email

@per1234 per1234 added the Component: Documentation Related to Arduino's documentation content label Aug 3, 2017
SimonePDA pushed a commit that referenced this issue Apr 2, 2018
Fixing SPI communication with a delay as pointe out in #6395
@SimonePDA
Copy link

Fixed the sketch, thanks a lot for your testing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Component: Documentation Related to Arduino's documentation content
Projects
None yet
Development

No branches or pull requests

4 participants