TrueOpenVR / TrueOpenVR-DIY

DIY VR devices
97 stars 10 forks source link

A, B buttons #21

Closed karizr45 closed 1 year ago

karizr45 commented 1 year ago

How can i add A and B buttons to controller.ino

r57zone commented 1 year ago

Write the desired digital pin at the beginning of the sketch https://github.com/TrueOpenVR/TrueOpenVR-DIY/blob/master/Controllers/Arduino/Controller.ino#L10-L22

karizr45 commented 1 year ago

But will driver read it?

r57zone commented 1 year ago

yes

r57zone commented 1 year ago

https://youtu.be/HWtdCc_f4ww?t=1080

karizr45 commented 1 year ago

Thanks

karizr45 commented 1 year ago

Only pins without ctrl sequence?

karizr45 commented 1 year ago

I mean changing ctrl float

r57zone commented 1 year ago

The sketch has an example of how to change

    int CtrlButtons = 0;
    if (digitalRead(GripBtnPin) == LOW)
    CtrlButtons |= GRIP_BTN;

    if (digitalRead(ThumbStickBtnPin) == LOW)
    CtrlButtons |= THUMB_BTN; 

    if (digitalRead(MenuBtnPin) == LOW)
    CtrlButtons |= MENU_BTN;

    if (digitalRead(SystemBtnPin) == LOW)
    CtrlButtons |= SYS_BTN;

    ctrl[8] = CtrlButtons;
karizr45 commented 1 year ago

OK thx