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

    Using CardKB (not hat) with M5StickC

    Scheduled Pinned Locked Moved M5 Stick/StickC
    3 Posts 2 Posters 5.7k Views 1 Watching
    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.
    • M Offline
      mich
      last edited by

      Hello,
      I'm trying to use CardKB with M5 Stick C through grove port. There is an example in the library (which looks like copy paste from M5Stack with only changed header name), but i couldn't make it work. One of the odd things is that messes with gpio5 which is connected to screen. Any suggestion on how to make CardKb work?
      Thanks

      #include <M5StickC.h>
      #include <Wire.h>

      #define CARDKB_ADDR 0x5F

      void setup()
      {
      M5.begin();
      Serial.begin(115200);
      Wire.begin();
      pinMode(5, INPUT);
      digitalWrite(5, HIGH);
      M5.Lcd.fillScreen(BLACK);
      M5.Lcd.setRotation(3);
      M5.Lcd.setCursor(1, 10);
      M5.Lcd.setTextColor(YELLOW);
      M5.Lcd.setTextSize(2);
      M5.Lcd.printf("IIC Address: 0x5F\n");
      M5.Lcd.printf(">>");
      }
      void loop()
      {
      Wire.requestFrom(CARDKB_ADDR, 1);
      while(Wire.available())
      {
      char c = Wire.read(); // re ceive a byte as characterif
      if (c != 0)
      {
      M5.Lcd.printf("%c", c);
      Serial.println(c, HEX);
      // M5.Speaker.beep();
      }
      }
      // delay(10);
      }

      1 Reply Last reply Reply Quote 0
      • ChrisWRC Offline
        ChrisWR
        last edited by

        
        
        #include <M5StickC.h>
        #include <Wire.h>
        
        #define CARDKB_ADDR 0x5F
        
        void setup()
        {
          M5.begin();
          Serial.begin(115200);
          Wire.begin();
          M5.Lcd.fillScreen(BLACK);
          M5.Lcd.setRotation(3);
          M5.Lcd.setCursor(1, 10);
          M5.Lcd.setTextColor(YELLOW);
          M5.Lcd.setTextSize(2);
          M5.Lcd.printf("IIC Address: 0x5F\n");
          M5.Lcd.printf(">>");
        }
        void loop()
        {
          Wire.requestFrom(CARDKB_ADDR, 1);
          while(Wire.available())
          {
            char c = Wire.read(); // receive a byte as characterif
            if (c != 0)
            {
              M5.Lcd.printf("%c", c);
              Serial.println(c, HEX);
             // M5.Speaker.beep();
            }
          }
          // delay(10);
        }
        
        
        
        1 Reply Last reply Reply Quote 0
        • M Offline
          mich
          last edited by

          Thanks! it works.

          1 Reply Last reply Reply Quote 0

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          • First post
            Last post