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

    Does anybody want to share his code for the keyboard M5Stack?

    Scheduled Pinned Locked Moved FACES Kit
    4 Posts 3 Posters 10.2k 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.
    • B Offline
      BitBoy01
      last edited by

      I really would like to learn with them.
      Thank you!

      1 Reply Last reply Reply Quote 0
      • hagueH Offline
        hague
        last edited by

        Hi BitBoy01.
        With this code, I was able to print the keyboard data on the LCD:

        #include <Arduino.h>
        #include <M5Stack.h>
        
        #define CARDKB_ADDR 0x5F
        
        void setup()
        {
          M5.begin();
          Wire.begin();
        
          // Lcd display init
          M5.Lcd.setBrightness(10);
          M5.Lcd.fillScreen(BLACK);
          M5.Lcd.setCursor(0, 0);
          M5.Lcd.setTextColor(WHITE);
          M5.Lcd.setTextSize(2);
          M5.Lcd.println("Grove Keyboard");
          M5.Lcd.println("Version 0.1 10.09.2019");
        
          M5.Lcd.printf("\n");
          M5.Lcd.printf("IIC Address: 0x5F\n");
          M5.Lcd.printf("\n");
        }
        void loop()
        {
          Wire.requestFrom(CARDKB_ADDR, 1);
          while (Wire.available())
          {
            char c = Wire.read(); // receive a byte as character
            if (c != 0)
            {
              if (c == 13)
                M5.Lcd.printf("\n"); // 13 is the new line code
              else
                M5.Lcd.printf("%c", c); // print as character
            }
          }
        }
        

        Hope that helps...

        1 Reply Last reply Reply Quote 0
        • B Offline
          BitBoy01
          last edited by

          Thank you! It is quite nice for the beginning.

          1 Reply Last reply Reply Quote 0
          • lukasmaximusL Offline
            lukasmaximus
            last edited by

            There's some example code on the github here:

            https://github.com/m5stack/M5Stack/blob/master/examples/Unit/CardKB/CardKB.ino

            https://github.com/m5stack/M5-ProductExampleCodes/tree/master/Unit/CARDKB

            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