Jimbo Posted January 24, 2014 Posted January 24, 2014 (edited) DC, where did you source your ICs from? I have the circuit built and it looks to be a correct copy of your diagram. Yet i'm stuck with both 7 segs stuck in '8' with no numeric rotation. My only assumption is that the IC may be pinned in a different order to your diagram, and whilst I've got the schematic and wired accordingly, the IC might (?) be slightly different - the model is SN74HC595N and I'm unsure if this makes a difference. Really enjoying learning all this stuff (Despite a couple of escape attempts by the magic blue smoke) and once again, thanks for your time putting all this together. Also, Found this link http://arduino.cc/en/tutorial/ShiftOut which gives a good bit of background.. (Just noticed, DC has this link in the original post:doh: ) Edited January 24, 2014 by Jimbo its a slow day at work
Boltz Posted January 24, 2014 Posted January 24, 2014 Most ICs are pinned differently. If you post a link to where you got them then you will probably see that they have a different pin out compared with DC's. To overcome this problem DC would need to release another version of the circuit diagram with actual pin names rather than pin numbers. @ Joe Kurr: I'm working on something very similar at the same time as well! :lol: A-10C Cockpit Build Thread My YouTube Channel
MacFevre Posted January 24, 2014 Posted January 24, 2014 (edited) DC Guides presents "Exporting data to an Arduino 101" All excellent stuff! Since there isn't a single electronic supply source here in rural Vermont, I'm waiting for all my toys before I can play. ;) Jimbo, did you not have to hook it all up with an external power source? What are you using for a rotary? Or is this strictly copying from DCS right now with no control? Thanks for blazing the trail, guys! Edited March 21, 2014 by MacFevre Buttons aren't toys! :smilewink: My new Version 2 Pit: MacFevre A-10C SimPit V2 My first pit thread: A-10C Simulator Pit "The TARDIS." Dzus Fastener tutorial, on the inexpensive side: DIY Dzus Fastener
Devon Custard Posted January 24, 2014 Author Posted January 24, 2014 Jimbo that first sketch i posted should drive the LEDs in a single loop. Thats to prove the circuit works. If youre stuck with the LEDs in a fixed pattern then im guessing the latch enable pin isnt firing on the 4511s. That should be a common pin from the arduino, from memory thats pin 13 on the arduino and pin 5 on the 4511s. That SR you quoted should be fine. Let me double check the circuit (im going to release an updated design for it anyway).
Devon Custard Posted January 24, 2014 Author Posted January 24, 2014 @ Boltz / Joe Kurr. I kinda figured most people were doing something along these lines, i just hadnt seen anyone post details on how to do it which is why i wrote the guide.
Boltz Posted January 24, 2014 Posted January 24, 2014 This is a great guide DC, I've learnt a lot from reading it. Good to see that others are using the Arduino platform as well though as I was beginning to wonder if I was going in the correct direction. A-10C Cockpit Build Thread My YouTube Channel
Devon Custard Posted January 24, 2014 Author Posted January 24, 2014 This is a great guide DC, I've learnt a lot from reading it. Good to see that others are using the Arduino platform as well though as I was beginning to wonder if I was going in the correct direction. Cheers Boltz, always nice to get positive feedback. Which is ironic considering what im about to say..... Word of warning to those implementing my circuit diagram, i realised that although i wired it correctly ( i think ) i drew the diagram from my perspective i.e. the underside of the matrix board. So those pins on the ICs will be back to front. If you followed the schematic of the chip then youd be fine, but if you trusted me to draw it right, im afraid to say im an eeeediot. The pin numbers are correct, the position of the pin isnt. :doh::doh::doh::doh::doh::doh::doh::doh::doh::doh:
Devon Custard Posted January 24, 2014 Author Posted January 24, 2014 Updated circuit. Found fritzings superb breadboard and arduino design app. Used that to generate the circuit. Damn sight easier to use than Visio :) http://fritzing.org/download/ The external power supply is 5V.
Hansolo Posted January 25, 2014 Posted January 25, 2014 Updated circuit. Found fritzings superb breadboard and arduino design app. Used that to generate the circuit. Damn sight easier to use than Visio :) http://fritzing.org/download/ Nice find :thumbup: Thanks DC Cheers Hans 132nd Virtual Wing homepage & 132nd Virtual Wing YouTube channel My DCS-BIOS sketches & Cockpit Album
Devon Custard Posted January 26, 2014 Author Posted January 26, 2014 (edited) Full working prototype. c# code and sketch in first post. Level of frustration getting this to work smoothly was relatively high this weekend. Probably not helped by this steeenking cold i have :) Found there was a hard limit on the number of 7 segments i could drive. As soon as i exceeded 6, the LEDs started to blink and wouldnt update. Im guessing i hit a hard limit on the power. However given the cost of the components driving 6 led displays with a single arduino seems not to much of a cost. DCS 1.2.7 btw. And thats the UHF radio im exporting. Reading the 162-166 argument values. Edited January 26, 2014 by Devon Custard
MacFevre Posted January 26, 2014 Posted January 26, 2014 Ok wait. Are you saying that this can drive the radio displays AND know what the freq is at startup? You won't have to make sure that the they match, and then your able to make changes? Now that is awesome. Don't know how you do it. You have a cold, yet still are able to do this? If I stub my toe on something then afterwards I don't really feel like working on anything, ;) Buttons aren't toys! :smilewink: My new Version 2 Pit: MacFevre A-10C SimPit V2 My first pit thread: A-10C Simulator Pit "The TARDIS." Dzus Fastener tutorial, on the inexpensive side: DIY Dzus Fastener
Devon Custard Posted January 26, 2014 Author Posted January 26, 2014 What im doing is reading the value of the UHF radio switches, found the data in clickabledata.lua elements["PTR-ANARC164-CHANNEL-SELECTOR"] = multiposition_switch_limited(_("Preset Channel Selector"), devices.UHF_RADIO, device_commands.Button_1, 161,20,0.05) elements["PTR-ANARC164-100MHZ-SELECTOR"] = multiposition_switch_limited(_("100 MHz Selector") , devices.UHF_RADIO, device_commands.Button_2, 162, 3, 0.1) elements["PTR-ANARC164-10MHZ-SELECTOR"] = multiposition_switch_limited(_("10 MHz Selector"), devices.UHF_RADIO, device_commands.Button_3, 163, 10, 0.1) elements["PTR-ANARC164-1MHZ-SELECTOR"] = multiposition_switch_limited(_("1 MHz Selector"), devices.UHF_RADIO, device_commands.Button_4, 164, 10, 0.1) elements["PTR-ANARC164-0.1MHZ-SELECTOR"] = multiposition_switch_limited(_("0.1 MHz Selector"), devices.UHF_RADIO, device_commands.Button_5, 165, 10, 0.1) elements["PTR-ANARC164-0.025MHZ-SELECTOR"] = multiposition_switch_limited(_("0.025 MHz Selector"), devices.UHF_RADIO, device_commands.Button_6, 166, 4, 0.1) The problem i noticed is that the export scripts dont pass that data out until theres a change on the switch. Easy way to sync this up is to toggle the switches as part of your startup sequence. Not sure if thats something in the lua export or something in Gadrocs scripts. When i have a clear head ill see if i can extract the data at startup. I understand that someone managed to read the default presets from the mission data. Not sure how dedicated i am tho :)
Devon Custard Posted January 26, 2014 Author Posted January 26, 2014 And as for the cold, doing this keeps my mind off how frickin miserable this cold is making me :) That and cooking dinner for the pit wife. :D
MacFevre Posted January 26, 2014 Posted January 26, 2014 Yeah, I've got one of those too. ;) she doesn't understand it at all. Says it's my midlife crisis toy. She does suppose it's better than going out and buying a sports car. :D Buttons aren't toys! :smilewink: My new Version 2 Pit: MacFevre A-10C SimPit V2 My first pit thread: A-10C Simulator Pit "The TARDIS." Dzus Fastener tutorial, on the inexpensive side: DIY Dzus Fastener
Extranajero Posted January 26, 2014 Posted January 26, 2014 Where does clickabledata.lua hide ? --------------------------------------------------------- PC specs:- Intel 386DX, 2mb memory, onboard graphics, 14" 640x480 monitor Modules owned:- Bachem Natter, Cessna 150, Project Pluto, Sopwith Snipe
Devon Custard Posted January 26, 2014 Author Posted January 26, 2014 Where does clickabledata.lua hide ? On my system its C:\Program Files\Eagle Dynamics\DCS World\Mods\aircrafts\A-10C\Cockpit\Scripts Have a look at mainpanel_init.lua as well
Extranajero Posted January 26, 2014 Posted January 26, 2014 Cheers. It was actually in a completely different place because I'm using BS1 ( which I should have mentioned ) - but you gave me enough of a clue to find it. Top job. I need to understand what the values in these scripts are, how they work and how to get them to light an LED, my current goal is to design a KA-50 countermeasures panel. I'll start a new thread for that though, instead of cluttering yours up. --------------------------------------------------------- PC specs:- Intel 386DX, 2mb memory, onboard graphics, 14" 640x480 monitor Modules owned:- Bachem Natter, Cessna 150, Project Pluto, Sopwith Snipe
Devon Custard Posted January 26, 2014 Author Posted January 26, 2014 Ok wait. Are you saying that this can drive the radio displays AND know what the freq is at startup? You won't have to make sure that the they match, and then your able to make changes? Now that is awesome. Don't know how you do it. You have a cold, yet still are able to do this? If I stub my toe on something then afterwards I don't really feel like working on anything, ;) Reread your question. A better answer is - Yes you dont need to sync up, as you are reading the dial position and rendering the value on a LED display. If you have the UDP listener running before the mission loads (i.e. before you click on FLY), the LEDs WILL sync up. Well the UHF will at least, have just tested that. :smartass: Ok i now feel rather clever....
MacFevre Posted January 26, 2014 Posted January 26, 2014 Great. That makes sense. Thank you. BTW, how did you get the 74HCF4511 in Fritzing? Buttons aren't toys! :smilewink: My new Version 2 Pit: MacFevre A-10C SimPit V2 My first pit thread: A-10C Simulator Pit "The TARDIS." Dzus Fastener tutorial, on the inexpensive side: DIY Dzus Fastener
Devon Custard Posted January 26, 2014 Author Posted January 26, 2014 Edited a 595 chip and changed the tag from memory
JaseGill Posted January 27, 2014 Posted January 27, 2014 This is brilliant DC. No more trying to sync up in active pause is a major boon for most I would say. Personally I'll never get to a full pit but being able to read things like UFC and some of the other LED states is good enough for me :) J. Rig: Home Built, water cooled,i5 2500K @ 4.3Ghz, ASUS P8P67Pro Mobo, 8GB Patriot Viper 2 Sector 5 RAM, MSI Nvidia GTX970 4GB Gaming OC, 120GB OCZ Vertex 2e SSD Boot, 120GB OCZ Vertex 2e SSD Games (BS & WH), Samsung Spinpoint F3 1TB other, Samsung UE37D5000 37" LED TV,EloTouch 1600x1200 secondary, Thrustmaster Warthog No.467, Thrustmaster MFD, Saitek Pro Pedals, Track IR4 with Track Clip Pro. Ex RAF Aircrew, Real Life Pilot, proud Geek and father of one :)
Devon Custard Posted January 28, 2014 Author Posted January 28, 2014 (edited) @ Extranajero Im pretty certain BS1 works the same way, you export values via lua. HELIOS has an interface for DCS Black Shark (not sure if thats 1 or 2) so good chance you just need to follow my tutorial for configuring HELOIS for A10 and just substitute Black Shark instead. After which my tutorial does what you need, you just need to identify what you want to export. Save yourself a headache and dont try and replicate what HELIOS does. Just work out what it doesnt do and use my method (well not mine at all) or something similar to do it. However you do it tho you will be exporting via lua to start with, after that you either write to a file (bad idea), tcp or udp packets, or serial if lua supports it. Id go with UDP. At that point you have the data and can do what you want with it. Rest is up to you. Edited January 28, 2014 by Devon Custard 1
Devon Custard Posted January 28, 2014 Author Posted January 28, 2014 Ok wait. Are you saying that this can drive the radio displays AND know what the freq is at startup? You won't have to make sure that the they match, and then your able to make changes? Now that is awesome. Don't know how you do it. You have a cold, yet still are able to do this? If I stub my toe on something then afterwards I don't really feel like working on anything, ;) Hmmm, ok been looking at the VHF dials and they DONT sync up, im almost certainly repeating what others have found but they dont output values at start that are representative of their actual state. Subsequently any value they throw out during the game is an offset of the actual value. IF the dial starts the game at position 3, it outputs value 0. Change the dial to position 4 and it outputs 1... hence the offset is 3. Ok Thats annoying, except the first dial on the VHF panels is 2-15 and the dial only outputs 0-9 . And if you pass past 15 then the values shift by 3. So 15 might start at 0 but next time its 3 and after that its 6. So this is one of those situations where you need to work on increments only. Wondering if i can do an OCR on the display..... Or i might look into working out what the presets are to do the initial sync. Anyone else out there cracked this?
bnepethomas Posted January 28, 2014 Posted January 28, 2014 Hmmm, ok been looking at the VHF dials and they DONT sync up, im almost certainly repeating what others have found but they dont output values at start that are representative of their actual state. Subsequently any value they throw out during the game is an offset of the actual value. IF the dial starts the game at position 3, it outputs value 0. Change the dial to position 4 and it outputs 1... hence the offset is 3. Ok Thats annoying, except the first dial on the VHF panels is 2-15 and the dial only outputs 0-9 . And if you pass past 15 then the values shift by 3. So 15 might start at 0 but next time its 3 and after that its 6. So this is one of those situations where you need to work on increments only. Wondering if i can do an OCR on the display..... Or i might look into working out what the presets are to do the initial sync. Anyone else out there cracked this? Hope I'm answering the right question - heres what I've got for the A10 /* -- ILS Frequency -- Major Digits -- Look up table ils_major_digit = {"108", "109", "110", "111"} local DigitPointer = math.floor((soic_conv_mp:get_argument_value(251)*1 0)) + 1 table.insert(soic_conv_flightData,"8010=" .. ils_major_digit[DigitPointer]) -- Minor Digits -- Needed to add a 1.1 as the maths sometimes rounded to .999 which causes errors in lookup DigitPointer = (soic_conv_mp:get_argument_value(252) * 10) + 1.1 DigitPointer = tonumber(DigitPointer) -- Lookup Table ils_minor_digit = {"10", "15", "30", "35", "50", "55", "70", "75", "90", "95"} table.insert(soic_conv_flightData,"8011=" .. ils_minor_digit[math.floor(DigitPointer)]) -- TACAN -- 1st Major Digit table.insert(soic_conv_flightData,"8020=" .. math.floor(soic_conv_mp:get_argument_value(263) * 10 + 0.1)) -- 2nd Major Digit table.insert(soic_conv_flightData,"8021=" .. math.floor(soic_conv_mp:get_argument_value(264) * 10 + 0.1)) -- Minor Digits table.insert(soic_conv_flightData,"8022=" .. math.floor(soic_conv_mp:get_argument_value(265) * 10 + 0.1)) -- XY table.insert(soic_conv_flightData,"8023=" .. soic_conv_mp:get_argument_value(266)) -- VHF AM -- Major has values 3 to 15 table.insert(soic_conv_flightData,"143=" .. math.floor(soic_conv_mp:get_argument_value(143) * 20 + 0.1)) -- VHF_radio.AM, 139, 0.5, 0, 15) table.insert(soic_conv_flightData,"144=" .. math.floor(soic_conv_mp:get_argument_value(144) * 10 + 0.1)) -- VHF_radio.AM, 140, 0.9, 0, 9) -- Moves through incremental numbers so will return interesting values table.insert(soic_conv_flightData,"145=" .. math.floor(soic_conv_mp:get_argument_value(145) * 10 + 0.1)) -- VHF_radio.AM, 141, 0.9, 0, 9) -- Moves through incremental numbers so will return interesting values table.insert(soic_conv_flightData,"146=" .. string.format("%0.0f", soic_conv_mp:get_argument_value(146) * 100)) -- VHF_radio.AM, 142, 0.75, 0, 75) --VHF FM table.insert(soic_conv_flightData,"157=" .. math.floor(soic_conv_mp:get_argument_value(157) * 20 + 0.1)) -- VHF_radio.FM, 153, 0.9, 0, 15) table.insert(soic_conv_flightData,"158=" .. math.floor(soic_conv_mp:get_argument_value(15 * 10 + 0.1)) -- VHF_radio.FM, 154, 0.9, 0, 9) table.insert(soic_conv_flightData,"159=" .. math.floor(soic_conv_mp:get_argument_value(159) * 10 + 0.1)) -- VHF_radio.FM, 155, 0.9, 0, 9) table.insert(soic_conv_flightData,"160=" .. string.format("%0.0f", soic_conv_mp:get_argument_value(160) * 100)) -- VHF_radio.FM, 156, 0.75, 0, 75)
Devon Custard Posted January 28, 2014 Author Posted January 28, 2014 Hope I'm answering the right question - heres what I've got for the A10 /* -- ILS Frequency -- Major Digits -- Look up table ils_major_digit = {"108", "109", "110", "111"} local DigitPointer = math.floor((soic_conv_mp:get_argument_value(251)*1 0)) + 1 table.insert(soic_conv_flightData,"8010=" .. ils_major_digit[DigitPointer]) -- Minor Digits -- Needed to add a 1.1 as the maths sometimes rounded to .999 which causes errors in lookup DigitPointer = (soic_conv_mp:get_argument_value(252) * 10) + 1.1 DigitPointer = tonumber(DigitPointer) -- Lookup Table ils_minor_digit = {"10", "15", "30", "35", "50", "55", "70", "75", "90", "95"} table.insert(soic_conv_flightData,"8011=" .. ils_minor_digit[math.floor(DigitPointer)]) -- TACAN -- 1st Major Digit table.insert(soic_conv_flightData,"8020=" .. math.floor(soic_conv_mp:get_argument_value(263) * 10 + 0.1)) -- 2nd Major Digit table.insert(soic_conv_flightData,"8021=" .. math.floor(soic_conv_mp:get_argument_value(264) * 10 + 0.1)) -- Minor Digits table.insert(soic_conv_flightData,"8022=" .. math.floor(soic_conv_mp:get_argument_value(265) * 10 + 0.1)) -- XY table.insert(soic_conv_flightData,"8023=" .. soic_conv_mp:get_argument_value(266)) -- VHF AM -- Major has values 3 to 15 table.insert(soic_conv_flightData,"143=" .. math.floor(soic_conv_mp:get_argument_value(143) * 20 + 0.1)) -- VHF_radio.AM, 139, 0.5, 0, 15) table.insert(soic_conv_flightData,"144=" .. math.floor(soic_conv_mp:get_argument_value(144) * 10 + 0.1)) -- VHF_radio.AM, 140, 0.9, 0, 9) -- Moves through incremental numbers so will return interesting values table.insert(soic_conv_flightData,"145=" .. math.floor(soic_conv_mp:get_argument_value(145) * 10 + 0.1)) -- VHF_radio.AM, 141, 0.9, 0, 9) -- Moves through incremental numbers so will return interesting values table.insert(soic_conv_flightData,"146=" .. string.format("%0.0f", soic_conv_mp:get_argument_value(146) * 100)) -- VHF_radio.AM, 142, 0.75, 0, 75) --VHF FM table.insert(soic_conv_flightData,"157=" .. math.floor(soic_conv_mp:get_argument_value(157) * 20 + 0.1)) -- VHF_radio.FM, 153, 0.9, 0, 15) table.insert(soic_conv_flightData,"158=" .. math.floor(soic_conv_mp:get_argument_value(15 * 10 + 0.1)) -- VHF_radio.FM, 154, 0.9, 0, 9) table.insert(soic_conv_flightData,"159=" .. math.floor(soic_conv_mp:get_argument_value(159) * 10 + 0.1)) -- VHF_radio.FM, 155, 0.9, 0, 9) table.insert(soic_conv_flightData,"160=" .. string.format("%0.0f", soic_conv_mp:get_argument_value(160) * 100)) -- VHF_radio.FM, 156, 0.75, 0, 75) I found your other post and downloaded your export.lua(at least i think it was yours). After scannign through that i noticed i was reading the wrong button value. Played with that and all is well now. So actually youve solved this twice for me. Champion! :megalol:
Recommended Posts