Hi, i am using the tcMenu library on a Df_Robot-Shield, everything is working fine.
Now i wanna use another keypad, a maxtrix keypad with 5 Buttons: Up, Down, Left, Right, Select. Ok, i know that i don't need the Left and the right button.
I tested the keypad with an example of the TaskManagerIO-Library, everything is ok.
How can i use the keypad instead of the buttons of the Df_Robot-Shield ?
How can i "tell" the MenuManager which button is for uo, which for dwon and which for select ?
#include <KeyboardManager.h>
#include <tcMenuKeyboard.h>
const char pgmLayout[] PROGMEM = "LRUDS";
KeyboardLayout keyLayout(1, 5, pgmLayout);
MatrixKeyboardManager keyboard;
MenuEditingKeyListener menuKeyListener;
extern AnalogMenuItem menuCurrent;
extern AnalogMenuItem menuVoltage;
extern AnalogMenuItem menuADCount;
extern AnalogMenuItem menuIst;
extern AnalogMenuItem menuSmooth;
extern EnumMenuItem menuCompMode;
extern AnalogMenuItem menuMaxwert;
extern AnalogMenuItem menuBuerde;
extern AnalogMenuItem menuMessage;
extern AnalogMenuItem menuDelay;
extern AnalogMenuItem menuCoOff;
extern AnalogMenuItem menuCoOn;
extern BooleanMenuItem menuRunStatus;
extern AnalogMenuItem menuDruck;
void setup() {
Serial.begin (9600);
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(ioUsingArduino(), &keyLayout, &menuKeyListener);
// start repeating at 850 millis then repeat every 350ms
keyboard.setRepeatKeyMillis(850, 350);
Serial.println("Keyboard is initialised!");
setupMenu();
}
void loop() {
taskManager.runLoop();
}