#include <Keypad.h>
const byte ROWS = 4; //four rows
const byte COLS = 3; //three columns
char keys[ROWS][COLS] = {
{'1','2','3'},
{'4','5','6'},
{'7','8','9'},
{'*','0','#'}
};
byte rowPins[ROWS] = {13,12,11,10}; //connect to the row pinouts of the keypad
byte colPins[COLS] = {A0,A1,A2}; //connect to the column pinouts of the keypad
Keypad keypad = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );
void setup()
{
Serial.begin(9600);
}
void loop()
{
char key = keypad.getKey();
if (key != NO_KEY)
{
Serial.println(key);
}
}
#include "LedControl.h"
LedControl lc=LedControl(6,4,5,1); // Pin 11->DIN, 13->CLK, 12->CS, 1 = No.of devices
void setup()
{
lc.shutdown(0,false); // Enable display
lc.setIntensity(0,10); // Set brightness level (0 is min, 15 is max)
lc.clearDisplay(0); // Clear display register
}
void loop()
{
lc.setDigit(0,7,2,false);
lc.setDigit(0,6,3,true);
lc.setDigit(0,5,4,false);
lc.setRow(0,4,B00110111);
lc.setRow(0,3,B01001111);
lc.setRow(0,2,B00001110);
lc.setRow(0,1,B00001110);
lc.setRow(0,0,B01111110);
delay(1000);
}