dlktdr / HeadTracker

This project is built to record the orientation a FPV headset to allow the camera on your RC to follow your head movements.
GNU General Public License v3.0
367 stars 82 forks source link

Re-center using bluetooth #151

Closed haplm closed 1 year ago

haplm commented 1 year ago

It would be lovely to have a button on the RC remote to re-center (I'm using it on car, and there's no way I could reach out to my goggles and press a button there).

So I have two options

  1. Either run the recenter button on a wire all the way down to the RC controller, which isn't really practical
  2. Or build a simple BLE button based on something like this https://www.dfrobot.com/product-1259.html

Would it be possible to add a feature that would use the bluetooth connection on the headtracker to receive input from such a button?

dlktdr commented 1 year ago

If you have another Nano, DTQSYS or even an (XIAO Sense board, if flash it with the development version) You can do this now. Connect them together with one set as Bluetooth Head and the (button one) as Remote, when you press the center button on the Remote it will cause the Head board to re-center. XIAO Sense firmware is now a part of the main dev, look in the actions for a .uf2 file you can write. https://headtracker.gitbook.io/head-tracker-v2.2/support/development/git-workflow-and-actions https://github.com/dlktdr/HeadTracker/actions/workflows/build-firmware.yml

I have one of these boards on the way to me as well https://www.digikey.ca/en/products/detail/seeed-technology-co-ltd/102010448/16652893, it can't do headtracking, there is no IMU but would make an awesome receiver board with very little code changes. Or as a basic button board as your requesting. It won't be difficult to make this one work in time.

Both XIAO boards also supports a running off a single cell lipo, with charger too which is handy.

FYI If you want to write your own you can use any Bluetooth LE board, put the HT Bluetooth Mode to FrSky - Wireless Transmitter (Head). Connect to it, in service 0xFFF0, on characteristic 0xAFF2, write the character "R". Will cause a center event.

haplm commented 1 year ago

I do have another nano, so I could use it, yes.

The smaller XIAO board looks awesome - I plan to buy a car remote that has a trainer port, so I could use it both as a receiver and center button. I'm looking forward to you possibly adding support for it.

Also thank you for the last paragraph. Very interesting, theoretically if I could find something really small that could be programmed, it would also be an option.