Skip to content

Commit 033f7fb

Browse files
Update SoftPathElectronics.h
1 parent 4a97d81 commit 033f7fb

File tree

1 file changed

+7
-16
lines changed

1 file changed

+7
-16
lines changed

src/SoftPathElectronics.h

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -21,26 +21,13 @@
2121
* This library is licensed for personal, non-commercial use only. Commercial use, reproduction, or redistribution without
2222
* prior written consent is prohibited.
2323
*/
24-
2524
#ifndef SOFT_PATH_ELECTRONICS_H
2625
#define SOFT_PATH_ELECTRONICS_H
2726

2827
#include <Arduino.h>
29-
#include <vector>
3028

31-
/*
32-
* DISCLAIMER:
33-
* This software is provided "as-is" without any express or implied warranty.
34-
* In no event shall the author or company be held liable for any damages
35-
* arising from the use of this software. It is the user's responsibility
36-
* to ensure that the software is suitable for their needs and that they
37-
* have tested it sufficiently before using it in any project. By using this
38-
* software, you agree that you have read and understood the safety warnings
39-
* and usage instructions.
40-
*
41-
* This library is licensed for personal, non-commercial use only. Commercial use,
42-
* reproduction, or redistribution without prior written consent is prohibited.
43-
*/
29+
// Maximale Anzahl von Messwerten pro Taste zur Robust-Mean-Berechnung
30+
#define MAX_SAMPLES 20 // Reduziert von 100 auf 20
4431

4532
class CustomKeyboard {
4633
public:
@@ -65,13 +52,17 @@ class CustomKeyboard {
6552
int _lastKey;
6653
bool _resetRequired;
6754
bool _pressed;
55+
6856
void calibrateKey(int keyIndex);
6957
int readAnalogValue();
7058
void promptUser(String message);
7159
int readIntWithPrompt(String prompt);
7260
bool readBoolWithPrompt(String prompt);
73-
int calculateRobustMean(std::vector<int>& values);
61+
int calculateRobustMean(int* values, int count);
7462
int readKeyValue();
63+
64+
// Verschieben des Arrays nach statisch zugewiesenen Speicher
65+
int _values[MAX_SAMPLES];
7566
};
7667

7768
#endif

0 commit comments

Comments
 (0)