Skip to content

Commit

Permalink
Check if BLE is connected --> print error message otherwise
Browse files Browse the repository at this point in the history
  • Loading branch information
ChrGri committed Nov 22, 2023
1 parent 91060f6 commit db502a4
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions Arduino/Esp32/Main/Controller.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,19 @@ static const int16_t JOYSTICK_RANGE = JOYSTICK_MAX_VALUE - JOYSTICK_MIN_VALUE;

void SetControllerOutputValue(int32_t value) {
//bleGamepad.setBrake(value);
bleGamepad.setAxes(value, 0, 0, 0, 0, 0, 0, 0);
bleGamepad.sendReport();
//Serial.println(value);

if (bleGamepad.isConnected() )
{
bleGamepad.setAxes(value, 0, 0, 0, 0, 0, 0, 0);
bleGamepad.sendReport();
}
else
{
Serial.println("BLE not connected!");
delay(500);
}


}

#endif
Expand Down

0 comments on commit db502a4

Please sign in to comment.