Bug fixes.

This commit is contained in:
2021-11-24 05:40:28 +00:00
parent 690afdbce5
commit a9c80c2ed5
4 changed files with 33 additions and 28 deletions

View File

@ -38,6 +38,7 @@ Joystick::Joystick(bool debug) {
void Joystick::Init() {
Serial.begin(115200);
delay(100);
if (_debug) Serial.println("Joystick serial communication initialized.");
}
void Joystick::AddButton(uint8_t pin, ButtonType type, bool pullup) {
@ -68,6 +69,8 @@ void Joystick::AddEncoder(uint8_t pin1, uint8_t pin2, ButtonType type) {
Serial.println(type);
}
}
if (_debug) Serial.println("Added an encoder.");
}
void Joystick::AddAxis(uint8_t pin) {
@ -165,6 +168,10 @@ void Joystick::_addButton(ButtonType type, Reader* reader) {
button = new PulsedButton(_virtual_buttons, reader, true, true);
_virtual_buttons += 2;
break;
case BUTTON_LATCHED_MOMENTARY:
button = new LatchedButton(_virtual_buttons, reader);
_virtual_buttons++;
break;
default:
return;
}