Register / Login  |  Desktop view  |  Jump to bottom of page

IoAbstraction & TaskManagerIO » Keyboardmanager and Matrixkeypad 1x5 [solved]

Author: NewOne
01/11/2020 13:30:10
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();

}


Author: NewOne
01/11/2020 15:06:21
ok, resolved.
Problem was the Baurate of the serial Interface.
Please remove this....




Register / Login  |  Desktop view  |  Jump to top of page