Jump to content

FSFIan

Members
  • Posts

    1301
  • Joined

  • Last visited

  • Days Won

    7

Everything posted by FSFIan

  1. For a CDU screen, I would recommend against the Pro Micro. You'd be forced to use the DCSBIOS_DEFAULT_SERIAL mode, and while that works for a handful of buttons and LEDs, using it with an output that takes a while to update (especially a graphical display) won't end well. Use an Arduino with an ATMega328 controller so you can use DCSBIOS_IRQ_SERIAL mode instead. That mode will interrupt the main program (i.e. display updates which can take several milliseconds to execute) to process new incoming data. I recommend the Arduino Nano to start with so you don't have to mess with a separate USB-to-serial converter.
  2. Make sure you select the Arduino Mega 2560 under "Tools" -> "Processor" before hitting that compile button. The error you are seeing will appear if you try to compile the sketch for another microcontroller that does not have the same features as the Mega 2560. If it doesn't even find the PORTA register, you probably tried to compile for something with an entirely different architecture (ARM instead of AVR).
  3. That part of wtichcraft broke when the mission file format got changed a while back. Sorry, I really should get around to update that website... You can use this instead (does not work for static objects).
  4. The checkpoint in the video is technically a ground unit, not a static object.
  5. Works as expected. Read the "Bugs" section in the README on GitHub. This was something I built in half a Saturday. I woke up with a crazy idea and then put in the 20% effort to get it 80% working (i.e. for the most common case, ground units), have a proof of concept and get the idea out of my head. I don't think it's worth putting in the other 80% of work, as this is not built on top of any official interface so it may break with any update to DCS. Also, ED has stated that they want to add 3D preview to the editor eventually, so any further development effort on this kludge will be wasted in the long run. If someone else wanted to fork the project, it could probably be made to work for static object groups as well with a reasonable amount of implementation and testing. Helipads would be a special case, as you can't dynamically add a FARP to a mission. You might be able to spawn a static object that looks like a FARP instead. Using it for aircraft is right out, as you can't put an aircraft into the air and have it stay there (and if you want helicopters to hover you have to deal with their AI and them eventually running out of fuel). For aircraft on the ground, you'd need special case logic again to detect that and spawn a static object instead.
  6. How do you manage to get a syntax error in line one of that file by appending stuff to the end? What editor did you use? Make sure to save as UTF-8. Check the beginning of the file to make sure you or your editor didn't accidentally insert any garbage there. Make sure it isn't saved as UTF-16 with a byte order mark. I recommend Notepad++. It has an option to show all unprintable characters.
  7. The PSU you linked to doesn't even come with a case. I'd prefer a used PC PSU. If you can't get one for free, you should be able to pick up a used one for the same price. Even a 200 W PSU will provide way more than 3 A on both the 5V and 12V rails, and you get a 3.3 V rail should you need one. The only disadvantage is that PC PSUs have a fan, which may or may not be a problem. You can also use it to power any other 12 V appliance you have. I use a HP microserver as a NAS. It is powered by an external ATX PSU because the one it came with died, so I have a PSU that is running 24/7 anyway and has extra capacity. I ordered some SATA connectors from AliExpress so I can use it to power my 8-port gigabit ethernet switch (12 V @ max. 1A) and my Fritz!Box (12 V @ max. 1.4 A, wifi access point and DECT phone to VoIP gateway). That means I can avoid using two wall warts, which frees up two electrical outlets. I also suspect that adding more load to an existing switching power supply is slightly more energy efficient than running two wall warts that must have been designed for space efficiency first and energy efficiency second.
  8. Please post the exact DCS version you are using and your dcs.log.
  9. That part does not belong in MissionScripting.lua, it belongs in MissionEditor.lua. If that does not fix the issue, please post the exact DCS version and your dcs.log.
  10. Wire, about AWG 24 to AWG 30, preferably solid core instead of stranded, but just about any kind will do. A soldering iron. If you don't want to spend much, $10 to $20 will get you a basic unregulated soldering iron, a small amount of solder, and one of those "solder sucker" pumps for desoldering. It's fine for soldering a few panels, but it's crap compared to a proper temperature-regulated soldering station. I'd recommend getting a soldering station from a quality brand. It will last you several decades. Which brand to get will depend on where you live. In the US, a common choice for hobbyists seems to be the Hakko FX-888 for about $100. Get a brand that has local distributors, so you can easily get a replacement tip 10 or 20 years in the future. Solder. If your soldering iron doesn't come with a small amount already, get a roll of 63/37 (63% tin, 37% lead) leaded solder, 0.8 to 0.4mm in diameter, the thinner the better. Leaded solder is much easier to work with than lead-free stuff. If you want to use lead-free solder, definitely get a temperature-adjustable soldering station. You need a wire cutter to cut and strip wires. There is no need for a separate tool to strip wires, it's more convenient to use the wire cutter anyway because after cutting the wire to length, it's already in your hand so you might as well use it for the next step. A multimeter to check your work. Not strictly necessary, but very useful. For basic low voltage electronics work, I recommend the sub-$20 UT136B. For soldering tutorials and further information aimed at beginners, check out the EEVblog YouTube channel. Start with . You won't need most of the things mentioned in there, but there is lots of good information in there. EDIT: For testing things before you solder everything together, grab a solderless breadboard. Sturdy solid core wire can plug directly into the breadboard. If you use an Arduino Leonardo, get pre-made male to male jumper wires as well, they connect better to the female connectors on the Leonardo board. A Pro Micro can plug directly into your breadboard after you have soldered on the pin headers it comes with.
  11. If you want to make a HID (USB Joystick) device, you want an Arduino board based on the ATMega32u4 controller. There are two options: the Arduino Leonardo, or the Arduino Pro Micro (not Pro Mini!), which has a much smaller form factor, costs a bit less and has less I/O pins. Both are available on eBay for less than $10. They come with examples for emulating a keyboard and mouse, but there are libraries and example projects on the internet that show how to emulate joysticks and gamepads instead. Note: you can also make a HID controller with an Arduino Uno or Mega, but that is more involved because you need to reprogram the USB-to-serial chip on the board, which is just another microcontroller. Changing the code afterwards requires flashing back the original USB-to-serial firmware first or using a dedicated ISP programming adapter. If you want to do that trick, make sure you don't get one of the cheaper clones that substitute a CH340 or similar chip for the ATMega16U2 to do the USB-to-serial conversion (make sure the article description explicitly mentions it comes with an ATMega16U2).
  12. Released v0.2.5 of the Arduino Library. make SwitchMultiPos default to the last selected position instead of position 0 when none of the pins are pulled to ground. This avoids temporarily switching back to position 0 when you have a break-before-make rotary switch or if some of the positions on your physical rotary switch are unused. Please post comments in the DCS-BIOS Discussion Thread.
  13. DCS is using Lua 5.1 (the current version is 5.3), so refer to the 5.1-specific manual here: https://www.lua.org/manual/5.1/
  14. Take a look at Unit.getFuel(). I don't think that cockpit arguments are the way to go here. I don't know if those triggers even work for aircraft without a clickable cockpit, and it would also only work in single player (or possibly for the host in MP).
  15. No. The UnoJoy project works by reprogramming the USB-to-serial converter chip (which on the original Uno is just another microcontroller, an ATMega16U2) to interpret the data from the serial port and present it as a game controller to the computer, instead of presenting it to the computer as a virtual COM port device. Thus you gain USB gamepad functionality but lose the serial port.
  16. Jeder Schubhebel, der für eine Maschine mit Copilotensitz ausgelegt ist, sollte doch neutral designt sein. Natürlich sind das keine HOTAS-Systeme, da gibt's höchstens vielleicht noch einen TO/GA-Button und einen Hebel für die Schubumkehr. Ein Beispiel für ein einfaches Modell wäre der Saitek Pro Flight Throttle Quadrant.
  17. Why would you need optoisolation? I am pretty sure that there are MOSFETs available that are beefy enough to switch a few amps at 24V or so (with a 5V control signal), especially if you screw them to a heatsink. As long as you only use a MOSFET as a switch, it will never create much heat, as it is either a fully closed switch (so ideally, it will have a resistance of 0 ohm and have zero power dissipation, in practice the will be some of course) or it will be fully open (infinite resistance, no current = no heat).
  18. Tekkx: That's just the switch bouncing. As a workaround, you can add a small delay to your loop() function until the DCS-BIOS Arduino library eventually gets some sort of debouncing support. See post 365 for more information. There is nothing wrong with your RS-485 setup. The same thing happens when communicating directly over a serial port. If a switch bounces and several messages are sent in quick succession, socat simply takes all of them and stuffs them into a single UDP packet. The Lua part of DCS-BIOS is aware of that, and will execute all of the commands. A pulldown on the TXEnable pin would keep the MAX487 from possibly trying to drive the bus in the time between powering up the Arduino and the time that the initialization code has finished to run. It's not a bad idea, but it's also not required: the MAX487 chips are short-circuit current limited, so they won't break when several drivers are trying to drive the bus at the same time. And after a short time the initialization code has run anyway and the TXEnable pin will be in a defined state from then on because it's been configured as an output pin. If there is some condition where the MAX487 will be powered up but the Arduino board will not (or will be disconnected), you should definitely include the pulldown resistor, because as long as multiple drivers are trying to drive the bus, any data that is being sent will be screwed up.
  19. That line will print the null terminator (the null byte after the string that marks the end of the string).You should remove it. (In your example, it does not make a difference, because it ends up outside of the display.) Strings in C (which are just an array of characters) are indexed from counting from 0, so newValue[0] is the first character and newValue[18] is the 19th character.
  20. Hab mich jetzt auch eingetragen (kann auch besser am Montag als am Dienstag).
  21. I can't open that picture, can you post another link? Also post your complete sketch. It shouldn't start in the 1 position. That said, your sketch ultimately decides where each part of that 19-character string ends up, so you can rearrange it however you want no matter how DCS-BIOS presents it by default.
  22. The CMSP lines are 19-character strings, because they include spaces between the fields. They can be displayed on a 20x2 LCD as-is. To display them on a 16x2 LCD, you have to put only some of the characters on the LCD.
  23. You could grab a DB-9 extension cable for $5 shipped (it'll take a few weeks to get to you, though). Cut it open in the middle and rewire as necessary. You can use heat-shrink tube to make it neat or use electrical tape and optionally hide the resulting mess in whatever small box is available.
  24. cBass: Try the following. Flash the Master Caution example sketch to your Arduino board and connect a push button between pin 10 and ground. Run connect-serial-port.cmd without having DCS open (so the output doesn't scroll away immediately) press the push button post a screenshot of the command line window
  25. The titino board is meant for a full duplex bus, DCS-BIOS uses half duplex.
×
×
  • Create New...