Commit 380241dd authored by SimonePDA's avatar SimonePDA Committed by Martino Facchin

Update DigitalPotControl.ino

Fixing SPI communication with a delay as pointe out in #6395
parent 3d09a51b
......@@ -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);
}
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment