Skip to content

Commit f945363

Browse files
Update Setup_Keyboard.ino
1 parent 8b189df commit f945363

File tree

1 file changed

+17
-7
lines changed

1 file changed

+17
-7
lines changed

examples/Keyboard/Setup_Keyboard/Setup_Keyboard.ino

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* er sie vor der Verwendung ausreichend getestet hat.
77
* Durch die Nutzung dieser Software erklären Sie, dass Sie die Sicherheitswarnungen und Gebrauchsanweisungen gelesen und verstanden haben.
88
*
9-
* DISLAIMER:
9+
* DISCLAIMER:
1010
* This software is provided "as-is" without any express or implied warranty.
1111
* In no event shall the author or company be held liable for any damages arising from the use of this software.
1212
* It is the user's responsibility to ensure that the software is suitable for their needs and that they have tested it
@@ -22,19 +22,29 @@
2222
* prior written consent is prohibited.
2323
*/
2424

25-
#include "SoftPathElectronics.h"
25+
#include <SoftPathElectronics.h>
2626

27-
// Instantiate the CustomKeyboard object
2827
CustomKeyboard keyboard;
2928

3029
void setup() {
31-
// Setup Serial communication for debugging
3230
Serial.begin(115200);
33-
delay(1000); // Give some time to open the serial monitor
31+
while (!Serial) {
32+
; // Warten auf Serial Verbindung
33+
}
34+
Serial.println("Keyboard Ready...");
3435

35-
// Call the setupKeyboard method to configure the keyboard
36-
keyboard.setupKeyboard();
36+
// Beispielschlüssel, ersetzen durch den tatsächlichen Schlüssel aus dem Setup-Script
37+
// Format: "<pin> <numKeys> <tolerance> <debounceMode> <keyValue1> ... <keyValue16>"
38+
String key = "34 3 20 0 4095 1144 615 0 0 0 0 0 0 0 0 0 0 0 0 0";
39+
keyboard.setupKey(key);
3740
}
3841

3942
void loop() {
43+
int key = keyboard.getKeyPressed();
44+
if (key != -1) {
45+
Serial.print("Taste gedrückt: ");
46+
Serial.println(key);
47+
}
48+
49+
delay(100); // Zum Entprellen
4050
}

0 commit comments

Comments
 (0)