Compare commits
No commits in common. "2be67f1659b15567ca227f4c3a357e464a5577d0" and "b56c43767dc0a96daf666027d085783dee537696" have entirely different histories.
2be67f1659
...
b56c43767d
|
@ -181,29 +181,6 @@ long starttime = 0; // Start time point for pressed key
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifdef HARDWARE_LIGHT
|
#ifdef HARDWARE_LIGHT
|
||||||
int readSensorpads(){
|
|
||||||
// Read key code
|
|
||||||
if(digitalRead(UP) == LOW){
|
|
||||||
keycode = 10; // Left swipe
|
|
||||||
}
|
|
||||||
else if(digitalRead(DOWN) == LOW){
|
|
||||||
keycode = 9; // Right swipe
|
|
||||||
}
|
|
||||||
else if(digitalRead(CONF) == LOW){
|
|
||||||
keycode = 3; // Key 3
|
|
||||||
}
|
|
||||||
else if(digitalRead(MENUE) == LOW){
|
|
||||||
keycode = 1; // Key 1
|
|
||||||
}
|
|
||||||
else if(digitalRead(EXIT) == LOW){
|
|
||||||
keycode = 2; // Key 2
|
|
||||||
}
|
|
||||||
else{
|
|
||||||
keycode = 0; // No key activ
|
|
||||||
}
|
|
||||||
return keycode;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Keypad functions for OBP60 clone (thSensitivity is inactiv)
|
// Keypad functions for OBP60 clone (thSensitivity is inactiv)
|
||||||
int readKeypad(uint thSensitivity) {
|
int readKeypad(uint thSensitivity) {
|
||||||
pinMode(UP, INPUT);
|
pinMode(UP, INPUT);
|
||||||
|
@ -212,8 +189,25 @@ long starttime = 0; // Start time point for pressed key
|
||||||
pinMode(MENUE, INPUT);
|
pinMode(MENUE, INPUT);
|
||||||
pinMode(EXIT, INPUT);
|
pinMode(EXIT, INPUT);
|
||||||
|
|
||||||
// Read pad values
|
// Read key code
|
||||||
readSensorpads();
|
if(digitalRead(UP) == LOW){
|
||||||
|
keycode = 10; // Left swipe
|
||||||
|
}
|
||||||
|
else if(digitalRead(DOWN) == LOW){
|
||||||
|
keycode = 9; // Right swipe
|
||||||
|
}
|
||||||
|
else if(digitalRead(CONF) == LOW){
|
||||||
|
keycode = 3; // Key 3
|
||||||
|
}
|
||||||
|
else if(digitalRead(MENUE) == LOW){
|
||||||
|
keycode = 1; // Key 1
|
||||||
|
}
|
||||||
|
else if(digitalRead(EXIT) == LOW){
|
||||||
|
keycode = 2; // Key 2
|
||||||
|
}
|
||||||
|
else{
|
||||||
|
keycode = 0; // No key activ
|
||||||
|
}
|
||||||
|
|
||||||
// Detect key
|
// Detect key
|
||||||
if (keycode > 0 ){
|
if (keycode > 0 ){
|
||||||
|
@ -226,7 +220,6 @@ 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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -240,4 +233,4 @@ long starttime = 0; // Start time point for pressed key
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#endif
|
#endif
|
Loading…
Reference in New Issue