following is my code
#include <Joystick.h>
#include <Mux.h>
#include "MobiFlight.h" // Include MobiFlight core functionality
#define JOYSTICK_COUNT 2
Joystick_ Joystick[JOYSTICK_COUNT] = {
Joystick_(0x03, JOYSTICK_TYPE_JOYSTICK, 29, 0, false, false, false, false, false, false, false, false, false, false, false),
Joystick_(0x04, JOYSTICK_TYPE_JOYSTICK, 25, 0, false, false, false, false, false, false, false, false, false, false, false)
};
Mux mux1(Pin(9, INPUT_PULLUP, PinType::Digital), Pinset(13, 12, 11, 10));
Mux mux2(Pin(3, INPUT_PULLUP, PinType::Digital), Pinset(7, 6, 5, 4));
Mux mux3(Pin(A4, INPUT_PULLUP, PinType::Digital), Pinset(A0, A1, A2, A3));
void setup() {
MobiFlight.begin(); // Initialize MobiFlight
for (int index = 0; index < JOYSTICK_COUNT; index++) {
Joystick[index].begin();
}
}
void loop() {
MobiFlight.run(); // Run MobiFlight tasks
// Joystick Processing
Joystick[0].setButton(1, !mux1.read(11));
Joystick[0].setButton(0, !mux1.read(10));
Joystick[0].setButton(3, !mux1.read(8));
Joystick[0].setButton(2, !mux1.read(9));
Joystick[0].setButton(4, !mux1.read(13));
Joystick[0].setButton(6, !mux1.read(14));
Joystick[0].setButton(5, !mux1.read(15));
Joystick[0].setButton(7, !mux1.read(12));
toggle3PosA(0, 11, 20);
toggle3PosA(0, 13, 23);
toggle3PosB(1, 1, 0);
toggle3PosB(1, 3, 3);
}
void toggle3PosA(int joy, int pin, int key) {
if (!mux2.read(pin) == 0 && !mux2.read(pin + 1) == 0) {
Joystick[joy].setButton(key, 0);
Joystick[joy].setButton(key + 1, 1);
Joystick[joy].setButton(key + 2, 0);
}
}
void toggle3PosB(int joy, int pin, int key) {
if (!mux3.read(pin) == 0 && !mux3.read(pin + 1) == 0) {
Joystick[joy].setButton(key, 0);
Joystick[joy].setButton(key + 1, 1);
Joystick[joy].setButton(key + 2, 0);
}
}
following is the error i get when building
MobiFlight.h: No such file or directory