Jump to content

byteman59

Members
  • Posts

    120
  • Joined

  • Last visited

Everything posted by byteman59

  1. Ah, thank you. Will definately need to check it out. btw, is this book worth getting for reference?
  2. What is Helios and when is it used in a SimPit? thank you!
  3. That is so cool! Great job!
  4. btw curious, what did you use for the flashtlight?
  5. Great looking sim. I figured if i build structure i would get lazy and play to much instead of building panels! Will build left console after all panels are complete. Yes, it is functional. Here is the code. Got help from others on this forum! IFF_PANEL_BcdWheel.ino
  6. Finally finished IFF, SAS and Aux panels. IFF is scratch built, with the techniques that i have learned from all of you! I can make those files available if interested. I can also make available the stl files for the Knobs. Thanks to the Warthog Project! null
  7. Thanks lesthegrngo, I have been messing around with using a wedge method. Since most toggles taper down to a smaller diameter, i have created split wedges that keep the cap from moving around. Works, but could be better.
  8. Are there any Toggle Switch caps for the A10? Or perhaps dimensions of them? There is a Flat top, dome and a Pointed one.
  9. Got the LED working correctly, but the LED will not turn on when i hold the TO Trim button for over 20 seconds. Does anything else need to be set?
  10. btw, any idea why my sketch fails with exit status 1 no matching function for call to 'DcsBios::PollingInput::PollingInput()' when using dcs-bios arduino library from forks master 3.7. Does not fail when using Hub 0.2.11 library I have included my sketch for review. The sketch contains code for IFF and SAS panels. IFF_SAS.ino
  11. I do have my LED currently using active low. 3.3v > LED(3.3fv) then connected to Arduino.
  12. thank you!
  13. Thanks No1sonuk, Looks like will need to reverse my pinmode for the LED as it is on when button is not pressed. How would i base the code to reverse the LED function?
  14. Hello everyone, I have a question on the T/O Trim button and LED on the SAS Panel for the a10-II. I have the TO button setup as a momentary button. When should the Take-Off led light up? Currently the LED is on constantly, even when the TO button is pressed. Any suggestions would be greatly appreciated, thanks in advance! Bob
  15. Found this on gitHub, looks like there is class for BCD already written. Seems to work fine. https://github.com/DCSFlightpanels/dcs-bios-arduino-library/wiki/BcdWheel
  16. Looks like Arduino Library v0.2.11 hub works fine. Does this mean it will not work if try to use DCS-Bios forked version?
  17. Thanks, want to give that a try and see what happens.
  18. Vinc, what version of DCSBios hub are you using?
  19. I keep getting an error message when running this code. Have tried the latest DCS-BIOS Libraies for both hub and fork. Keep getting error "no matching function for call to "DcsBios::pollingInput::PollingInput()" Not sure what I'm missing, any ideas? Thanks Bob
  20. Able to resolve Test and Reply LED and the CODE Rotary Switch to work. Below is my sketch. Still having issues with the thumb wheels. will go over the suggested post again and see if i can't figure this out. Thank you all! #define DCSBIOS_IRQ_SERIAL #include "DcsBios.h" #include <timer.h> Timer tm; int Code_dial_ingame = 1; // hold value from DCS //Define the inputs for rotary switch const int code_zero = 49; const int code_B = 47; const int code_A = 45; const int code_hold = 43; //IFF Code: ZERO - B - A - (HOLD) void onIffCodeChange(unsigned int newValue_Code) { Code_dial_ingame = newValue_Code; } DcsBios::IntegerBuffer iffCodeBuffer(0x111a, 0xc000, 14, onIffCodeChange); //IFF Master: OFF - STBY - LOW - NORM - EMER ROTARY ENCODER const byte iffMasterPins[5] = {34, 36, 38, 40, 42}; DcsBios::SwitchMultiPos iffMaster("IFF_MASTER", iffMasterPins, 5); //IFF On/Out TOGGLE ON OFF DcsBios::Switch2Pos iffOnOut("IFF_ON_OUT", 52); //IFF Out: LIGHT - OFF - AUDIO TOGGLE ON OFF ON DcsBios::Switch3Pos iffOutAudioLight("IFF_OUT_AUDIO_LIGHT", 32, 33); //REPLY Push to Test PUSH BUTTON DcsBios::Switch2Pos iffReplyTest("IFF_REPLY_TEST", 41); //IFF REPLY Light (green) LED OUTPUT void onIffReplyTestChange(unsigned int newValue) { if (newValue == 1) { digitalWrite(37,LOW); } else { digitalWrite(37,HIGH); } /* your code here */ } DcsBios::IntegerBuffer iffReplyTestBuffer(0x1128, 0x8000, 15, onIffReplyTestChange); //TEST Push to Test PUSH BUTTON DcsBios::Switch2Pos iffTestTest("IFF_TEST_TEST", 35); //IFF TEST Light (green) LED OUTPUT void onIffTestTestChange(unsigned int newValue) { if (newValue == 1) { digitalWrite(39,LOW); } else { digitalWrite(39,HIGH); } /* your code here */ } DcsBios::IntegerBuffer iffTestTestBuffer(0x112a, 0x0040, 6, onIffTestTestChange); //Mode-1 Wheel 1 ROTARY ENCODER const byte iffMode1Wheel1Pins[3] = {25, 26, 27}; DcsBios::SwitchMultiPos iffMode1Wheel1("IFF_MODE1_WHEEL1", iffMode1Wheel1Pins, 3); //Mode-1 Wheel 2 ROTARY ENCODER const byte iffMode1Wheel2Pins[2] = {23, 24}; DcsBios::SwitchMultiPos iffMode1Wheel2("IFF_MODE1_WHEEL2", iffMode1Wheel2Pins, 2); //Mode-3A Wheel 1 ROTARY ENCODER const byte iffMode3aWheel1Pins[3] = {54, 55, 56}; DcsBios::SwitchMultiPos iffMode3aWheel1("IFF_MODE3A_WHEEL1", iffMode3aWheel1Pins, 3); //Mode-3A Wheel 2 ROTARY ENCODER const byte iffMode3aWheel2Pins[3] = {60, 59, 58}; DcsBios::SwitchMultiPos iffMode3aWheel2("IFF_MODE3A_WHEEL2", iffMode3aWheel2Pins, 3); //Mode-3A Wheel 3 ROTARY ENCODER const byte iffMode3aWheel3Pins[3] = {63, 64, 65}; DcsBios::SwitchMultiPos iffMode3aWheel3("IFF_MODE3A_WHEEL3", iffMode3aWheel3Pins, 3); //Mode-3A Wheel 4 ROTARY ENCODER const byte iffMode3aWheel4Pins[3] = {66, 67, 68}; DcsBios::SwitchMultiPos iffMode3aWheel4("IFF_MODE3A_WHEEL4", iffMode3aWheel4Pins, 3); //Test M-1 TOGGLE OFF-ON-ON DcsBios::Switch3Pos iffTestM1("IFF_TEST_M1", 50, 48); //Test M-2 OFF-ON-ON DcsBios::Switch3Pos iffTestM2("IFF_TEST_M2", 51, 53); //Test M-3 OFF-ON-ON DcsBios::Switch3Pos iffTestM3("IFF_TEST_M3", 30, 31); //Test M-4 OFF-ON-ON DcsBios::Switch3Pos iffTestM4("IFF_TEST_M4", 28, 29); //RAD Test/Mon TOGGLE ON-OFF-ON DcsBios::Switch3Pos iffRadtest("IFF_RADTEST", 44, 46); //Ident/Mic TOGGLE ON-OFF-ON DcsBios::Switch3Pos iffMicIdent("IFF_MIC_IDENT", 18, 19); void setup() { DcsBios::setup(); // Reversing for LED lights on Reply and Test LED pinMode(39, OUTPUT); pinMode(37, OUTPUT); // CODE ROTARY SWITCH pinMode(code_zero, INPUT_PULLUP); pinMode(code_B, INPUT_PULLUP); pinMode(code_A, INPUT_PULLUP); pinMode(code_hold, INPUT_PULLUP); tm.startTimer(200, setIFF); } int inputCode_dial() { int valueCode_dial; if (digitalRead(code_zero) == LOW) { valueCode_dial = 0; //ZERO } if (digitalRead(code_B) == LOW) { valueCode_dial = 1; //B } if (digitalRead(code_A) == LOW) { valueCode_dial = 2; //A } if (digitalRead(code_hold) == LOW) { valueCode_dial = 3; //HOLD } return valueCode_dial; } void loop() { DcsBios::loop(); tm.runTimers(); } void setIFF(int timer) { if (Code_dial_ingame < inputCode_dial()) { sendDcsBiosMessage("IFF_CODE", "INC"); } if (Code_dial_ingame > inputCode_dial()) { sendDcsBiosMessage("IFF_CODE", "DEC"); } }
  21. Using the latest FP fork "dcs-bios-arduino-library-0.3.7" with a Mega 2560
  22. hmm, my desktop shows correctly. never the less, same error. null #define DCSBIOS_IRQ_SERIAL #include "DcsBios.h" namespace DcsBios { class SwitchMultiPosBCD : PollingInput { private: const char* msg_; const byte* pins_; char numberOfPins_; char lastState_; char readState() { unsigned char i; unsigned char state = 0; for (i=0; i<numberOfPins_; i++) { unsigned char j = numberOfPins_ - i - 1; // state |= (digitalRead(pins_[i]) << j); state |= ((digitalRead(pins_[i]) ^ 1) << j); // to invert logic } return state; } void pollInput() { char state = readState(); if (state != lastState_) { char buf[7]; utoa(state, buf, 10); if (tryToSendDcsBiosMessage(msg_, buf)) lastState_ = state; } } public: SwitchMultiPosBCD(const char* msg, const byte* pins, char numberOfPins) : lastState_(0) { msg_ = msg; pins_ = pins; numberOfPins_ = numberOfPins; unsigned char i; for (i=0; i<numberOfPins; i++) { pinMode(pins[i], INPUT_PULLUP); } lastState_ = readState(); } }; } const byte iffMode1Wheel1Pins[4] = {30,31,32,33}; DcsBios::SwitchMultiPosBCD iffMode1Wheel1("IFF_MODE1_WHEEL1", iffMode1Wheel1Pins, 4); void setup() { DcsBios::setup(); } void loop() { DcsBios::loop(); }
  23. The code you posted is failing with my pins exit status 1 no matching function for call to 'DcsBios::PollingInput::PollingInput()' #define DCSBIOS_IRQ_SERIAL #include "DcsBios.h" namespace DcsBios { class SwitchMultiPosBCD : PollingInput { private: const char* msg_; const byte* pins_; char numberOfPins_; char lastState_; char readState() { unsigned char i; unsigned char state = 0; for (i=0; i<numberOfPins_; i++) { unsigned char j = numberOfPins_ - i - 1; // state |= (digitalRead(pins_[i]) << j); state |= ((digitalRead(pins_[i]) ^ 1) << j); // to invert logic } return state; } void pollInput() { char state = readState(); if (state != lastState_) { char buf[7]; utoa(state, buf, 10); if (tryToSendDcsBiosMessage(msg_, buf)) lastState_ = state; } } public: SwitchMultiPosBCD(const char* msg, const byte* pins, char numberOfPins) : lastState_(0) { msg_ = msg; pins_ = pins; numberOfPins_ = numberOfPins; unsigned char i; for (i=0; i<numberOfPins; i++) { pinMode(pins[i], INPUT_PULLUP); } lastState_ = readState(); } }; } const byte iffMode1Wheel1Pins[4] = {30, 31, 32 33}; DcsBios::SwitchMultiPosBCD iffMode1Wheel1("IFF_MODE1_WHEEL1", iffMode1Wheel1Pins, 4); void setup() { DcsBios::setup(); } void loop() { DcsBios::loop(); }
  24. Sorry, did not add that code. Should any changes be made to that code or add as is? As for recent post, Yes, i understood that part, thanks. Only using 3 or 2 pins.
  25. Getting an error when compiling the code. ***************************************************** IFF_PANEL:85:10: error: 'SwitchMultiPosBCD' in namespace 'DcsBios' does not name a type DcsBios::SwitchMultiPosBCD iffMode3aWheel4("IFF_MODE3A_WHEEL4", iffMode3aWheel4Pins, 3); ******************************************************
×
×
  • Create New...