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)
RFIDTag tag;

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

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


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

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


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

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


#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 {





#define MAX_BITS 100

// RFID Electronic Brick from Seeedstudio has 26 Bit Wiegand
#define WIEGAND_26BIT 26
#define WIEGAND_35BIT 35

  • Class for reading and checking RFID tags (UART Mode)
    class SeeedRFIDLib
    SoftwareSerial * _rfidIO;
    RFIDTag _tag;
    RFIDLibType _libType;
    byte _bytesRead;
    byte _dataLen;
    boolean _idAvailable;
    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();
    #ifdef HAVE_RFID_UART
    boolean isIdAvailableUART();
    #ifdef HAVE_RFID_UART
    SeeedRFIDLib(int rxPin, int txPin);
    SeeedRFIDLib(int dataLen);
    boolean isIdAvailable();
    RFIDTag readId();
    void restart();
    #ifdef HAVE_RFID_UART
    static long hex2dec(String hexCode);
    #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.