-
Notifications
You must be signed in to change notification settings - Fork 183
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Trying to make 32 button 3 axis game controller #213
Comments
Compiles fine for me in Arduino 1.8.19 and also the Arduino web editor |
#include <Arduino.h> #define NUM_OF_BUTTONS 36 BleGamepad bleGamepad("BLE Flight Controller", "lemmingDev", 100); const int potRY = 36; // Analog pin for RY axis (potentiometer) const int numberOfPotSamples = 5; // Number of pot samples to take (to smooth the values) const byte ROWS = 6; // Six rows Keypad customKeypad = Keypad(makeKeymap(keys), rowPins, colPins, ROWS, COLS); void setup() {
} void loop() {
} |
Please post your code between triple backtags ` so it shows correctly... Your code compiles and I can pair it, but doesn't show up as a controller for me I tried removing all of the custom vid/pid/serial etc stuff and it's working Also, you set bleGamepadConfig.setAutoReport(true);, but then you manually call bleGamepad.sendReport(); Try the code below and see if it works
|
Also, your analogs won't move much as analog read will return a value from 0 to 4095, though you've set the setAxesMax to 0x7FFF which is 32767 You should change: bleGamepadConfig.setAxesMax(0x7FFF); // Axes maximum value to bleGamepadConfig.setAxesMax(0x0FFF); // Axes maximum value |
So, I'll close this soon if I don't hear back |
Library 5.4
IDE 2.3.2
board ESP32 Wroom breakout board
using the flight controller example straight from the example
code will never compile keeps giving a ping time-out error or
/Users/dwayne/Documents/Arduino/libraries/ESP32-BLE-Gamepad/BleGamepadConfiguration.cpp: In constructor 'BleGamepadConfiguration::BleGamepadConfiguration()':
/Users/dwayne/Documents/Arduino/libraries/ESP32-BLE-Gamepad/BleGamepadConfiguration.cpp:22:79: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
_hardwareRevision("1.0.0")
^
/Users/dwayne/Documents/Arduino/libraries/ESP32-BLE-Gamepad/BleGamepadConfiguration.cpp:22:79: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
/Users/dwayne/Documents/Arduino/libraries/ESP32-BLE-Gamepad/BleGamepadConfiguration.cpp:22:79: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
/Users/dwayne/Documents/Arduino/libraries/ESP32-BLE-Gamepad/BleGamepadConfiguration.cpp:22:79: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
/Users/dwayne/Documents/Arduino/libraries/ESP32-BLE-Gamepad/BleGamepadConfiguration.cpp:22:79: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]/Users/dwayne/Desktop/sketch_mar13a/sketch_mar13a.ino:2:11: error: expected constructor, destructor, or type conversion before 'controller'
^~~~~~~~~~
/Users/dwayne/Desktop/sketch_mar13a/BleGamepadConfiguration.cpp: In constructor 'BleGamepadConfiguration::BleGamepadConfiguration()':
BleGamepadConfiguration.cpp:22:79: error: too many initializers for 'bool [0]'
_hardwareRevision("1.0.0")
^
BleGamepadConfiguration.cpp:22:79: error: too many initializers for 'bool [0]'
/Users/dwayne/Desktop/sketch_mar13a/BleGamepadConfiguration.cpp:22:79: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
/Users/dwayne/Desktop/sketch_mar13a/BleGamepadConfiguration.cpp:22:79: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
/Users/dwayne/Desktop/sketch_mar13a/BleGamepadConfiguration.cpp:22:79: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
/Users/dwayne/Desktop/sketch_mar13a/BleGamepadConfiguration.cpp:22:79: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
/Users/dwayne/Desktop/sketch_mar13a/BleGamepadConfiguration.cpp:22:79: warning: ISO C++ forbids converting a string constant to 'char*' [-Wwrite-strings]
/Users/dwayne/Desktop/sketch_mar13a/sketch_mar13a.ino: In function 'void setup()':
sketch_mar13a:42:35: error: 'enableX' was not declared in this scope
bleGamepadConfig.setWhichAxes(enableX, enableY, enableZ, enableRX, enableRY, enableRZ, enableSlider1, enableSlider2); // Can also be done per-axis individually. All are true by default
^~~~~~~
/Users/dwayne/Desktop/sketch_mar13a/sketch_mar13a.ino:42:35: note: suggested alternative: 'enableRX'
bleGamepadConfig.setWhichAxes(enableX, enableY, enableZ, enableRX, enableRY, enableRZ, enableSlider1, enableSlider2); // Can also be done per-axis individually. All are true by default
^~~~~~~
enableRX
sketch_mar13a:42:44: error: 'enableY' was not declared in this scope
bleGamepadConfig.setWhichAxes(enableX, enableY, enableZ, enableRX, enableRY, enableRZ, enableSlider1, enableSlider2); // Can also be done per-axis individually. All are true by default
^~~~~~~
/Users/dwayne/Desktop/sketch_mar13a/sketch_mar13a.ino:42:44: note: suggested alternative: 'enableRY'
bleGamepadConfig.setWhichAxes(enableX, enableY, enableZ, enableRX, enableRY, enableRZ, enableSlider1, enableSlider2); // Can also be done per-axis individually. All are true by default
^~~~~~~
enableRY
sketch_mar13a:42:53: error: 'enableZ' was not declared in this scope
bleGamepadConfig.setWhichAxes(enableX, enableY, enableZ, enableRX, enableRY, enableRZ, enableSlider1, enableSlider2); // Can also be done per-axis individually. All are true by default
^~~~~~~
/Users/dwayne/Desktop/sketch_mar13a/sketch_mar13a.ino:42:53: note: suggested alternative: 'enableRZ'
bleGamepadConfig.setWhichAxes(enableX, enableY, enableZ, enableRX, enableRY, enableRZ, enableSlider1, enableSlider2); // Can also be done per-axis individually. All are true by default
^~~~~~~
enableRZ
sketch_mar13a:42:92: error: 'enableSlider1' was not declared in this scope
bleGamepadConfig.setWhichAxes(enableX, enableY, enableZ, enableRX, enableRY, enableRZ, enableSlider1, enableSlider2); // Can also be done per-axis individually. All are true by default
^~~~~~~~~~~~~
sketch_mar13a:42:107: error: 'enableSlider2' was not declared in this scope
bleGamepadConfig.setWhichAxes(enableX, enableY, enableZ, enableRX, enableRY, enableRZ, enableSlider1, enableSlider2); // Can also be done per-axis individually. All are true by default
^~~~~~~~~~~~~
sketch_mar13a:43:49: error: 'enableRudder' was not declared in this scope
bleGamepadConfig.setWhichSimulationControls(enableRudder, enableThrottle, enableAccelerator, enableBrake, enableSteering); // Can also be done per-control individually. All are false by default
^~~~~~~~~~~~
/Users/dwayne/Desktop/sketch_mar13a/sketch_mar13a.ino:43:49: note: suggested alternative: 'enableRX'
bleGamepadConfig.setWhichSimulationControls(enableRudder, enableThrottle, enableAccelerator, enableBrake, enableSteering); // Can also be done per-control individually. All are false by default
^~~~~~~~~~~~
enableRX
sketch_mar13a:43:63: error: 'enableThrottle' was not declared in this scope
bleGamepadConfig.setWhichSimulationControls(enableRudder, enableThrottle, enableAccelerator, enableBrake, enableSteering); // Can also be done per-control individually. All are false by default
^~~~~~~~~~~~~~
/Users/dwayne/Desktop/sketch_mar13a/sketch_mar13a.ino:43:63: note: suggested alternative: 'enableCore1WDT'
bleGamepadConfig.setWhichSimulationControls(enableRudder, enableThrottle, enableAccelerator, enableBrake, enableSteering); // Can also be done per-control individually. All are false by default
^~~~~~~~~~~~~~
enableCore1WDT
sketch_mar13a:43:79: error: 'enableAccelerator' was not declared in this scope
bleGamepadConfig.setWhichSimulationControls(enableRudder, enableThrottle, enableAccelerator, enableBrake, enableSteering); // Can also be done per-control individually. All are false by default
^~~~~~~~~~~~~~~~~
sketch_mar13a:43:98: error: 'enableBrake' was not declared in this scope
bleGamepadConfig.setWhichSimulationControls(enableRudder, enableThrottle, enableAccelerator, enableBrake, enableSteering); // Can also be done per-control individually. All are false by default
^~~~~~~~~~~
/Users/dwayne/Desktop/sketch_mar13a/sketch_mar13a.ino:43:98: note: suggested alternative: 'enableRX'
bleGamepadConfig.setWhichSimulationControls(enableRudder, enableThrottle, enableAccelerator, enableBrake, enableSteering); // Can also be done per-control individually. All are false by default
^~~~~~~~~~~
enableRX
sketch_mar13a:43:111: error: 'enableSteering' was not declared in this scope
bleGamepadConfig.setWhichSimulationControls(enableRudder, enableThrottle, enableAccelerator, enableBrake, enableSteering); // Can also be done per-control individually. All are false by default
^~~~~~~~~~~~~~
/Users/dwayne/Desktop/sketch_mar13a/sketch_mar13a.ino:43:111: note: suggested alternative: 'emptyString'
bleGamepadConfig.setWhichSimulationControls(enableRudder, enableThrottle, enableAccelerator, enableBrake, enableSteering); // Can also be done per-control individually. All are false by default
^~~~~~~~~~~~~~
emptyString
sketch_mar13a:44:40: error: 'numOfHatSwitches' was not declared in this scope
bleGamepadConfig.setHatSwitchCount(numOfHatSwitches); // 1 by default
^~~~~~~~~~~~~~~~
/Users/dwayne/Desktop/sketch_mar13a/sketch_mar13a.ino:44:40: note: suggested alternative: 'numOfButtons'
bleGamepadConfig.setHatSwitchCount(numOfHatSwitches); // 1 by default
^~~~~~~~~~~~~~~~
numOfButtons
Using library ESP32-BLE-Gamepad at version 0.5.4 in folder: /Users/dwayne/Documents/Arduino/libraries/ESP32-BLE-Gamepad
Using library NimBLE-Arduino at version 1.4.1 in folder: /Users/dwayne/Documents/Arduino/libraries/NimBLE-Arduino
Using library Keypad at version 3.1.1 in folder: /Users/dwayne/Documents/Arduino/libraries/Keypad
exit status 1
too many initializers for 'bool [0]'
The text was updated successfully, but these errors were encountered: