Compare commits
2 Commits
b56c43767d
...
2be67f1659
Author | SHA1 | Date |
---|---|---|
|
2be67f1659 | |
|
75e360a19d |
|
@ -181,14 +181,7 @@ long starttime = 0; // Start time point for pressed key
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HARDWARE_LIGHT
|
#ifdef HARDWARE_LIGHT
|
||||||
// Keypad functions for OBP60 clone (thSensitivity is inactiv)
|
int readSensorpads(){
|
||||||
int readKeypad(uint thSensitivity) {
|
|
||||||
pinMode(UP, INPUT);
|
|
||||||
pinMode(DOWN, INPUT);
|
|
||||||
pinMode(CONF, INPUT);
|
|
||||||
pinMode(MENUE, INPUT);
|
|
||||||
pinMode(EXIT, INPUT);
|
|
||||||
|
|
||||||
// Read key code
|
// Read key code
|
||||||
if(digitalRead(UP) == LOW){
|
if(digitalRead(UP) == LOW){
|
||||||
keycode = 10; // Left swipe
|
keycode = 10; // Left swipe
|
||||||
|
@ -208,6 +201,19 @@ long starttime = 0; // Start time point for pressed key
|
||||||
else{
|
else{
|
||||||
keycode = 0; // No key activ
|
keycode = 0; // No key activ
|
||||||
}
|
}
|
||||||
|
return keycode;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Keypad functions for OBP60 clone (thSensitivity is inactiv)
|
||||||
|
int readKeypad(uint thSensitivity) {
|
||||||
|
pinMode(UP, INPUT);
|
||||||
|
pinMode(DOWN, INPUT);
|
||||||
|
pinMode(CONF, INPUT);
|
||||||
|
pinMode(MENUE, INPUT);
|
||||||
|
pinMode(EXIT, INPUT);
|
||||||
|
|
||||||
|
// Read pad values
|
||||||
|
readSensorpads();
|
||||||
|
|
||||||
// Detect key
|
// Detect key
|
||||||
if (keycode > 0 ){
|
if (keycode > 0 ){
|
||||||
|
@ -220,6 +226,7 @@ long starttime = 0; // Start time point for pressed key
|
||||||
keystatus = keycode;
|
keystatus = keycode;
|
||||||
// Copy keycode
|
// Copy keycode
|
||||||
keycodeold = keycode;
|
keycodeold = keycode;
|
||||||
|
while(readSensorpads() > 0){} // Wait for pad release
|
||||||
delay(keydelay);
|
delay(keydelay);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue