Skip to content

Commit 2729d38

Browse files
SimonePDAper1234
authored andcommitted
Add necessary delays to SPI DigitalPotControl example
According to arduino/Arduino#6395, these delays are required for the SPI communication with the digital potentiometer to work.
1 parent 00f50b3 commit 2729d38

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

libraries/SPI/examples/DigitalPotControl/DigitalPotControl.ino

Lines changed: 2 additions & 0 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy