Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
A
ArduinoCore-avr
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Analytics
Analytics
Repository
Value Stream
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Commits
Open sidebar
xpstem
ArduinoCore-avr
Commits
380241dd
Commit
380241dd
authored
Apr 02, 2018
by
SimonePDA
Committed by
Martino Facchin
Apr 12, 2018
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update DigitalPotControl.ino
Fixing SPI communication with a delay as pointe out in #6395
parent
3d09a51b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
0 deletions
+2
-0
libraries/SPI/examples/DigitalPotControl/DigitalPotControl.ino
...ries/SPI/examples/DigitalPotControl/DigitalPotControl.ino
+2
-0
No files found.
libraries/SPI/examples/DigitalPotControl/DigitalPotControl.ino
View file @
380241dd
...
...
@@ -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
);
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment