well, I may start a new topic, but I'm really hoping to hear from Clerick himself.
I have a game controller build, with 4 total joysticks, wired to an arduino nano v3 (old bootloader).
I want to use vjoy to play space simulator games like Starmade and Astrokill,,
I have a sketch (please excuse my terribleness with programming, I am not a programmer I just clicked around until figuring some things out) that reads my controls and prints them to the serial monitor.
I TRIED to follow your ibus instructions, but I don't know, (no.... JOY ..... ) I tried pasting the ibus.h and ibus.cpp to files in my libraries folder but first problem, no such ibus.h found,, second problem, I actually just don't know what I'm doing, or how to make ibus protocol, or if that's the best option anyway, to get vjoy. I think that once vjoy sees my inputs, basically everything else works automatically,,, vjoy already shows up in my game options menus.
#include "ibus.h"
#define UPDATE_INTERVAL 10
#define BAUD_RATE 115200
Ibus ibus(20);
void setup() {
// put your setup code here, to run once:
pinMode(5,INPUT);
pinMode(6,INPUT);
pinMode(7,INPUT);
pinMode(8,INPUT);
pinMode(9,INPUT);
pinMode(10,INPUT);
pinMode(11,INPUT);
pinMode(12,INPUT);
pinMode(13,INPUT);
pinMode(14,INPUT);
pinMode(15,INPUT);
pinMode(16,INPUT);
Serial.begin(BAUD_RATE);
}
void loop() {
// put your main code here, to run repeatedly:
int buttonB = digitalRead(5);
int buttonA = digitalRead(3);
int buttonX = digitalRead(2);
int buttonY = digitalRead(4);
int buttonR1 = digitalRead(6);
int buttonR2 = digitalRead(7);
int buttonL1 = digitalRead(9);
int buttonL2 = digitalRead(8);
int buttonH1 = digitalRead(11);
int buttonH2 = digitalRead(12);
int buttonH3 = digitalRead(10);
int buttonH4 = digitalRead(13);
int stickOneX = analogRead(A1);
int stickOneY = analogRead(A0);
int stickTwoX = analogRead(A2);
int stickTwoY = analogRead(A3);
int stickThreeX = analogRead(A5);
int stickThreeY = analogRead(A4);
int stickFourX = analogRead(A7);
int stickFourY = analogRead(A6);
unsigned long time = millis();
ibus.begin();
ibus.write(buttonA);
ibus.write(buttonB);
ibus.write(buttonX);
ibus.write(buttonY);
ibus.write(buttonH1);
ibus.write(buttonH2);
ibus.write(buttonH3);
ibus.write(buttonH4);
ibus.write(buttonR1);
ibus.write(buttonR2);
ibus.write(buttonL1);
ibus.write(buttonL2);
ibus.write(stickOneX);
ibus.write(stickOneY);
ibus.write(stickTwoX);
ibus.write(stickTwoY);
ibus.write(stickThreeX);
ibus.write(stickThreeY);
ibus.write(stickFourX);
ibus.write(stickFourY);
ibus.end();
Serial.print("buttonA: ");
Serial.println(buttonA);
Serial.print("buttonB: ");
Serial.println(buttonB);
Serial.print("buttonX: ");
Serial.println(buttonX);
Serial.print("buttonY: ");
Serial.println(buttonY);
Serial.print("buttonH1: ");
Serial.println(buttonH1);
Serial.print("buttonH2: ");
Serial.println(buttonH2);
Serial.print("buttonH3: ");
Serial.println(buttonH3);
Serial.print("buttonH4: ");
Serial.println(buttonH4);
Serial.print("buttonR1: ");
Serial.println(buttonR1);
Serial.print("buttonR2: ");
Serial.println(buttonR2);
Serial.print("buttonL1: ");
Serial.println(buttonL1);
Serial.print("buttonL2: ");
Serial.println(buttonL2);
Serial.print("stickOneX: ");
Serial.println(stickOneX);
Serial.print("stickOneY: ");
Serial.println(stickOneY);
Serial.print("stickTwoX: ");
Serial.println(stickTwoX);
Serial.print("stickTwoY: ");
Serial.println(stickTwoY);
Serial.print("stickThreeX: ");
Serial.println(stickThreeX);
Serial.print("stickThreeY: ");
Serial.println(stickThreeY);
Serial.print("stickFourX: ");
Serial.println(stickFourX);
Serial.print("stickFourY: ");
Serial.println(stickFourY);
time = millis() - time;
if(time < UPDATE_INTERVAL)
delay(UPDATE_INTERVAL - time);
}