Danh sách sản phẩm

Bàn phím ma trận cứng 4x4 keypad

Mã sản phẩm: IMA038   |   Tình trạng: Còn 5 sản phẩm có sẵn
12.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

Độ dài cáp: 88mm. Nhiệt độ hoạt động 0 ~ 70oC.

Thông số kỹ thuật:

  • Độ dài cáp: 88mm.
  • Nhiệt độ hoạt động 0 ~ 70oC.
  • Đầu nối ra 8 chân.
  • Kích thước bàn phím 65 x 64mm

Sơ đồ chân:


Code tham khảo Arduino: 

// Thứ tự chân từ trái sang phải 1 2 3 4 5 6 7 8 9 10

/*4X4     Arduin0
 * 2  -     A0
 * 3  -     A1
 * 4  -     A2
 * 5  -     A3
 * 6  -     7
 * 7  -     6
 * 8  -     5
 * 9  -     4
 * 
 * 
 * Nạp code mở Serial Monitor, chọn No line ending, baud 9600.

*/
#include <Keypad.h>

const byte ROWS = 4; //four rows
const byte COLS = 4; //four columns
//define the cymbols on the buttons of the keypads
char hexaKeys[ROWS][COLS] = {
  {'1','2','3','A'},
  {'4','5','6','B'},
  {'7','8','9','C'},
  {'*','0','#','D'}
};
byte rowPins[ROWS] = {7, 6, 5, 4}; //connect to the row pinouts of the keypad
byte colPins[COLS] = {A0, A1, A2, A3}; //connect to the column pinouts of the keypad

//initialize an instance of class NewKeypad
Keypad customKeypad = Keypad( makeKeymap(hexaKeys), rowPins, colPins, ROWS, COLS); 

void setup(){
  Serial.begin(9600);
}
  
void loop(){
  char customKey = customKeypad.getKey();
  
  if (customKey){
    Serial.println(customKey);
  }
}


 


Video tham khảo: 

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