Heute vorgestellt: 4x4 Keypad - AZ-Delivery

Oggi vorremmo mostrarti come farlo Tastiera di consegna AZ  più semplice da eseguire su un Arduino. Nel nostro esempio, i tasti vengono emessi sul monitor seriale. L'uso di Libary di Mark Stanley lo rende particolarmente facile da usare e l'esempio sul monitor seriale è utile, poiché può essere facilmente trasferito non solo sul PC ma anche sul nostro HC-05  Moduli o Schermi GSM, La funzione della tastiera è abbastanza semplice, ogni tasto corrisponde a un interruttore.

E così spariamo alla nostra tastiera:

il codice è relativamente autoesplicativo:

 

/ * @file CustomKeypad.pde
|| @version 1.0
|| @author Alexander Brevig
|| @contact alexanderbrevig@gmail.com
||
|| @description
|| | Dimostra di cambiare le dimensioni della tastiera e i valori chiave.
|| Modificato per la tastiera AZ-Delivery da MN
|| #
*/
#include <tastiera.B>

const byte RIGHE = 4; // quattro righe
const byte COLS = 4; // quattro colonne
// definisce i simboli sui pulsanti delle tastiere
carbonizzare HEXAKeys[RIGHE][COLS] = {   {'1','2','3','A'},   {'4','5','6','B'},   {'7','8','9','C'},   {'*','0','#','D'}
};
byte rowPins[RIGHE] = {11, 10, 9, 8}; // si collega ai pin di riga della tastiera
byte colPins[COLS] = {7, 6, 3, 2}; // si collega ai piedini della colonna della tastiera

// inizializza un'istanza della classe NewKeypad
tastiera customKeypad = tastiera( makeKeymap(HEXAKeys), rowPins, colPins, RIGHE, COLS); 

vuoto configurazione(){   serial.iniziare(9600);
}    vuoto cappio(){   carbonizzare CustomKey = customKeypad.getKey();      se (CustomKey){     serial.println(CustomKey);   }
}

La tastiera è disponibile qui:Tastiera 4x4

Il giusto microcontrollore: Microcontrollore, compatibile con Arduino Uno R3

 

 

Produktvorstellungen

2 commenti

Bodo

Bodo

Frage: Sind die Tasten bereits entprellt?

Wolfgang Kreinberg

Wolfgang Kreinberg

Danke für diese Darstellung. Ich habe bei Euch das keypad gekauft und entsprechend der Anleitung im eBook angeschlossen. Es ging eine Spalte nicht. Nach einigem Versuch und Irrtum kam ich drauf, dass D1 nicht genutzt werden kann, ich habe von D1 auf D8 umgelegt und im Sketch angepasst, dass war es. In diesem Beispiel fangt Ihr bewusst oder zufällig bei D2 an, das sollte auch funktionieren.
Gruß und bitte weiter so!
Wolfgang

Lascia un commento

Tutti i commenti vengono moderati prima della pubblicazione