File tree Expand file tree Collapse file tree 1 file changed +17
-7
lines changed
examples/Keyboard/Setup_Keyboard Expand file tree Collapse file tree 1 file changed +17
-7
lines changed Original file line number Diff line number Diff line change 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
2222 * prior written consent is prohibited.
2323 */
2424
25- #include " SoftPathElectronics.h"
25+ #include < SoftPathElectronics.h>
2626
27- // Instantiate the CustomKeyboard object
2827CustomKeyboard keyboard;
2928
3029void 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
3942void 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}
You can’t perform that action at this time.
0 commit comments