Max Display Driver chip Setup-Error Msg- Arduino 4 Dummies Keypad LED Entry

I uploaded the sketch from an existing library from the Arduino Projects for Dummies Book.

https://www.dummies.com/store/product/Arduino-Projects-For-Dummies.productCd-1118551478,navId-322496,descCd-DOWNLOAD.html

Regarding the MAX72xx, when i load the sketch i get the following error message

‘SPI’ was not declared in this scope

I don’t know why I am getting this message. Below is the section of code it is referring to…

void sendCommand(int command, unsigned char value)
{
digitalWrite(slaveSelect,LOW); // Chip select is active when pin is LOW
SPI.transfer(command); // Send the First byte of data to the MAX72xx
SPI.transfer(value); // Send the Second byte of data
digitalWrite(slaveSelect,HIGH); // Release the chip - signals end of data transfer
}

Please see this Read this before posting a programming question and follow the instructions to post your full sketch here

Did you #include the SPI library in your sketch ?

Please do this:

  • When you encounter an error, you’ll see a button on the right side of the orange bar “Copy error messages” in the Arduino IDE (or the icon that looks like two pieces of paper at the top right corner of the black console window in the Arduino Web Editor). Click that button…
  • In a forum reply here, click on the reply field.
  • Click the </> button on the forum toolbar. This will add the forum’s code tags markup to your reply.
  • Press “Ctrl + V”. This will paste the error between the code tags.
  • Move the cursor outside of the code tags before you add any additional text to your reply.

If the text exceeds the forum’s 9000 character limit, save it to a .txt file and post it as an attachment. If you click the “Reply” button here, you will see an “Attachments and other settings” link that will allow you to make the attachment.

I've deleted your other cross-post @joanofarc77.

We're here, trying to help you if you'll only provide us the information we need to do that. In the time you spent cross-posting, you could have done that and you'd already have an answer to your problem and be back to having fun with Arduino.

Cross-posting is against the rules of the forum. The reason is that duplicate posts can waste the time of the people trying to help. Someone might spend 15 minutes (or more) writing a detailed answer on this topic, without knowing that someone else already did the same in the other topic.

Repeated cross-posting will result in a suspension from the forum.

In the future, please take some time to pick the forum board that best suits the topic of your question and then only post once to that forum board. This is basic forum etiquette, as explained in the sticky "How to use this forum - please read." post you will find at the top of every forum board. It contains a lot of other useful information. Please read it.

Thanks in advance for your cooperation.