Jump to content

Ruahatu

Members
  • Posts

    57
  • Joined

  • Last visited

Personal Information

  • Flight Simulators
    FsX - DCS Black Shark
  • Location
    Belgium
  1. Thanks for your help Hansolo :thumbup: Here is my code definePushButton("UHF_1", 31, 3006, 388, "UHF RADIO", "UHF 1") -- OK definePushButton("UHF_2", 31, 3007, 389, "UHF RADIO", "UHF 2") -- OK definePushButton("UHF_3", 31, 3008, 390, "UHF RADIO", "UHF 3") -- OK definePushButton("UHF_4", 31, 3009, 391, "UHF RADIO", "UHF 4") -- OK definePushButton("UHF_5", 31, 3010, 392, "UHF RADIO", "UHF 5") -- OK definePushButton("UHF_6", 31, 3011, 393, "UHF RADIO", "UHF 6") -- OK definePushButton("UHF_7", 31, 3012, 394, "UHF RADIO", "UHF 7") -- OK definePushButton("UHF_8", 31, 3013, 395, "UHF RADIO", "UHF 8") -- OK definePushButton("UHF_9", 31, 3014, 396, "UHF RADIO", "UHF 9") -- OK definePushButton("UHF_0", 31, 3015, 397, "UHF RADIO", "UHF 0") -- OK
  2. Hello, I made a custom keypad for the radio of the GAZELLE. The "-" are connected to each other then to the card. my problem is that when I press, I have a repeat send key. is this a problem with my welds?? should I add a resistor? If yes where and what kind? Tanks for your help and sorry for my english.
  3. https://forums.eagle.ru/showthread.php?t=190806
  4. Thank you Ian for your explanations and your wonderful program :thumbup:
  5. :cheer3nc: EUREKA I found it local vhf_lut1 = { ["0"] = "00", ["25"] = "25", ["50"] = "50", ["75"] = "75" } local function getVhfAmFreqency() local freq1 = string.format("%.0f", GetDevice(0):get_argument_value(133)*10) local freq2 = string.format("%.0f", GetDevice(0):get_argument_value(134)*10)--:sub(3) local freq3 = string.format("%.0f", GetDevice(0):get_argument_value(136)*10)--:sub(3) local freq4 = string.format("%.0f", GetDevice(0):get_argument_value(138)*10)--:sub(3) local freq5 = vhf_lut1[string.format("%.0f", GetDevice(0):get_argument_value(139)*100)] return freq1 .. freq2 .. freq3 .. "." .. freq4 .. freq5 end defineString("AM_DISPLAY", getVhfAmFreqency, 7, "VHFAM Panel", "VHFAM Display") But still want info about this :sub(3)
  6. Always busy investigating If I understand correctly, the %.0f is used to format the number exactly as many digits as needed by the argument?? Someone can explain to me wthat it is the function sub(3) ??? Thanks
  7. For more visibility, I open a new post concerning my questions about my library for the Gazelle. My problem is related to the display of the AM radio. The radio have 6 digits Here is the argument AM_Radio_freq_cent = 133, AM_Radio_freq_dix = 134, AM_Radio_freq_unite = 136, AM_Radio_freq_dixieme = 138, AM_Radio_freq_centieme = 139, The frequency increases by 0.025 When i use this code local function getVhfNavFreq() local function a(n) return GetDevice(0):get_argument_value(n) end return string.format("%.0f%.0f%.0f", a(133)*10, a(134)*10, a(136)*10) .. "." .. string.format("%.0f%.0f", a(138)*10, a(139)*10) end defineString("VHFNAV_FREQ", getVhfNavFreq, 7, "VHF NAV Radio", "VHF NAV Frequency") I can see in the controle reference the frequency but the 2 last digit are wrong 0.000 = 0 0.025 = 3 0.050 = 5 0.075 = 8 I understand that i have to use this type of code local vhf_lut1 = { ["0.00"] = "0", ["0.25"] = "3", ["0.50"] = "5", ["0.75"] = "8" } local function getVhfAmFreqency() local freq1 = string.format("%.0f",GetDevice(0):get_argument_value(133)):sub(3) local freq2 = string.format("%.0f", GetDevice(0):get_argument_value(134)):sub(3) local freq3 = string.format("%.0f", GetDevice(0):get_argument_value(136)):sub(3) local freq4 = string.format("%.0f", GetDevice(0):get_argument_value(138)):sub(3) local freq5 = vhf_lut1[string.format("%.2f",GetDevice(0):get_argument_value(139))] return freq1 .. freq2 .. freq3 "." .. freq3 .. freq4 .. freq5 end defineString("AM_DISPLAY", getVhfAmFreqency, 7, "VHFAM Panel", "VHFAM Display") But it does not work and once again i dont understand :cry: Thanks for your help
  8. :music_whistling: I am back for the VHF AM for the Gazelle :cry: The radio have 6 digits AM_Radio_freq_cent = 133, AM_Radio_freq_dix = 134, AM_Radio_freq_unite = 136, AM_Radio_freq_dixieme = 138, AM_Radio_freq_centieme = 139, The frequency increases by 0.025 When i use this code local function getVhfNavFreq() local function a(n) return GetDevice(0):get_argument_value(n) end return string.format("%.0f%.0f%.0f", a(133)*10, a(134)*10, a(136)*10) .. "." .. string.format("%.0f%.0f", a(138)*10, a(139)*10) end defineString("VHFNAV_FREQ", getVhfNavFreq, 7, "VHF NAV Radio", "VHF NAV Frequency") I can see in the controle reference the frequency but the 2 last digit are wrong 0.000 = 0 0.025 = 3 0.050 = 5 0.075 = 8 I understand that i have to use this type of code local vhf_lut1 = { ["0.00"] = "0", ["0.25"] = "3", ["0.50"] = "5", ["0.75"] = "8" } local function getVhfAmFreqency() local freq1 = string.format("%.0f",GetDevice(0):get_argument_value(133)):sub(3) local freq2 = string.format("%.0f", GetDevice(0):get_argument_value(134)):sub(3) local freq3 = string.format("%.0f", GetDevice(0):get_argument_value(136)):sub(3) local freq4 = string.format("%.0f", GetDevice(0):get_argument_value(138)):sub(3) local freq5 = vhf_lut1[string.format("%.2f",GetDevice(0):get_argument_value(139))] return freq1 .. freq2 .. freq3 "." .. freq3 .. freq4 .. freq5 end defineString("AM_DISPLAY", getVhfAmFreqency, 7, "VHFAM Panel", "VHFAM Display") But it does not work and once again i dont understand :cry: Thanks for your help
  9. Thanks for your help Ian :thumbup: Here is my code where the LED work BIOS.protocol.beginModule("SA342", 0x4200) BIOS.protocol.setExportModuleAircrafts({"SA342M", "SA342L", "SA342Mistral"}) local document = BIOS.util.document local defineIndicatorLight = BIOS.util.defineIndicatorLight local definePushButton = BIOS.util.definePushButton local definePotentiometer = BIOS.util.definePotentiometer local defineRotary = BIOS.util.defineRotary local defineSetCommandTumb = BIOS.util.defineSetCommandTumb local defineTumb = BIOS.util.defineTumb local defineToggleSwitch = BIOS.util.defineToggleSwitch local defineToggleSwitchToggleOnly = BIOS.util.defineToggleSwitchToggleOnly local defineFixedStepTumb = BIOS.util.defineFixedStepTumb local defineVariableStepTumb = BIOS.util.defineVariableStepTumb local defineString = BIOS.util.defineString local defineRockerSwitch = BIOS.util.defineRockerSwitch local defineMultipositionSwitch = BIOS.util.defineMultipositionSwitch local defineElectricallyHeldSwitch = BIOS.util.defineElectricallyHeldSwitch local defineFloat = BIOS.util.defineFloat local define8BitFloat = BIOS.util.define8BitFloat defineIndicatorLight("Voyant_DEM", 300, "Front Panel", "Voyant Start engine") defineIndicatorLight("Voyant_RLT", 301, "Front Panel", "Voyant RLT") defineIndicatorLight("Voyant_BLOC", 302, "Front Panel", "Voyant BLOC") defineIndicatorLight("Voyant_ALARME", 303, "Front Panel", "Voyant Alarme") defineIndicatorLight("Voyant_RSUPP", 320, "Front Panel", "Voyant RSUPP") defineIndicatorLight("Voyant_RCONV", 321, "Front Panel", "Voyant RCONV") defineIndicatorLight("Voyant_FILTAS", 322, "Front Panel", "Voyant Sand Filter") If I add the code for the radio display local function getUHFFrequency() local ind = BIOS.util.parse_indication(5) if ind == nil then return " " end local freqStatus = ind["UHF_Freq"] -- e.g. "251.000" return freqStatus end defineString("UHF_FREQUENCY", getUHFFrequency, 7, "UHF RADIO", "UHF Frequency Display") The display work in the control reference but the Sand filter led stay on and the Ralenti, Bloc, RSUP and RCONV dont work in my panel but are right in the control reference. If i turn on the radio, the BLOC and RCONV led goes on. In game to test the LED simply pusch the test button near the DEM, RLT, BLOC LED. The Sand Filter must equip the gazelle via emport in the mission editor and simply put the switch bellow the LED on. wait a few second and the LED must be on to. Here my arduino squetch for the first MEGA /* use '#define DCSBIOS_DEFAULT_SERIAL' instead if your Arduino board * does not feature an ATMega328 or ATMega2650 controller. */ #define DCSBIOS_IRQ_SERIAL #include "DcsBios.h" /* Declare a Master Caution Reset button on pin 10 */ DcsBios::RotaryEncoder labelsPtr("LABELS_PTR", "-3200", "+3200", 22, 23); DcsBios::Switch3Pos paModePtr("PA_MODE_PTR", 24, 25); DcsBios::Switch2Pos paLacetPtr("PA_LACET_PTR", 26); DcsBios::Switch2Pos paRoulisPtr("PA_ROULIS_PTR", 27); DcsBios::Switch2Pos paTangagePtr("PA_TANGAGE_PTR", 28); DcsBios::Switch2Pos paMasterPtr("PA_MASTER_PTR", 29); DcsBios::Switch3Pos interMaPtr("INTER_MA_PTR", 30, 31); DcsBios::Switch2Pos fuelPumpFrontPtr("FUEL_PUMP_FRONT_PTR", 32); DcsBios::Switch2Pos clockStartstopPtr("CLOCK_STARTSTOP_PTR", 33); DcsBios::Switch2Pos clockResetPtr("CLOCK_RESET_PTR", 34); DcsBios::Switch2Pos rsuppPtr("RSUPP_PTR", 35); DcsBios::Switch2Pos rconvPtr("RCONV_PTR", 36); DcsBios::Switch2Pos filtasPtr("FILTAS_PTR", 37); DcsBios::Switch2Pos fmagPtr("FMAG_PTR", 38); DcsBios::LED voyantFiltas(0x4254, 0x0020, 41); DcsBios::LED voyantRconv(0x4254, 0x0010, 40); DcsBios::LED voyantRsupp(0x4254, 0x0008, 39); void setup() { DcsBios::setup(); } void loop() { DcsBios::loop(); } And the second UNO in RS485 #define DCSBIOS_RS485_SLAVE 5 /* The Arduino pin that is connected to the /RE and DE pins on the RS-485 transceiver. */ #define TXENABLE_PIN 2 #include "DcsBios.h" /* paste code snippets from the reference documentation here */ DcsBios::Switch2Pos trimPtr("TRIM_PTR", 3); DcsBios::ActionButton vatestPtrToggle("VATEST_PTR", "TOGGLE", 4); DcsBios::Switch2Pos batteriePtr("BATTERIE_PTR", 5); DcsBios::Switch2Pos alterPtr("ALTER_PTR", 6); DcsBios::Switch2Pos genePtr("GENE_PTR", A0); const byte artvisvhfdopPtrPins[4] = {7, 8, 9, 10}; DcsBios::SwitchMultiPos artvisvhfdopPtr("ArtVisVhfDop_PTR", artvisvhfdopPtrPins, 4); DcsBios::Switch3Pos egPilotePtr("EG_PILOTE_PTR", 11, 12); DcsBios::LED voyantBloc(0x4254, 0x0002, A1); DcsBios::LED voyantRlt(0x4254, 0x0001, A2); DcsBios::LED voyantDem(0x4252, 0x8000, A3); void setup() { DcsBios::setup(); } void loop() { DcsBios::loop(); } I think it uses the same Buffer or adress 4254 ??? Here the info in control reference for the display Output Type: string Address: 0x4254 Max. Length: 7 Description: UHF Frequency Display I hope you have enough information. Thanks again
  10. For the Gazelle the indicator information are in the arg_int.lua
  11. Thanks Ian, It works in the control reference but it make conflicts with somme led??? They no longer work Any idea?? Thanks
×
×
  • Create New...