exit status 1 'WIEGAND_26BIT' was not declared in this scope

Hi! I’m new with Arduino and I need some help. I keep getting this error:

exit status 1
‘WIEGAND_26BIT’ was not declared in this scope

Here’s my code:

#include <SeeedRFIDLib.h>
#include <SoftwareSerial.h>
// SoftwareSerial must be included because the library depends on it
// If you use the Library in Wiegand Mode, then the compiler
// will optimize the SoftwareSerial away

// Configure the Library in Wiegand Mode
// DATA0 of the RFID Reader must be connected
// to Pin 2 of the Arduino (INT0)
// DATA1 of the RFID Reader must be connected
// To Pin 3 of the Arduino (INT1)
SeeedRFIDLib RFID(WIEGAND_26BIT);
RFIDTag tag;

void setup()
{
Serial.begin(57600);
}
void loop()
{
if(RFID.isIdAvailable()) {
tag = RFID.readId();
// In Wiegand Mode, we only get the card code
Serial.print("CC = ");
Serial.println(tag.id);
}
}

Can someone help me, please?
Thank you. :slight_smile:

Hello

'WIEGAND_26BIT' was not declared in this scope -> That's the solution, maybe you should declare something before "SeeedRFIDLib RFID(WIEGAND_26BIT); " :p

Hi,
Welcome to the forum.

Please read the first post in any forum entitled how to use this forum.
http://forum.arduino.cc/index.php/topic,148850.0.html then look down to item #7 about how to post your code.
It will be formatted in a scrolling window that makes it easier to read.

Thanks… Tom… :slight_smile:

To get that constant declared you have to uncomment the "// #define HAVE_RFID_WIEGAND" line in SeeedRFIDLib.h

Thank you for replying to my post. I still don’t understand what you’re all talking about. Sorry. But here’s the SeeedRFIDLib.h code:

/**

  • Definitions and methods for RFID tag scanning and
  • the whole shebang of getting the tags out of the reader
  • (c) 2011, 2012 Johann Richard
  • Licensed under the MIT license
  • http://www.opensource.org/licenses/mit-license.php.
    */
    #ifndef SeeedRFIDLib_h
    #define SeeedRFIDLib_h

// #define DEBUG true // Use this if you want to debug your RFID stuff

#define HAVE_RFID_UART
#define HAVE_RFID_WIEGAND

#if ! defined(HAVE_RFID_UART) && ! defined(HAVE_RFID_WIEGAND)

error No RFID driver has been enabled, set HAVE_RFID_UART or HAVE_RFID_WIEGAND

#endif

#include <SoftwareSerial.h>
#include “Arduino.h”

/****

  • Struct for storing an RFID tag
    */
    struct RFIDTag {
    int mfr; // Manufacturer (?) Code (2 bytes), only useful in UART Mode
    long id; // Tag ID (3 bytes)
    byte chk; // Checksum (1 byte), only useful in UART Mode
    boolean valid; // Validity of the Tag, based on the Checksum (UART Mode) or the parity bits (Wiegand Mode)
    char raw[13]; // The whole tag as a raw string, only useful in UART Mode
    };

enum RFIDLibType {
#ifdef HAVE_RFID_UART
RFID_UART

ifdef HAVE_RFID_WIEGAND

,

endif

#endif
#ifdef HAVE_RFID_WIEGAND
RFID_WIEGAND
#endif
};

#define MAX_BITS 100

// RFID Electronic Brick from Seeedstudio has 26 Bit Wiegand
#define SEEED_EBRICK_RFID 26
#ifdef HAVE_RFID_WIEGAND
#define WIEGAND_26BIT 26
#define WIEGAND_35BIT 35
#endif
/***

  • Class for reading and checking RFID tags (UART Mode)
    */
    class SeeedRFIDLib
    {
    private:
    SoftwareSerial * _rfidIO;
    RFIDTag _tag;
    RFIDLibType _libType;
    byte _bytesRead;
    byte _dataLen;
    boolean _idAvailable;
    #ifdef HAVE_RFID_WIEGAND
    volatile unsigned static char _databits[MAX_BITS]; // stores all of the data bits
    volatile unsigned static char _bitCount;
    unsigned long _facilityCode; // decoded facility code
    unsigned long _cardCode;
    void resetWiegand();
    static void DATA0(void);
    static void DATA1(void);
    boolean checkParity26();
    boolean isIdAvailableWiegand();
    #endif
    #ifdef HAVE_RFID_UART
    boolean isIdAvailableUART();
    #endif
    public:
    #ifdef HAVE_RFID_UART
    SeeedRFIDLib(int rxPin, int txPin);
    #endif
    #ifdef HAVE_RFID_WIEGAND
    SeeedRFIDLib(int dataLen);
    #endif
    boolean isIdAvailable();
    RFIDTag readId();
    void restart();
    #ifdef HAVE_RFID_UART
    static long hex2dec(String hexCode);
    #endif
    };
    #endif // SeeedRFIDLib

Again, sorry. This is really my first time to use Arduino. :slight_smile:

Your sketch compiles fine for me. I recommend you re-install the library.