Joe,jph wrote: ↑Sun Sep 04, 2022 3:33 pmHi Kirk1. Do the momentary switches provide an input to the arduino which AM will read? Are those switches connected to GND and a pin on the arduino as shown?
2. If the switch is closed does AM read a high output on pins 6 or 7 and then writes to the dataref / command in Xplane to switch on the autopilot in the sim?
3. Does AM then at the same time send a high output to pins 12 and 13 to signal the array to connect the GND side of the magnet circuit or does AM read the dataref in the sim and use that to activate pins 12 and 13?
1. yes
2. when switch closed AM reads a LOW as they are normally read as HIGH when inactive due to the internal WPUs. When the switch is closed the port pin sees a LOW.
I presume these are 'real' switches that you operate yes ?
If so, and the electromagnets hold the switches depressed when AP active then what you say sounds right - providing all the data is available and accessible to you. I would not have thought that the sim is aware of the electromagnets - only the AP engaged, which you can use as the energising signal.
By using the ap engaged to energise the electromagnets the sim logic should operate correctly so in the event of an ap disconnect via the aircraft systems the switches will be release automatically.
Joe
Thanks for the prompt reply.
Yes the "real" switches are those on the autopilot that stay closed when the magnet is energized by the same switch.
So it makes sense that the real switch input will be read by AM and then writes to the autopilot dataref to move the sim switch.
Then the sim switch dataref is read and AM will send a HIGH to the appropriate darlington pins and thus switch the appropriate array.
I think I understand it but I'd like to test the darlington without the AM code and the sim in the loop.
Using my breadboard with the darlington installed, I assume I can use the A/P switches to open and close the 5v side coming from the arduino.
Is this correct?