Welcome to the forum for MobiFlight! Feel free to reach out to the community in case you have questions, issues or just want to share great ideas or details about your latest home cockpit project.
You like MobiFlight? Donate via PayPal and support the MobiFlight development. Thanks!
Code:
### assumed output received (input to Raspi) d = { "45 : 0x2D -- 41 : 0x29 -- 237 : 0xED -- 233": "." ,"61 : 0x3D -- 57 : 0x39 -- 13 : 0x0D -- 9 : 0x09" : 0 ,"61 : 0x3D -- 57 : 0x39 -- 29 : 0x1D -- 25 : 0x19" : 1 .... }
Code:
C++ code #include <pigpio.h> #include <iostream> using namespace std; void runSlave(); void closeSlave(); int getControlBits(int, bool); const int slaveAddress = 0x27; // <-- Your address of choice bsc_xfer_t xfer; // Struct to control data flow int main(){ // Chose one of those two lines (comment the other out): runSlave(); //closeSlave(); return 0; } void runSlave() { gpioInitialise(); cout << "Initialized GPIOs\n"; // Close old device (if any) xfer.control = getControlBits(slaveAddress, false); // To avoid conflicts when restarting bscXfer(&xfer); ......
Code:
Mobilfight 0x27 output Debug 12/17/2022 18:10:37 Command: SetLcdDisplayI2C <25,1, 1437 ;> Debug 12/17/2022 18:10:37 Command: SetLcdDisplayI2C <25,1, 1444 ;> Debug 12/17/2022 18:10:37 Command: SetLcdDisplayI2C <25,1, 1450 ;> Debug 12/17/2022 18:10:37 Command: SetLcdDisplayI2C <25,1, 1463 ;> Debug 12/17/2022 18:10:37 Command: SetLcdDisplayI2C <25,1, 1470 ;> Debug 12/17/2022 18:10:37 Command: SetLcdDisplayI2C <25,1, 1476 ;> Debug 12/17/2022 18:10:37 Command: SetLcdDisplayI2C <25,1, 1486 ;> C++ pipe to python reading the output 0 [1] 0 1437 [1] 0 [1] 0 1444 0 [1] 0 1450 [1] 0 [1] 0 1462 [1] 0 [1] 0 -1 [1] 0 [1] 0 1470 [1] 0 [1] 0 1476 [1] 0 [1] 0 1486 [1] 0 [1] 0 -1 [1]