Skip to content

Commit

Permalink
Merge pull request #31 from per1234/digitalpotcontrol-delays
Browse files Browse the repository at this point in the history
Add necessary delays to SPI DigitalPotControl example
  • Loading branch information
pnndra authored May 7, 2019
2 parents c8f8d76 + 341a026 commit eba33b8
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,11 @@ void loop() {
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);
}

0 comments on commit eba33b8

Please sign in to comment.