-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Polling Issue when using latest version of DCS-BIOS v0.3.8 #42
Comments
This error is actually in your sketch as you are extending dcsbios and creating a new control SwitchMultiPosBCD. As such, we were unable to update your sketch when the PollingInput interface changed. I'm thrown by the name "Switch" but also "BCD". DCS-BIOS has supported BcdWheel which I suspect you want to use instead of a hand-spun class. But if you want to fix it in place, I suspect all you need is to change class SwitchMultiPosBCD : PollingInput { to class SwitchMultiPosBCD : PollingInput(POLL_EVERY_TIME) { |
I did try to use the following without the addtional code, but it did not seem to update correctly. Am i doing something wrong? |
This builds, give it a try and let me know if it works.: `#define DCSBIOS_IRQ_SERIAL //Mode-1 Wheel 1 ROTARY ENCODER //Mode-1 Wheel 2 ROTARY ENCODER //Mode-3A Wheel 1 ROTARY ENCODER //Mode-3A Wheel 2 ROTARY ENCODER //Mode-3A Wheel 3 ROTARY ENCODER //Mode-3A Wheel 4 ROTARY ENCODER void setup() { } void loop() { |
Sorry for late reply. I have been sick with flu. (not covid)
I tried this code. Using same ports as my other code, but the wheels seem to be bouncing around, and not it order.
I am using with DCS-BIOS v0.7.45 , dcs-bios-arduino-library-0.3.8
Am I missing something? I’m following instructions in DCS-BIOS-Flightpanels
From: Talbot ***@***.***>
Sent: Wednesday, March 1, 2023 6:11 PM
To: DCSFlightpanels/dcs-bios-arduino-library ***@***.***>
Cc: Bob Marino ***@***.***>; Author ***@***.***>
Subject: Re: [DCSFlightpanels/dcs-bios-arduino-library] Polling Issue when using latest version of DCS-BIOS v0.3.8 (Issue #42)
This builds, give it a try and let me know if it works.:
`#define DCSBIOS_IRQ_SERIAL
#include <DcsBios.h>
//Mode-1 Wheel 1 ROTARY ENCODER
DcsBios::BcdWheel iffMode1Wheel1("IFF_MODE1_WHEEL1", 27, 26, 25);
//Mode-1 Wheel 2 ROTARY ENCODER
DcsBios::BcdWheel iffMode1Wheel2("IFF_MODE1_WHEEL2", 23, 24);
//Mode-3A Wheel 1 ROTARY ENCODER
DcsBios::BcdWheel iffMode3aWheel1("IFF_MODE3A_WHEEL1", 56, 55, 54);
//Mode-3A Wheel 2 ROTARY ENCODER
DcsBios::BcdWheel iffMode3aWheel2("IFF_MODE3A_WHEEL2", 58, 59, 60);
//Mode-3A Wheel 3 ROTARY ENCODER
DcsBios::BcdWheel iffMode3aWheel3("IFF_MODE3A_WHEEL3", 62, 63, 64);
//Mode-3A Wheel 4 ROTARY ENCODER
DcsBios::BcdWheel iffMode3aWheel4("IFF_MODE3A_WHEEL4", 66, 67, 68);
void setup() {
DcsBios::setup();
}
void loop() {
DcsBios::loop();
}`
—
Reply to this email directly, view it on GitHub<#42 (comment)>, or unsubscribe<https://github.com/notifications/unsubscribe-auth/A56F2NOMTNJSE2BJKTTSD4LWZ7JR5ANCNFSM6AAAAAAVMHMQTQ>.
You are receiving this because you authored the thread.Message ID: ***@***.******@***.***>>
MASCON LEGAL NOTICE: This email and its attachment(s) may be subject to restrictions pursuant to the Arms Export Control Act (22 U.S.C. 2778); federal regulations, including, but not limited to, the International Traffic in Arms Regulations (22 C.F.R. 120, et seq.); and/or other federal laws. The export or other transfer of this email and/or attachment(s) outside of the United States or to a non-U.S. person, wherever located, in any form, may require a license or other authorization from the U.S. government and is prohibited without prior written authorization from Mascon, Inc. Violations may be punishable by criminal and/or civil penalties. Mascon, Inc. does not provide legal advice. Please consult your own legal counsel regarding these issues.
Mascon法律声明:本邮件及其附件可能会受武器出口控制法的限制(22 U.S.C. 2778);联邦法规的限制,包括但不限于国际武器运输条例(22 C.F.R. 120 et seq.);和/或其他联邦法律的限制。导出或转发此邮件和/或附件至美国境外或至非美国人,无论在何处及以任何形式,可能需要获得美国政府的许可或其他授权,任何未经Mascon事先书面授权的邮件境外发送行为将可能受到刑事和/或民事的处罚。至于何种邮件发送行为会构成上述受到政府法律控制或对Mascon 公司的侵权行为, Mascon公司不提供法律意见。请向您的法律顾问咨询。
Mascon法律聲明:本郵件及其附件可能會受武器出口控制法的限制(22 U.S.C. 2778);聯邦法規的限制,包括但不限於國際武器運輸條例(22 C.F.R. 120 et seq.); 和/或其他聯邦法律的限制。導 出或轉發此郵件和/或附件至美國境外û
|
How should it be wired? I have 0,1,2 assigned to Arduino ports, along with Ground. Only whee4 seems to be working BUT, it's being reported as Wheel3 that is moving. None of the other wheels seem to be working. |
I recently upgraded to DCS-Bios v0.3.8 from 0.2.11. Now i am receiving a polling error when compliling. Sketch works fine with v2.11
Below is the sketch I'm trying to use. I have attached error message as well
Thanks!
#define DCSBIOS_IRQ_SERIAL
#include <DcsBios.h>
#include <timer.h>
Timer tm;
namespace DcsBios {
class SwitchMultiPosBCD : PollingInput {
private:
const char* msg_;
const byte* pins_;
char numberOfPins_;
char lastState_;
// state |= (digitalRead(pins_[i]) << j);
state |= ((digitalRead(pins_[i]) ^ 1) << j); // to invert logic
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();
}
};
}
//Mode-1 Wheel 1 ROTARY ENCODER
const byte iffMode1Wheel1Pins[3] = {27, 26, 25};
DcsBios::SwitchMultiPosBCD iffMode1Wheel1("IFF_MODE1_WHEEL1", iffMode1Wheel1Pins, 3);
//Mode-1 Wheel 2 ROTARY ENCODER
const byte iffMode1Wheel2Pins[2] = {23, 24};
DcsBios::SwitchMultiPosBCD iffMode1Wheel2("IFF_MODE1_WHEEL2", iffMode1Wheel2Pins, 2);
//Mode-3A Wheel 1 ROTARY ENCODER
const byte iffMode3aWheel1Pins[3] = {56, 55, 54};
DcsBios::SwitchMultiPosBCD iffMode3aWheel1("IFF_MODE3A_WHEEL1", iffMode3aWheel1Pins, 3);
//Mode-3A Wheel 2 ROTARY ENCODER
const byte iffMode3aWheel2Pins[3] = {58, 59, 60};
DcsBios::SwitchMultiPosBCD iffMode3aWheel2("IFF_MODE3A_WHEEL2", iffMode3aWheel2Pins, 3);
//Mode-3A Wheel 3 ROTARY ENCODER
const byte iffMode3aWheel3Pins[3] = {62, 63, 64};
DcsBios::SwitchMultiPosBCD iffMode3aWheel3("IFF_MODE3A_WHEEL3", iffMode3aWheel3Pins, 3);
//Mode-3A Wheel 4 ROTARY ENCODER
const byte iffMode3aWheel4Pins[3] = {66, 67, 68};
DcsBios::SwitchMultiPosBCD iffMode3aWheel4("IFF_MODE3A_WHEEL4", iffMode3aWheel4Pins, 3);
void setup() {
DcsBios::setup();
}
void loop() {
DcsBios::loop();
polling error.txt
}
The text was updated successfully, but these errors were encountered: