Does anybody want to share his code for the keyboard M5Stack?
-
I really would like to learn with them.
Thank you! -
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...
-
Thank you! It is quite nice for the beginning.
-
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
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