I'm setting up an encoder panel to control radios, etc. I'm testing the commands with a Packet Sender program, and am able to control the functions with the CMND function. For example, CMND+sim/autopilot/altitude_up from the Packet Sender converts the ASCII to hex and causes the altitude setting to increase in the sim. Notice I took the 0 after D out to make it work. (Documentation states: CMND0+sim/flight_controls/flaps_up)
The documentation/syntax (D:\X-Plane 11\Instructions\X-Plane SPECS from Austin\Exchanging Data with X-Plane.rtfd\TXT.rtf) is unclear to me for the DREF command:
DREF0+(4byte byte value of 1)+ sim/cockpit/switches/anti_ice_surf_heat_left+0+spaces to complete to 509 bytes
Assuming I only want to use datarefs with a value of 0 or 1, and I wanted to set night vision on, the resulting syntax doesn't seem to work:
[followed by enough spaces to get to 504 bytes, which differs from documentation stating 509 bytes].
I believe my difficulty is the piece I've notated with the question marks. The 4-byte byte value for 1, and whether parentheses or spaces are needed around it, or commas/dashes between.
I would appreciate clarification if someone has it, i.e., a statement that works in the Packet Sender, and later in an Arduino program.
Thank You, RF