

No1sonuk
Members-
Posts
1595 -
Joined
-
Last visited
Content Type
Profiles
Forums
Events
Everything posted by No1sonuk
-
I don't know how bcdwheel is supposed to work, but generally speaking you don't need the pin mode lines as DCS-BIOS does that for you. Try removing those pinmode lines in case they're interfering.
-
After some to and fro on Discord, here's an example of using the aircraft name to detect if you're in a mission or not: #define DCSBIOS_IRQ_SERIAL #include "DcsBios.h" int inMission = 0; // Variable to carry the current status int lastInMission = 0; // Variable to use for checking if the status has changed void onAcftNameChange(char* newValue) { inMission = strcmp(newValue, "")!=0; } DcsBios::StringBuffer<24> AcftNameBuffer(0x0000, onAcftNameChange); void setup() { DcsBios::setup(); pinMode(13, OUTPUT); // sets the digital pin 13 (built in LED) as output } void loop() { DcsBios::loop(); checkStatus(); // Call the status checking function } void checkStatus() { if (inMission != lastInMission){ // Check if the state has changed from last time digitalWrite(13,inMission); // Set the built in LED to the value of inMission // You'll need to add your own code here to tell the device what to do if the inMission variable is 1 or 0 lastInMission = inMission; // Set the last state variable so it can be checked later } }
-
IIRC, there's time information in the metadata section. I don't know what changes and when, but you could have a look there and compare values to look for a change.
-
Yes and no. Each will need it's own COM port, but there's a multi-port connect cmd where you add the numbers as a list.
-
Sorry - only just seen this. Not every switch. You need to know the address of the switch (the ?x???? part), IF it has one.
-
Yes. You can use several USB ports, or even an RS485 network hanging off an Arduino Mega.
-
OK, but the warning still stands. The joystick button functions still use the USB connection. I don't know if 0 and 1 are used for that on the 32u4 devices...
- 75 replies
-
The "JoystickButton" example sketch has code to read four buttons starting with pin 9. BTW: One thing to bear in mind, though, is that you basically can't use pins 0 and 1 for IO when you use the ATMega328P Arduinos for DCS-BIOS because those pins are used by the processor for the USB comms. I don't know if the 32u4 Arduinos, like the Pro Micro are the same.
- 75 replies
-
IIRC, there's an example sketch installed with the joystick library that can do that.
- 75 replies
-
OK. Well I followed the instructions in the video and the MIDI page he linked to: https://liveelectronics.musinou.net/MIDIdeviceName.php The difference is that it says on the web page: "/Users/username/Documents/Arduino/hardware/musinou/avr/built.txt", but it should be: "/Users/username/Documents/Arduino/hardware/musinou/avr/boards.txt" (the correct file is in the download) And I'll repeat: Before posting earlier, I updated my IDE and did it to a Leonardo in 2.1 following those instructions... Important things to note: You create the file structure in your documents/Arduino folder. You MUST change the VID and PID number combination to something unique or windows will ignore the change - It remembers those IDs and the name associated with them. You MUST restart the IDE for the changes to work - I shut down the IDE, change the file, then start the IDE again.
-
I just did it with a new update to 2.1 by editing an add-on boards.txt file to rename a Leonardo. Following this guide:
-
Yeah. The Flightpanels fork is actively maintained. The "Hub" version (v0.10 etc.) isn't. That's likely the cause of your problems.
-
I get no errors when compiling this. Which version of DCS-BIOS are you using?
-
What version of DCS-BIOS are you using?
-
I can't read that code on my phone. The code is far too spaced out. Rich text is there for a reason. It includes formatting that makes posts easier to read You should put code in a code window - the <> thing from the format menu It'll have to wait until I get home from work and can read it on a larger screen.
-
You need to make a programmer using an Uno to change a device bootloader. But IIRC, you can tell the IDE to use the other bootloader protocol in the options.
-
Using more than one Arduino pin as LED output
No1sonuk replied to lesthegrngo's topic in Home Cockpits
Because this is simpler: DcsBios::LED masterCautionA(0x1012, 0x0800, 2); DcsBios::LED masterCautionB(0x1012, 0x0800, 3); than this: // In setup routine: pinMode(2, OUTPUT); pinMode(3, OUTPUT); void onMasterCautionChange(unsigned int newValue) { digitalWrite(2,newValue); digitalWrite(3,newValue); } DcsBios::IntegerBuffer masterCautionBuffer(0x1012, 0x0800, 11, onMasterCautionChange); -
Using more than one Arduino pin as LED output
No1sonuk replied to lesthegrngo's topic in Home Cockpits
I'd have thought you could just assign two LED code lines to different pins and alter the name slightly. -
Did you forget this?
-
Alternative to DIview that reports more than 32 buttons
No1sonuk replied to lesthegrngo's topic in Home Cockpits
OK. I think Helios might be able to do it in the profile editor. -
No. You can use those as long as you don't need them for serial I/O - e.g. an RS485 master would need one of those pairs to run the RS485 bus while using 0 and 1 for USB. So if you're using just USB, or it's an RS485 slave device, you only need to steer clear of 0 and 1.
-
The Mega has a different processor (ATmega 2560) that has a few built-in serial ports. The Uno processor - ATmega 328P - only has one. That connects to another device that handles the USB connection protocol. Take a look here: https://www.arduino.cc/en/uploads/Main/Arduino_Uno_Rev3-schematic.pdf In the bottom-right is the ATmega328P processor. In the bottom-right of that, you'll see RXD and TXD connections running to IO0 and IO1 (pins 0 and 1). They also go to the next block on the left, which is the USB controller - in this case it's an ATmega16u2 , but in some versions, it's a CH340 with different wiring. Those connections mean that if you want to use the USB connection, you can't connect anything to those two pins. If you don't need the USB functionality after programming, you CAN use them as ordinary digital pins. At a guess, I'd say it wouldn't work if you tried to program the Arduino with either of those switches connected and on (grounding the pin). The Mega uses a similar arrangement: https://www.arduino.cc/en/uploads/Main/arduino-mega2560-schematic.pdf Again, RX0 and TX0 are used for the USB connection.
-
Alternative to DIview that reports more than 32 buttons
No1sonuk replied to lesthegrngo's topic in Home Cockpits
Try this: http://www.planetpointy.co.uk/joystick-test-application/ -
I usually don't see data until a mission runs. You can use them as long as you're NOT using the serial data. For DCS-BIOS, you ARE using them for serial data.