Skip to content

Commit 380241d

Browse files
SimonePDAfacchinm
SimonePDA
authored andcommitted
Update DigitalPotControl.ino
Fixing SPI communication with a delay as pointe out in #6395
1 parent 3d09a51 commit 380241d

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

Diff for: libraries/SPI/examples/DigitalPotControl/DigitalPotControl.ino

+2
Original file line numberDiff line numberDiff line change
@@ -63,9 +63,11 @@ void loop() {
6363
void digitalPotWrite(int address, int value) {
6464
// take the SS pin low to select the chip:
6565
digitalWrite(slaveSelectPin, LOW);
66+
delay(100);
6667
// send in the address and value via SPI:
6768
SPI.transfer(address);
6869
SPI.transfer(value);
70+
delay(100);
6971
// take the SS pin high to de-select the chip:
7072
digitalWrite(slaveSelectPin, HIGH);
7173
}

0 commit comments

Comments
 (0)