🤖Have you ever tried Chat.M5Stack.com before asking??😎
    M5Stack Community
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Register
    • Login

    Core2 with 4IN8OUT module in Arduino IDE

    SOFTWARE
    1
    2
    68
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H
      HalloWere
      last edited by

      Hi! I've been trying to use this combination in my project, it worked fine in UIFow2 but I can't seem to get the 4in8out module working within Arduino IDE. I have ws1850s rfid module connected via A.I2C and that works fine so I'm not sure what's wrong..

      550d0c62-0ad3-4207-bc9c-926efd6ae0ae-image.png

      bf0644c9-f533-4e1f-b668-6fa1869fd778-image.png

      b7608d10-fbbb-44cd-8af5-a700a95b0060-image.png

      1 Reply Last reply Reply Quote 0
      • H
        HalloWere
        last edited by

        To anyone trying something similar in the future

        MODULE_4IN8OUT module;
        MFRC522_I2C mfrc522(0x28, -1, &Wire);
        
        void setup() {
            M5.begin(true, true, true, true);
            Serial.begin(115200);
            
            delay(500);  
            
            Serial.println("Starting setup...");
            M5.Lcd.println("Init...");
        
            // POWER MANAGEMENT dla Port A (RFID)
            M5.Axp.SetBusPowerMode(0);
            M5.Axp.SetLDOEnable(2, true);
            delay(200);
        
            // --- I2C BUSES ---
            Wire.begin(32, 33, 100000);
            Wire1.begin(21, 22, 100000);
            delay(100);
        
            M5.Lcd.println("Init 4IN8OUT...");
            
            // Start module 4IN8OUT
            if (!module.begin(&Wire1, 21, 22, MODULE_4IN8OUT_ADDR)) {
                M5.Lcd.setTextColor(RED);
                M5.Lcd.println("4IN8OUT INIT FAIL");
                Serial.println("4IN8OUT INIT FAIL");
                while (1) delay(1000);
            }
            
            M5.Lcd.setTextColor(GREEN);
            M5.Lcd.println("4IN8OUT OK!");
            Serial.println("4IN8OUT OK!");
            M5.Lcd.setTextColor(WHITE);
        
            // Init RFID
            mfrc522.PCD_Init();
            M5.Lcd.println("RFID OK!");
            Serial.println("RFID OK!");
        
        1 Reply Last reply Reply Quote 0
        • First post
          Last post