งานที่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.9arduino.com/article/71/โปรเจคเครื่องรดน้ำต้นไม้อัตโนมัติ-ด้วย-arduino-ราคาถูก-พร้อม-code-ตัวอย่าง

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

http://www.myarduino.net/article/6/%E0%B8%81%E0%B8%B2%E0%B8%A3%E0%B9%80%E0%B8%82%E0%B8%B5%E0%B8%A2%E0%B8%99%E0%B9%82%E0%B8%9B%E0%B8%A3%E0%B9%81%E0%B8%81%E0%B8%A3%E0%B8%A1%E0%B9%80%E0%B8%9A%E0%B8%B7%E0%B9%89%E0%B8%AD%E0%B8%87%E0%B8%95%E0%B9%89%E0%B8%99%E0%B8%81%E0%B8%B1%E0%B8%9A-arduino-c-%E0%B9%84%E0%B8%9F%E0%B8%A7%E0%B8%B4%E0%B9%88%E0%B8%87