I hope this is in the correct location.
I have looked quite a bit for how to handle this, but still have not found the answers. I have used the code for an ir remote (using an arduino mega board), which will find what each button is called (shows in serial monitor), and those values can then be put into a separate/ main code (so when the main code sees a recognized button press, it will do something).
For my current project, I need to use a bluetooth enabled board (as the location of the circuit would block the beam from an ir remote, and I needed a smaller board). I am trying to pair/ find button info for a small bluetoth remote (bought a 2 button remote used to control a phone's camera functions). The board used is the arduino nano rp2040. Uploaded the ble library and was able to use the scan sketch successfully (outputs some device info to serial monitor when the remote is turned on, so I know the board can "see" the remote's name).
How do I:
Get the info for the remote's buttons (already tried the sensor tag sketch).
Is there a good example code for this using a bluetooth remote (and NOT using a smartphone app)?
But the ir remote board functions has a code that comes with the ir library that is used for showing the info of button presses on the serial monitor (which those then can be used in a main code). Does the ble (bluetooth) library have no such code (the "scan" code just shows some info of device names in the area of the board, not each individual button press)?
After looking quite a bit more for the answers on how to use the 2 button bluetooth remote with the rp2040 board, I still can't seem to find what I am looking for. When using the ble library central scan sketch, it does see the remote when turned on, and gives info for address (not the long uuid 128 bit info, like as used in the arduino ble board to board example), local name, 2 service uuids (both 4 digits), and some rssi number. Is the info I am able to get in the scan code enough to write the main code for having the 2 buttons communicate when they are pressed to the arduino, so the arduino can do something in response?
Still stuck on part of the code. Using the arduino webpage example code for central/ peripheral device to device (the central code). My remote's info that comes in the scan code does have a 4 digit service uuid, which does work in the central code when replacing the longer digit uuid. It succssfully connects, displays info (local name, etc.), finds attributes, but is not able to get characteristics (still called ledcharacteristic in example code). How am I able to identify what are the names of the characteristics in the remote to look for, and then also what values those could be (the led code looks for 0x00 and 0x01, but would it always be like that)?
How am I able to identify what are the names of the characteristics in the remote to look for, and then also what values those could be (the led code looks for 0x00 and 0x01, but would it always be like that)?
It uses Android or IOS software. Is it provided, or do those OS auto-detect it as as system buttons? Please also post any information that you have about that.
You might find out about the codes if they are generic to Android, by consulting the Android I/O specs.