งานที่6





#include "LedControl.h"
#include "Keypad.h"
char keys[4][4]={
  {'7','8','9','A'},
  {'4','5','6','B'},
  {'1','2','3','C'},
  {'E','0','F','D'}};
byte rowPins[] = {7,6,5,4};
byte colPins[] = {3,2,1,0};
Keypad keypad = Keypad(makeKeymap(keys),rowPins,colPins,4,4);
LedControl lc=LedControl(8,10,9,1); 
// Pin 8->DIN, 10->CLK, 9->CS(LOAD), 1 = No.of devices
void setup() 
{
  lc.shutdown(0,false);  
  lc.setIntensity(0,5); 
  lc.clearDisplay(0);      
}
void loop() 
{
  char key = keypad.getKey();
  if (key != NO_KEY)
  {
    lc.setChar(0,0,key,false);
  }

}

ความคิดเห็น

โพสต์ยอดนิยมจากบล็อกนี้

https://www.arduitronics.com/article/22/arduino-and-motor-control-part-1

https://www.9arduino.com/article/71/โปรเจคเครื่องรดน้ำต้นไม้อัตโนมัติ-ด้วย-arduino-ราคาถูก-พร้อม-code-ตัวอย่าง

https://medium.com/sathittham/arduino-lcd-16x2-hello-world-dca09fd904f8