[Logo] TCC discussion forum
  [Search] Search   [Recent Topics] Recent Topics   [Hottest Topics] Hottest Topics   [Top Downloads] Top Downloads   [Groups] Back to home page 
[Register] Register /  [Login] Login 


This forum is read only and new users cannot register, please ask all new questions either using GitHub discussions, or in Arduino forum tagging @davetcc.

Keyboardmanager and Matrixkeypad 1x5 [solved] RSS feed
Forum Index » IoAbstraction & TaskManagerIO
Author Message
NewOne


Joined: Oct 21, 2020
Messages: 19
Offline
I have a Maxtrixkeypad with 1 row and 5 cols. The buttons are Left, Right, Up, Down and Select.
I tried the keypad library, everything works fine.
No i have tried to use it with the keyboardmanager, and i got a result like this "?????N????????9???a?X???????????????????5????????????N????????"
The IO-Pins are correct, Keypad.h is working fine....
Any idea whats wrong ?
#include <Wire.h>
#include <IoAbstraction.h>
#include<TaskManagerIO.h>
#include <KeyboardManager.h>

const char pgmLayout[] PROGMEM = "LRUDS";
KeyboardLayout keyLayout(1, 5, pgmLayout);

MatrixKeyboardManager keyboard;
IoAbstractionRef arduinoIo = ioUsingArduino();

class MyKeyboardListener : public KeyboardListener {
public:
    void keyPressed(char key, bool held) override {
        Serial.print("Key ");
        Serial.print(key);
        Serial.print(" is pressed, held = ");
        Serial.println(held);
    }

    void keyReleased(char key) override {
        Serial.print("Released ");
        Serial.println(key);
    }
} myListener;


void setup() {
    while(!Serial);
    Serial.begin(115200);

    keyLayout.setRowPin(0, 27);
    keyLayout.setColPin(0, 22);
    keyLayout.setColPin(1, 23);
    keyLayout.setColPin(2, 24);
    keyLayout.setColPin(3, 25);
    keyLayout.setColPin(4, 26);

    // create the keyboard mapped to arduino pins and with the layout chosen above.
    // it will callback our listener
    keyboard.initialise(arduinoIo, &keyLayout, &myListener);

    // start repeating at 850 millis then repeat every 350ms
    keyboard.setRepeatKeyMillis(850, 350);

    Serial.println("Keyboard is initialised!");

}

void loop() {
   taskManager.runLoop();

}

NewOne


Joined: Oct 21, 2020
Messages: 19
Offline
ok, resolved.
Problem was the Baurate of the serial Interface.
Please remove this....
 
Forum Index » IoAbstraction & TaskManagerIO
Go to:   
Mobile view
Powered by JForum 2.7.0 © 2020 JForum Team • Maintained by Andowson Chang and Ulf Dittmer

This site uses cookies to analyse traffic, serve ads by Google AdSense (non-personalized in EEA/UK), and to record consent. We also embed Twitter, Youtube and Disqus content on some pages, these companies have their own privacy policies.

Our privacy policy applies to all pages on our site

Should you need further guidance on how to proceed: External link for information about cookie management.