This commit is contained in:
Max Hunt 2018-09-27 14:52:14 +01:00
parent e5ed98bae0
commit 5bb20a3640
2 changed files with 60 additions and 61 deletions

Binary file not shown.

View File

@ -1,4 +1,4 @@
#include <Key.h> #include <Keyboard.h>
#include <Keypad.h> #include <Keypad.h>
const byte ROWS = 4; // Four rows const byte ROWS = 4; // Four rows
@ -20,17 +20,17 @@ Keypad kpd = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );
#define ledpin 11 #define ledpin 11
void setup() void setup() {
{ Keyboard.begin();
pinMode(ledpin,OUTPUT); pinMode(ledpin,OUTPUT);
digitalWrite(ledpin, HIGH); digitalWrite(ledpin, HIGH);
Serial.begin(9600); Serial.begin(9600);
} }
//funcs: //funcs:
void fmtky() {} void fmf1() {}
void fmlol() {} void fmf2() {}
void fmnws() {} void fmf3() {}
void fmfky() {} void fmfky() {}
void fmshl() {} void fmshl() {}
void fmshg() {} void fmshg() {}
@ -48,59 +48,58 @@ void fmexr() {}
void loop() void loop() {
{ char key = kpd.getKey();
char key = kpd.getKey(); if(key) {
if(key) { switch (key) {
switch (key) { case '0':
case '0': fmf1();
fmtky(); break;
break; case '1':
case '1': fmf2();
fmlol(); break;
break; case '2':
case '2': fmf3();
fmnws(); break;
break; case '3':
case '3': fmfky();
fmfky(); break;
break; case '4':
case '4': fmshl();
fmshl(); break;
break; case '5':
case '5': fmshg();
fmshg(); break;
break; case '6':
case '6': fmgdr();
fmgdr(); break;
break; case '7':
case '7': fmezg();
fmezg(); break;
break; case '8':
case '8': fmsbr();
fmsbr(); break;
break; case '9':
case '9': fmszr();
fmszr(); break;
break; case 'a':
case 'a': fmclb();
fmclb(); break;
break; case 'b':
case 'b': fmglp();
fmglp(); break;
break; case 'c':
case 'c': fmcbh();
fmcbh(); break;
break; case 'd':
case 'd': fmcbv();
fmcbv(); break;
break; case 'e':
case 'e': fmcbs();
fmcbs(); break;
break; case 'f':
case 'f': fmexr();
fmexr(); break;
break;
default: default:
Serial.println(key); Serial.println(key);
} }