Friday, February 22, 2019

6

งานที่ 6
Code

#include "LedControl.h"
#include "Keypad.h"
char keys[1][1][0][5]={
  {'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(1,1,0,5);
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);
  }
}

No comments:

Post a Comment

MINI Project ตัวจับเวลา

#include <LiquidCrystal.h> LiquidCrystal lcd(7,6,5,4,3,2); const int set = 8; int hours=10; int start=11;  int relay=9; ...