Danh sách sản phẩm

Bàn phím ma trận mềm 3x4 keypad

Mã sản phẩm: IMA003   |   Tình trạng: Còn 34 sản phẩm có sẵn
13.000₫
  • Nhập IMA-90 giảm 90%, tối đa 2K
  • Nhập IMA-5K giảm 5k, đơn từ 199K
  • Nhập IMA-35K giảm 35k, đơn từ 499K

Mô tả sản phẩm

Thông số kỹ thuật:

  • Module bàn phím ma trận 3x4 loại phím mềm.
  • Độ dài cáp: 88mm.
  • Nhiệt độ hoạt động 0 ~ 70oC.
  • Đầu nối ra 7 chân.
  • Kích thước bàn phím 76.9 x 69.2 mm

Sơ đồ chân:


Code tham khảo Arduino: 

//3x4     Arduino
// 1  -     2
// 2  -     3
// 3  -     4
// 4  -     5
// 5  -     6
// 6  -     7
// 7  -     8
//Nạp code mở Serial Monitor chọn No line ending, baud 9600.

#include "Keypad.h"

const byte Rows= 4; //number of rows on the keypad i.e. 4
const byte Cols= 3; //number of columns on the keypad i,e, 3

//we will definne the key map as on the key pad:

char keymap[Rows][Cols]=
{
{'1', '2', '3'},
{'4', '5', '6'},
{'7', '8', '9'},
{'*', '0', '#'}
};

byte rPins[Rows]= {8,7,6,5}; //Rows 0 to 3
byte cPins[Cols]= {4,3,2}; //Columns 0 to 2

// command for library forkeypad
//initializes an instance of the Keypad class
Keypad kpd= Keypad(makeKeymap(keymap), rPins, cPins, Rows, Cols);

void setup()
{
     Serial.begin(9600);  // initializing serail monitor
}

//If key is pressed, this key is stored in 'keypressed' variable
//If key is not equal to 'NO_KEY', then this key is printed out
void loop()
{
     char keypressed = kpd.getKey();
     if (keypressed != NO_KEY)
     { 
          Serial.println(keypressed);
     }
}

Video tham khảo:

Khách hàng nhận xét