C/C++ Question need helep wrap i2c mfrc522

Discussion in 'Libraries developers questions' started by tzfpg, Feb 16, 2019.

  1. tzfpg

    tzfpg Member Licensed User

    i try to wrap the i2c mfrc522 library, i start with simple function LogVersion.
    after wrap i get the erro when use it.

    error code:
    Code:
    B4R Version: 2.51
    Parsing code.    (
    0.00s)
    Compiling code.    (
    0.02s)
    Building project    (
    0.03s)
    Compiling & deploying Ino project (LOLIN(WEMOS) D1 R2 & mini - COM5)    Error
    Loading configuration...
    Initializing packages...
    Preparing boards...
    Verifying...
    In file included from C:\Users\drago\OneDrive\Desktop\rMFRC522\Test1\Objects\bin\sketch\B4RDefines.h:25:0,
                     from C:\Users\drago\OneDrive\Desktop\rMFRC522\Test1\Objects\src\src.ino:
    1:
    rI2CMFRC522.h:
    11:4: error: 'MFRC522_I2C' does not name a type
        MFRC522_I2C rfid;
        ^
    In file included from C:\Users\drago\OneDrive\Desktop\rMFRC522\Test1\Objects\bin\sketch\B4RDefines.h:25:0,
                     from C:\Users\drago\OneDrive\Desktop\rMFRC522\Test1\Objects\bin\sketch\B4RArduino.cpp:
    1:
    rI2CMFRC522.h:
    11:4: error: 'MFRC522_I2C' does not name a type
        MFRC522_I2C rfid;
        ^
    In file included from C:\Users\drago\OneDrive\Desktop\rMFRC522\Test1\Objects\bin\sketch\B4RDefines.h:25:0,
                     from C:\Users\drago\OneDrive\Desktop\rMFRC522\Test1\Objects\bin\sketch\B4RCore.cpp:
    1:
    rI2CMFRC522.h:
    11:4: error: 'MFRC522_I2C' does not name a type
        MFRC522_I2C rfid;
        ^
    In file included from C:\Users\drago\OneDrive\Desktop\rMFRC522\Test1\Objects\bin\sketch\B4RDefines.h:25:0,
                     from C:\Users\drago\OneDrive\Desktop\rMFRC522\Test1\Objects\bin\sketch\b4r_main.cpp:
    1:
    rI2CMFRC522.h:
    11:4: error: 'MFRC522_I2C' does not name a type
        MFRC522_I2C rfid;
        ^
    In file included from C:\Users\drago\OneDrive\Desktop\rMFRC522\Test1\Objects\bin\sketch\B4RDefines.h:25:0,
                     from C:\Users\drago\OneDrive\Desktop\rMFRC522\Test1\Objects\bin\sketch\Scheduler.cpp:
    2:
    rI2CMFRC522.h:
    11:4: error: 'MFRC522_I2C' does not name a type
        MFRC522_I2C rfid;
        ^
    In file included from C:\Users\drago\OneDrive\Desktop\rMFRC522\Test1\Objects\bin\sketch\B4RDefines.h:25:0,
                     from C:\Users\drago\OneDrive\Desktop\rMFRC522\Test1\Objects\bin\sketch\B4RStream.cpp:
    1:
    rI2CMFRC522.h:
    11:4: error: 'MFRC522_I2C' does not name a type
        MFRC522_I2C rfid;
        ^
    In file included from C:\Users\drago\OneDrive\Desktop\rMFRC522\Test1\Objects\bin\sketch\B4RDefines.h:25:0,
                     from C:\Users\drago\OneDrive\Desktop\rMFRC522\Test1\Objects\bin\sketch\rI2CMFRC522.cpp:
    1:
    rI2CMFRC522.h:
    11:4: error: 'MFRC522_I2C' does not name a type
        MFRC522_I2C rfid;
        ^
    exit status 1
    C:\Users\drago\OneDrive\Desktop\rMFRC522\Test1\Objects\bin\sketch\rI2CMFRC522.cpp: 
    In member function 'void B4R::I2CMFRC522::Initialize(Byte, B4R::SubVoidArrayByte)':
    rI2CMFRC522.cpp:6:19: error: 'rfid' was not declared in this scope
       rfid(chipAddress);
                       ^
    C:\Users\drago\OneDrive\Desktop\rMFRC522\Test1\Objects\bin\sketch\rI2CMFRC522.cpp: 
    In member function 'void B4R::I2CMFRC522::LogVersion()':
    rI2CMFRC522.cpp:14:3: error: 'rfid' was not declared in this scope
       rfid.PICC_DumpToSerial();
       ^
    i attach the library. Hope someone can help me.
     

    Attached Files:

  2. Erel

    Erel Administrator Staff Member Licensed User

  3. tzfpg

    tzfpg Member Licensed User

  4. Laurent95

    Laurent95 Active Member Licensed User

    Hello all,

    @tzfpg :
    Indeed, compiler indicate you what's wrong, there aren't class named MFRC522_I2C but a class named MFRC522.
    I think in more that you need to change your code, you need to read all to understand better the things.
    I didn't tested anything, just reading at all, and i'm not a God in C++, but the class is named like that not like the library name.

    Regards.
     
    Last edited: Feb 18, 2019
  5. tzfpg

    tzfpg Member Licensed User

    Thank you all for yours replied. I already successful wrap the library.
    Now testing the library with the hardware, i'll share the library later.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice