This commit is contained in:
Max Hunt 2018-09-28 19:37:14 +01:00
parent 03374109fa
commit 1ff2f69014
2 changed files with 56 additions and 60 deletions

View File

@ -22,11 +22,15 @@ Keypad kpd = Keypad( makeKeymap(keys), rowPins, colPins, ROWS, COLS );
char ctrlKey = KEY_LEFT_CTRL;
void setup() {
Keyboard.begin();
pinMode(ledpin,OUTPUT);
digitalWrite(ledpin, HIGH);
// Serial.begin(9600);
}
//funcs:
@ -47,67 +51,59 @@ void fmcbv() {Keyboard.press(ctrlKey);delay(20);Keyboard.press(98);delay(20);Key
void fmcbs() {Keyboard.press(ctrlKey);delay(20);Keyboard.press(98);delay(20);Keyboard.releaseAll();delay(5);Keyboard.print("s");}
void fmexr() {Keyboard.println("exit");delay(5);}//ln
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);
}
delay(100);
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;
}
delay(100);
}
}

View File

@ -4,7 +4,7 @@
//Declarations LED
#define NUM_LED 4
#define LED_PIN 7
#define LED_PIN 11
CRGB led[NUM_LED];
char currentRGB = i;
//Declarations KEYPAD