Sonntag, November 11, 2018

Condition on function

Finally, I figured out / understood the syntax of "conditions". The goal was to implement the logic if the BATTERY SWITCH is off, then also all COIL-GAUGES are switched off and indicating no value. In SimVimCockpit 0.9.27a the new flag "x" makes this possible. The description below explains how to use it.

Two steps are needed:

1. add condition to PWM output. In my case the BATTERY SWITCH is connected to multiplexer Pin 8.1. The logic is the following: if the condition is met (SWITCH ON), then the function (GAUGE) is active. If condition is not met (SWITCH OFF), then the function is inactive and values go to zero.
Syntax: c=S<Pin number>
c=S8.1

2. add the flag to set output values to zero if the specified condition is met.
In this case here, if BATTERY SWITCH is ON also the COIL GAUGE will show the values.
The flag works on PWM (coil instruments), Stepper and Servo.
Syntax: f=x
f=x

Option: add the mode when no hardware (switch, button) is assigned to a Arduino pin.
Syntax: S<Pin number> Mode_Switch
S8.1 Mode_Switch

Here is the current version of my "data.cfg". Marked yellow the condition and flag:
*1-1U1
# written by VAKA Nov 2018
# -----------------------------
# RJn = Connector number
# A or B = jumper setting on Breakout Board
# Dn or An = pin numbers on Arduino
# RJ1 Digital In:  A=D8,  B=D9 
# RJ2 Digital In:  A=D10, B=D11
# RJ3 Digital In:  A=D12, B=D13
# RJ4 Analog  In:  A=A0,  B=A1
# RJ5 Analog  Out: A=D30, B=D31
# RJ6 Digital Out: A=D40, B=D41
# -----------------------------
[Input]
S8.0 Beacon_Light
S8.1 Battery1_Switch
S8.2 Avionics_Master_Switch
S8.3 Bus_Cross_Tie
E8.5 Baro_Setting
# -----------------------------
[Output]
P30.0 Fuel_Level_Tank1 r=0,19.7,39.4,59,79.4 m=0,38,56,72,100 c=S8.1  f=x
P30.1 Fuel_Level_Tank2 r=0,19.7,39.4,59,79.4 m=0,38,56,72,100 c=S8.1  f=x
P30.2 Oil_Temp_C_Eng1 r=0,80,160,290 m=0,42,64,100 c=S8.1  f=x
P30.3 RPM_Engine1 r=0,2260 m=0,100
# -----------------------------
[Startup]
XPDR_CODE v=7000
Com1_Active_6 v=119625
Com1_Stby_6 v=134125
Beacon_Audio_Switch v=0


10s Videoclip:
 


Keine Kommentare: