Bonjour,
Je suis en train de réaliser un clavier permettant de taper des elements Latex avec un Arduino Due et un clavier matriciel
Les touches ne tapent pas les suites de character mais seulement ù,9,5,7 ou Enter ou Suppr
Merci par avance pour votre aide
#include <Keypad.h>
#include <Keyboard.h>
const byte ROWS = 6; // nombre de lignes
const byte COLS = 18; // nombre de colonnes
const char* touches[ROWS][COLS] = {
{"\\alpha", "\\beta", "\\gamma", "\\Gamma", "\\delta", "\\Delta", "\\epsilon", "\\nu", "\\mu", "\\theta", "\\Phi", "\\rho", "\\tau", "\\sigma", "\\pi", "\\omega", "\\Omega","\\eta"}, // 18
{"\\times", "\\sum", "\\int", "\\iint", "\\iiint", "\\prodd", "\\otimes", "\\land", "\\frac{\\partial}{\partial t}", "\\frac{D}{Dt}", "\\vert", "\\sqrt{}", "+", "-", "\\div","\\pm", "\\mathcal{F}" }, // 18
{"\\chapter{}", "\\section{}", "\\subsection{}", "\\subsection{}", "\\begin{align}", "\\end{align}", "\\begin{equation}", "\\end{equation}", "\\begin{itemize}", "\\end{itemize}", "\\begin{enumerate}", "\\end{enumerate}", "\\begin{cases}", "\\end{cases}"}, // 13
{"\\dot{}", "\\ddot{}", "\\dddot{}", "\\overline{\\overline{}}", "\\overrightarrow{}", "_", "^", "{", "}", "\\left(", "\\right)", "\\left[", "\\right]", "\\mathbb{R}^1, \\mathbb{R}^2, \\mathbb{R}^3", "\\hat{}", "\\"}, // 18
{"\\infty", "\\leq", "<", "\\geq", ">", "\\neq", "\\in", "\\notin", "\\exists", "\\nexists", "\\cup", "\\cap", "\\perp", "\\parallel", "\\forall","\\sum"}, // 16
{ "=", "0", "1", "2", "3", "4", "5", "6", "7", "8", "9","\\","\[","\]"} // 14
};
byte lignesPins[ROWS] = {A1,A2,A4,A5,A7,A8};
byte colonnesPins[COLS] ={A0,20,23,25,27,29,33,35,37,39,41,45,47,49,32,36,38,40};
Keypad clavier = Keypad(makeKeymap((char*)touches), lignesPins, colonnesPins, ROWS, COLS);
void setup() {
Serial.begin(9600);
}
void loop() {
char touche = clavier.getKey();
if (touche) {
Serial.print("Touche pressee : ");
Serial.println(touche);
}
if (Serial.available() > 0) {
char key = Serial.read();
Keyboard.write(key);
}
}