Navigation

    M5Stack Community

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    1. Home
    2. kasperhvid
    K
    • Continue chat with kasperhvid
    • Start new chat with kasperhvid
    • Flag Profile
    • Profile
    • Following
    • Followers
    • Blocks
    • Topics
    • Posts
    • Best
    • Groups
    Save
    Saving

    kasperhvid

    @kasperhvid

    0
    Reputation
    1
    Posts
    94
    Profile views
    0
    Followers
    0
    Following
    Joined Last Online

    kasperhvid Follow

    Posts made by kasperhvid

    • UHF RFID unit problems interfacing with arduino mega using code example from github

      Hello,

      I have purchased your reader and i am trying to port the library from this url:

      https://github.com/m5stack/M5Unit-UHF-RFID

      To work on an arduino mega. So far i'm not having much luck. I can't even get the UHF RFID unit to print its version using getVersion in setup void much less read my tags..

      I have made the following changes to the .begin void in order to accomodate it being a mega:

      /*! @brief Initialize the Unit UHF_RFID.*/
      void Unit_UHF_RFID::begin(HardwareSerial *serial, long baud, bool debug) {
         _debug  = debug;
         _serial = serial;
         _serial->begin(baud);
      }
      

      And then my setup void looks like this:

      #include "Unit_UHF_RFID.h"
      
      Unit_UHF_RFID uhf;
      
      String info = "";
      
      void setup() {
       // put your setup code here, to run once:
       Serial.begin(9600);
       Serial.println("Serial begin");
      
       uhf.begin(&Serial2, 115200, false);
      
       Serial.println("Serial begin2");
      
       while (1) {
         info = uhf.getVersion();
         Serial.println("Version: "+info);
         if (info != "ERROR") {
           Serial.println(info);
           break;
         }
       }
       Serial.println("Version: "+info);
       // max: 26dB
       uhf.setTxPower(2600);
      
      
      }
      

      Hope someone can help me understand why this isn't working..

      posted in Units
      K
      kasperhvid