Error on SS_PIN = 10 while using SD card reader and RFID reader

I am creating a toolbox that can log the tools taken from the toolbox.
Im using an RFID reader and an SD card reader at the same time.
it seems like i have a problem between the two components.
if anyone has a clue about it please tell

the part of the code that gives error
//rfid reader
#include <SPI.h>
#include <MFRC522.h>

#define SS_PIN 10 <---------- error
#define RST_PIN 9
MFRC522 mfrc522(SS_PIN, RST_PIN);

//SD
#include <SD.h>
#define CS_SD 4
File myFile;

The error.......
error: expected unqualified-id before numeric constant
C:\Program Files (x86)\Arduino\libraries\SD\src/utility/Sd2PinMap.h:432:15: note: in expansion of macro 'SS_PIN'
uint8_t const SS_PIN = 10;
^~~~~~
exit status 1
expected unqualified-id before numeric constant

//#define SS_PIN 10 <--

Should fix it.

#define SS_PIN 10 <---------- error

Remove this line

cant remove it because it is a part of the code for the RFID code

//rfid reader værdier
#include <SPI.h>
#include <MFRC522.h>

#define SS_PIN 10
#define RST_PIN 9
MFRC522 mfrc522(SS_PIN, RST_PIN);

//SD værdier
#include <SD.h>
#define CS_SD 4
File myFile;

//værktøjs værdier
const int ledSvendsknolge = 8;
const int ledUmbraco = 7;
const int ledKoben = 6;
int switchStatus = 0;
int wait = 2000;
int svendsknolgePa=1;
int svendsknolgeAf=0;
int umbracoPa=1;
int umbracoAf=0;
int kobenPa=1;
int kobenAf=0;

String vogn="Værktøjsvogn 1";
String svendsknolge="Svendsknølge = ";
String umbraco="Umbraco = ";
String koben="Koben = ";

void setup() {
//setup til rfid reader
Serial.begin(9600); // Initiate a serial communication
SPI.begin(); // Initiate SPI bus
mfrc522.PCD_Init(); // Initiate MFRC522
delay(4);
Serial.println("Approximate your card to the reader...");
Serial.println();
//setup til værktøj af og på
pinMode(ledSvendsknolge, INPUT);
pinMode(ledUmbraco, INPUT);
pinMode(ledKoben, INPUT);
//setup for SD kort
Serial.print("Initializing SD card...");
if(!SD.begin(CS_SD)) {
Serial.println("initialization failed!");
return;
}
Serial.println("initialization done.");

}

void loop() {
// loop for rfid reader
// Look for new cards
if ( ! mfrc522.PICC_IsNewCardPresent())
{
return;
}
// Select one of the cards
if ( ! mfrc522.PICC_ReadCardSerial())
{
return;
}
//Show UID on serial monitor
Serial.print("UID tag :");
String content= "";
byte letter;
for (byte i = 0; i < mfrc522.uid.size; i++)
{
Serial.print(mfrc522.uid.uidByte[i] < 0x10 ? " 0" : " ");
Serial.print(mfrc522.uid.uidByte[i], HEX);
content.concat(String(mfrc522.uid.uidByte[i] < 0x10 ? " 0" : " "));
content.concat(String(mfrc522.uid.uidByte[i], HEX));
}
Serial.println();
Serial.print("Message : ");
content.toUpperCase();
if (content.substring(1) == "2C 8D F0 37" or content.substring(1) == "9E BD 1D C2") //change here the UID of the card/cards that you want to give access
{
Serial.println("velkommen");
delay(300);
}

else {
Serial.println(" Access denied");
delay(300);
}
if (content.substring(1) == "2C 8D F0 37")
{
Serial.println("Test person");
delay(300);
}
if (content.substring(1) == "9E BD 1D C2")
{
Serial.println("Anders Mark Sorensen");
delay(300);
}
//loop for værktøj
{
Serial.print(vogn);
Serial.println("");
Serial.print("----------------");
Serial.println("");

switchStatus = digitalRead(ledSvendsknolge);
if (switchStatus == HIGH)
{
Serial.print(svendsknolge);
Serial.println(svendsknolgePa);
}
else{
Serial.print(svendsknolge);
Serial.println(svendsknolgeAf);
}
switchStatus = digitalRead(ledUmbraco);
if (switchStatus == HIGH)
{
Serial.print(umbraco);
Serial.println(umbracoPa);
}
else{
Serial.print(umbraco);
Serial.println(umbracoAf);
}
switchStatus = digitalRead(ledKoben);
if (switchStatus == HIGH)
{
Serial.print(koben);
Serial.println(kobenPa);
}
else{
Serial.print(koben);
Serial.println(kobenAf);
}
delay(wait);
}
}

Move the #include <SD.h> up to the top,and comment, or delete the line you have already been told.

Please remember to use code tags when posting code

thanks a lot
still pretty new to all of this

This topic was automatically closed 120 days after the last reply. New replies are no longer allowed.