Keypade & Touchpad

Produtos visualizados

16 4x4 Buttons Keyboard Keypad Key Matrix PIC AVR Stamp Ver maior

Teclado 4x4

BE15000071

Novo produto

Esse produto já não se encontra disponível

9,84 € com IVA

Adicionar à Lista de desejos

Mais informação

MINI-4x4KEY is a 4x4 matrix keyboard module. It has 8 pins and 10 number 4 Letters on the interface.
8-PIN MRconnect hole.
+3.0V to +5VDC supply voltage.
On-board pulled-up resistors.
Small and compact in size.
Four mounting holes on each corner.
Dimension: 7 x 7.5 cm (approx).

  

 

Download:

The Matrix Keypad 4x4 Library

 

Code:

/* 

***************** Created by BoxElectrónica**********************

*/

#include <Keypad.h>

const byte ROWS = 4; // Four rows
const byte COLS = 4; // Four columns

// Define the Keymap
char keys[ROWS][COLS] = {
{'1','2','3','A'},
{'4','5','6','B'},
{'7','8','9','C'},
{'#','0','*','D'}
};

// Connect keypad ROW0, ROW1, ROW2 and ROW3 to these Arduino pins.
byte rowPins[ROWS] = { 5, 4, 3, 2 };
// Connect keypad COL0, COL1, COL2 and COL3 to these Arduino pins.
byte colPins[COLS] = { 9, 8, 7, 6 };

// Create the Keypad
Keypad kpd = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );

#define ledpin 13

void setup()
{
pinMode(ledpin,OUTPUT);
digitalWrite(ledpin, HIGH);
Serial.begin(9600);
}

void loop()
{
char key = kpd.getKey();
if(key) // Check for a valid key.
{
switch (key)
{
case '*':
digitalWrite(ledpin, LOW);
break;
case '#':
digitalWrite(ledpin, HIGH);
break;
default:
Serial.println(key);
}
}
}

Acessórios

Clientes que compraram este produto também compraram: