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