pinball VR

pasappie
Posts: 4
Joined: Thu Jul 14, 2022 9:37 pm

pinball VR

Postby pasappie » Thu Jul 14, 2022 9:46 pm

i want to make a wireless VR pinball machine with the esp32 the game i play is VR FX2 pinball it needs inputs like L_shift for left flipper and R_shift for right flipper also it needs a launch button A and B to go back i build it in a MDF box with Arcade buttons my wish is to connect the esp32 with bluetooth on my Ocullus Quest2 and then i play the game wireless when i push a arcade button

ESP_Sprite
Posts: 9591
Joined: Thu Nov 26, 2015 4:08 am

Re: pinball VR

Postby ESP_Sprite » Fri Jul 15, 2022 2:09 am

Okay, good luck with that. Did you have a question?

pasappie
Posts: 4
Joined: Thu Jul 14, 2022 9:37 pm

Re: pinball VR

Postby pasappie » Sat Jul 16, 2022 6:42 am

Goodmorning,

I am dutch so my english is not very strong my question is to program the ESP32 with a simple arcade buttons.
When i push the Acrade button the ESP32 send a key stroke to the Oculus quest2
So when i push a button it sends with bluetooth a A-Key so it launch the ball in the game
is it possible?

Image
Image

ESP_Sprite
Posts: 9591
Joined: Thu Nov 26, 2015 4:08 am

Re: pinball VR

Postby ESP_Sprite » Sat Jul 16, 2022 8:15 am

Geloof me, je Engels is vele malen beter dan dat van sommige van mijn collega's hier, ik lees in je bericht niets waar je je voor hoeft te schamen :P

Assuming the Oculus 2 can interface with Bluetooth keyboard devices, what you want is a Bluetooth HID solution. Not sure what SDK you use, but for Arduino there's a thing here. ESP-IDF has a BT HID example as well, but that's for a mouse, so you may need to do a bit more work to get that working.

pasappie
Posts: 4
Joined: Thu Jul 14, 2022 9:37 pm

Re: pinball VR

Postby pasappie » Sun Jul 17, 2022 5:09 pm

Bedankt voor de reactie!

I found on youtube this video https://youtu.be/hC3TyvBmeS8
it is for a 26 button keyboard with 4 layers.
I only need the L for Navigate
and the Y for Filter
the B for Back or Pauze
the A for launch the ball
X for Recenter
and the Left shift for left flipper button and the right shift for right flipper button.
I try to make the code less difficult so it works as a arcade controle

pasappie
Posts: 4
Joined: Thu Jul 14, 2022 9:37 pm

Re: pinball VR

Postby pasappie » Mon Jul 18, 2022 8:07 pm

The problem in this code is that it is in layers, but i only need a code that make a keys stroke with bluetooth

when i push a button with ground on the arcade button and ground on the ESP32 en like pin D2 on the second connection on the arcadebutton (MicroSwitch) and on the ESP32

the ESP32 must send a letter A with bluetooth connection

i need this keys:

Left shift key for left flipper
Right shift key for right flipper
A key for Launch the ball
B key for Back or Pauze
Y key for Filter
L key for Navigation

i know it has to be simple but it is not for me

ESP_Sprite
Posts: 9591
Joined: Thu Nov 26, 2015 4:08 am

Re: pinball VR

Postby ESP_Sprite » Tue Jul 19, 2022 1:30 am

Okay, the main code for that is here.

The main thing that reads the buttons and sends them is at line 189 and below, but you're right in that there is some weird stuff with layers going on. What you can do is remove all that up to the comment that says 'THE END'. The main way to send keys seems to be code like this:

Code: Select all

if (btn2.pressedFor(rpt2)) {
	bleKeyboard.print("a");
}
If you simply do that for all keys instead of the code you just removed, you should be good. (Replace the 2 in btn2 and rpt2 with the number of the button and the a in "a" with the key you want to map it to.)

Who is online

Users browsing this forum: No registered users and 86 guests