patogn20 Posted January 18, 2020 Posted January 18, 2020 Hi all!! I'm THIS close to finish my Huey cockpit. It runs completely on DCS Bios. The only thing that is missing are the comms displays. The idea is to give the cockpit a more modern look by using green 7 segments displays. I bought this from hispapanels https://hispapanels.com/tienda/es/leds-displays-lcd/61-soporte-5-displays.html and i'm trying to run it with a 7219, with not so much success. Tried connecting everything acording to the 7219 datasheet and load some scketchs ment to work with this setup, but it's not working at all... Any idea how can i use it? Any better ideas on how to run the displays? Thanks!
lesthegrngo Posted January 18, 2020 Posted January 18, 2020 Just been through this with my A10 cockpit. I used an 8 digit seven segment LED display running off a Max7219 board, and this is the sketch that I used for the UHF radio repeated on the dash. It's essentially a rewrite of Craig's sketch for just one module, try swapping in the DSC Bios part you need for the particular unit /* Tell DCS-BIOS to use a serial connection and use interrupt-driven communication. The main program will be interrupted to prioritize processing incoming data. This should work on any Arduino that has an ATMega328 controller (Uno, Pro Mini, many others). */ #define DCSBIOS_IRQ_SERIAL #include <LedControl.h> #include <DcsBios.h> // 8 DIGIT 7 SEGMENT DISPLAY - UHF RADIO //pin 3 is connected to the DataIn //pin 5 is connected to the CLK //pin 4 is connected to LOAD / CS LedControl lc=LedControl(3,5,4,1); //This creates an instance of a single controller named "lc" // GENERAL REF NOTE BELOW /* The sequence of pins used above are in the following order... LedControl(DIN,CLK,LOAD,# OF IC's) pin X is connected to the DataIn pin X is connected to the CLK pin X is connected to LOAD the last number...(1) is for how many MAX7219 we have daisy chained. (8 STATED, HOWEVER 4 ACTUALLY PRESENT) */ void onUhfFrequencyChange(char* newValue) { lc.setChar(0,7,newValue[0],false); lc.setChar(0,6,newValue[1],false); lc.setChar(0,5,newValue[2],false); lc.setChar(0,4,newValue[3],false); lc.setChar(0,3,newValue[4],false); lc.setChar(0,2,newValue[5],false); lc.setChar(0,1,newValue[6],false); } DcsBios::StringBuffer<7> uhfFrequencyBuffer(0x1180, onUhfFrequencyChange); void setup() { DcsBios::setup(); // MAX7219 INITIALISATION //This initializes the MAX7219 and gets it ready for use: //FIRST - 8 DIGIT 7 SEGMENT DISPLAY - VHF-AM RADIO (CODE) MAX7219 INITIALISATION lc.shutdown(0,false); //turn on the display lc.setIntensity(0,8);//set the brightness lc.clearDisplay(0); //clear the display //FIRST - 8 DIGIT 7 SEGMENT DISPLAY - VHF-AM RADIO (CODE) MAX7219 BOOT CODE WHILST AWAITING SOCAT DATA STREAM // lc.setChar(0,7,'A',false); lc.setChar(0,6,'1',false); lc.setChar(0,4,'0',false); lc.setChar(0,3,'c',false); } void loop() { DcsBios::loop(); } Hope this helps, I know other have helped me so want to pass on their help Cheers Les
patogn20 Posted January 18, 2020 Author Posted January 18, 2020 Just been through this with my A10 cockpit. I used an 8 digit seven segment LED display running off a Max7219 board, and this is the sketch that I used for the UHF radio repeated on the dash. It's essentially a rewrite of Craig's sketch for just one module, try swapping in the DSC Bios part you need for the particular unit /* Tell DCS-BIOS to use a serial connection and use interrupt-driven communication. The main program will be interrupted to prioritize processing incoming data. This should work on any Arduino that has an ATMega328 controller (Uno, Pro Mini, many others). */ #define DCSBIOS_IRQ_SERIAL #include <LedControl.h> #include <DcsBios.h> // 8 DIGIT 7 SEGMENT DISPLAY - UHF RADIO //pin 3 is connected to the DataIn //pin 5 is connected to the CLK //pin 4 is connected to LOAD / CS LedControl lc=LedControl(3,5,4,1); //This creates an instance of a single controller named "lc" // GENERAL REF NOTE BELOW /* The sequence of pins used above are in the following order... LedControl(DIN,CLK,LOAD,# OF IC's) pin X is connected to the DataIn pin X is connected to the CLK pin X is connected to LOAD the last number...(1) is for how many MAX7219 we have daisy chained. (8 STATED, HOWEVER 4 ACTUALLY PRESENT) */ void onUhfFrequencyChange(char* newValue) { lc.setChar(0,7,newValue[0],false); lc.setChar(0,6,newValue[1],false); lc.setChar(0,5,newValue[2],false); lc.setChar(0,4,newValue[3],false); lc.setChar(0,3,newValue[4],false); lc.setChar(0,2,newValue[5],false); lc.setChar(0,1,newValue[6],false); } DcsBios::StringBuffer<7> uhfFrequencyBuffer(0x1180, onUhfFrequencyChange); void setup() { DcsBios::setup(); // MAX7219 INITIALISATION //This initializes the MAX7219 and gets it ready for use: //FIRST - 8 DIGIT 7 SEGMENT DISPLAY - VHF-AM RADIO (CODE) MAX7219 INITIALISATION lc.shutdown(0,false); //turn on the display lc.setIntensity(0,8);//set the brightness lc.clearDisplay(0); //clear the display //FIRST - 8 DIGIT 7 SEGMENT DISPLAY - VHF-AM RADIO (CODE) MAX7219 BOOT CODE WHILST AWAITING SOCAT DATA STREAM // lc.setChar(0,7,'A',false); lc.setChar(0,6,'1',false); lc.setChar(0,4,'0',false); lc.setChar(0,3,'c',false); } void loop() { DcsBios::loop(); } Hope this helps, I know other have helped me so want to pass on their help Cheers Les Awesome! Thanks for the help. Question: are you using a display module like this one? https://www.ebay.com/itm/MAX7219-8-Bit-7-Segment-Digital-Tube-Blue-Display-Control-Module-for-Arduino/192851608735?hash=item2ce6da049f:g:0BgAAOSwa2tcg20a Or did you make one from scratch? Thanks!
lesthegrngo Posted January 18, 2020 Posted January 18, 2020 (edited) I used one of those type. Make sure you don't get the polarity (VCC / GND) the wrong way round, I bricked one by doing that by accident. After that every segment was on and stayed on Cheers Les Edited January 18, 2020 by lesthegrngo
BULLITT83 Posted January 21, 2020 Posted January 21, 2020 @lesthegrngo I'm trying also to send COM FQ at a MAX7219, i've a question : do you use your arduino for the 5 volts to "feed" the MAX7219 I've problems, testing my sketch with only th eMAX7219 works perfectly, when i have it working with others items ( flaps indicator, gear position leds...) my MAX7219 doesn't works correctly , looks like it has not enough current. Regards guillaume
lesthegrngo Posted January 21, 2020 Posted January 21, 2020 Yes, the 5v feed from my arduino Nano is the power source for the LED's. On my A10C central warning panel which runs off a Max 7219 driven by a nano, I have 144 green 0805 SMD LED's and the setup is capable of lighting them all. I think it multiplexes the LED's so they are not all lit at the same time, but flash so rapidly it looks like it On my undercarriage indicator lights I drive three 'pirahna' type LED's direct from the nano (obviously no Max7219 for that) so the arduinos are capable. However you could always try and use a MOSFET module (look up Arduino Mosfet module on fleabay) as that allows you to power the LED's and other devices with a separate power supply with the Arduino using the Mossfet as a switch Hope this helps! Les As far as I am aware
Vinc_Vega Posted January 21, 2020 Posted January 21, 2020 You are fully right Les. The MAX7219 uses multiplexing. Btw. MOSFETs are also capable to switch so fast that they can be used with PWM pins to dim LEDs. I did this for my 12V panel backlighting. Regards, Vinc real life: Royal Bavarian Airforce online: VJS-GermanKnights.de [sIGPIC][/sIGPIC]
BULLITT83 Posted January 22, 2020 Posted January 22, 2020 Thanks a lot for your answer LES , it helps me a lot now i'm sure my probleme comes from elsewhere i'll search a little more ! thanks a lot ! Guillaume
Recommended Posts