An SPI library is now included in the Arduino software. See the SPI library reference for details.
Why doesn't my LED turn on after starting SPI ?
Why doesn't "digitalWrite(ledPin, HIGH);" work after starting SPI -- why doesn't my LED turn on?
After executing "SPI.begin();", the command "digitalWrite(ledPin, HIGH);" appears to do nothing.
Executing "SPI.begin();" configures the SCK and MOSI pins to be directly managed by the SPI hardware.
The SCK pin is Arduino pin 13, the LED pin.
The MOSI pin is Arduino pin 11.
How can I regain control of the LED pin?
Executing "SPI.end();" allows those pins to be used as general I/O again.
(The above pin numbers are for the ATmega328P-based Arduinos such as the Uno or Duemilanove.
For other Arduinos, see the SPI library pin number reference ).
Title
Arduino Newsletter
We care about the privacy and personal data of our users.
To continue, please give us your consent:
Please confirm that you have read the privacy policy
Thank you for subscribing!
Curious to learn more?
Are you also a teacher, student, or professional that loves using Arduino in your day-to-day activities?
Then keep up-to-date with either our STEM or Professional monthly newsletters.
Arduino weekly newsletter (already subscribed)
Educators can benefit from the ever growing tech that shapes our environment through fun cool projects.
Why not awe your boss with highly innovative ways to help keep your enterprise connected at no extra cost?
Arduino Survey
We'd like to get to know you little better.
Please help us improve by answering this super short optional survey.