From 2729d38cd95d2235e8caa8819439450056c57a62 Mon Sep 17 00:00:00 2001 From: SimonePDA Date: Mon, 2 Apr 2018 19:18:50 +0200 Subject: [PATCH] Add necessary delays to SPI DigitalPotControl example According to https://github.com/arduino/Arduino/issues/6395, these delays are required for the SPI communication with the digital potentiometer to work. --- libraries/SPI/examples/DigitalPotControl/DigitalPotControl.ino | 2 ++ 1 file changed, 2 insertions(+) diff --git a/libraries/SPI/examples/DigitalPotControl/DigitalPotControl.ino b/libraries/SPI/examples/DigitalPotControl/DigitalPotControl.ino index b135a74f..a06f1133 100644 --- a/libraries/SPI/examples/DigitalPotControl/DigitalPotControl.ino +++ b/libraries/SPI/examples/DigitalPotControl/DigitalPotControl.ino @@ -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); } 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