|
Post by polarair on Nov 2, 2020 23:17:10 GMT 2
HI,
I really need some extra information for the coding in Airmanager or LUA.
- The 7 segment elements are they stand alone or daisy chained, if so what is daisy chained? Please explain the routing for the segments. (example :COM1 and COM Switch connected)
- Transponder 5 segment switch, i cant find all the positions on the arduinos
- Arduino layout's are coded in a way that i cant understand. (im using the 40 pin pinout list at the moment but this is not ideal) there must be a list of position, switches, buttons and more
- The PODs do what (NAV POD and others)
- Is there a list of positions of the arduinos or is the 40pinout picture the only one to work from
- How much power can we run via the 12 volt line for backlighting.
- The POS vor NAV and COM can we use these for dimming.
- 8MHZ seperation, or 25MHZ seperation switch or change ways?
Sorry for the questions but the images of the Arduino Mega's on the site are not understandable for normal humans. Im getting fustrated as i need to make this work on AM and it should be possible. More complex than mobiflight but a lot more accessable if you want to use multiple PC's and keep it clean.
Mike
|
|
|
Post by AlbEagle on Nov 3, 2020 14:25:43 GMT 2
HI, I really need some extra information for the coding in Airmanager or LUA. - The 7 segment elements are they stand alone or daisy chained, if so what is daisy chained? Please explain the routing for the segments. (example :COM1 and COM Switch connected)
- Transponder 5 segment switch, i cant find all the positions on the arduinos
- Arduino layout's are coded in a way that i cant understand. (im using the 40 pin pinout list at the moment but this is not ideal) there must be a list of position, switches, buttons and more
- The PODs do what (NAV POD and others)
- Is there a list of positions of the arduinos or is the 40pinout picture the only one to work from
- How much power can we run via the 12 volt line for backlighting.
- The POS vor NAV and COM can we use these for dimming.
- 8MHZ seperation, or 25MHZ seperation switch or change ways?
Sorry for the questions but the images of the Arduino Mega's on the site are not understandable for normal humans. Im getting fustrated as i need to make this work on AM and it should be possible. More complex than mobiflight but a lot more accessable if you want to use multiple PC's and keep it clean. Mike
Hi Mike, I am answering few questions because i am at work and can't check the others right now. 1. The 7 segments are daisy chained as in the picture below: 1. Com1 & Com2 Active and Standby, Nav1 & Nav2 Active and Standby, DME Freq & Transponder are connected to one output. 2. CRS, SPD, HDG, ALT, VS, DME NM, DME KTS, NM Letters and KT Letters are connected to the second output. Every max chip has 8 digits connected to it, in the order as in the picture below In total there are 8 chips connected to one output which means 8 chips x 8 digits in total 64 digits connected to one arduino output. 2. Need to check when i get home 3. It was done this way because it was meant to be connected through 40 pin connecters so users don't bother about input outputs from the radio to arduinos. I know what you mean, i will try to do something, as you know time is a factor here. 4. I guess you mean POT's like NAV POT etc. i was planning to be able to increase or decrease the contrast (lightning) of 7 segment displays. Since this was not possible with mobiflight, I added as an extra feature that someone might use it with some other software in the future like AM in your case. 5. As described in 3, i will try to pull them out, i hope i can do it soon. 6. You need to use an external power for the radio anyway. I would recommend a PC power supply which would be enough for the backlighting as well. 7. Im not sure if this is the Answer 4. 8. What do you mean? Let me know for more explanation if needed.
|
|
|
Post by polarair on Nov 3, 2020 14:49:55 GMT 2
This is for the board right? As the count i have is 1st row 20 characters, 2nd row 20 characters 3rd 8 characters, 4th row 4 2letters and 4 2 letters, 5th row 8 characters and bottom row 20 characters. If i look at your diagramin the post this does not match the pcb board. I see : - 24
- 24
- 4 +2 letters 4+2 letters
- 8
- 8
- 24
A bit confused, take your time. As for the code there is a lot of formating that needs to be done. Commands like
-- print(string.format("%07.03f", 123.456)) -- 7 characters, 3 after the decimal. So when i have split the displays or address them.
"interesting code from Airmanager forum"
--AirManager 3.7.10 - COM1 active and standby display onto 2 cascaded MAX7219 displays. -- Written because I could not find any coding that allowed FSX to display to MAX7219 -- I was told no-one is developing for FSX/3.7 so had to build it myself - it probably --exists somewhere - but nothing that I could find anything shared anyway so probably re-invented the wheel. --FWIW: Other platforms a(such as mobiflight) seem to do this within the interface - AM needs doing in code
--this is a work in progress and will need to be further enhanced to add NAV functions too. --NOTE: no "calling" added to this yet.. this work is only to get the displays to replicate the COM1 in FSX. --still to add: NAV display; "swap button"; call functions on change (if needed); encoder functions. --1.0 get the display to connect to MAX7219 -- heavily borrowed from api/documentation and forum input --1.1 changes to the formatting.. added brightness settings to reduce powerload on MAX/Arduino (no external 5v VCC in prototype) --2.0 added Standby and truncate the last 2 digits so it will fit in 8x7seg display --3.1 added standby to the 2nd display --3.2 formatting changes - calculate the dropping of first digits (ugly but seems to be only kludgy way) --3.3 padding to get everything to line up --3.4 cleaned documentation for clarity and publish to forum --4.0 added NAV variables and set the displa1 to have the %0.f to show first 3 digits at the end. --4.1 added nav standby and active. problem: cannot get a . to add to the active - only accesspts 0.xx now sure how to fix
-- Call "MAX7219" and set to 3 modules with the following data lines DIN, CLK, LOAD display_chr_id = hw_chr_display_add("MAX7219", 3, "ARDUINO_MEGA2560_A_D46", "ARDUINO_MEGA2560_A_D48", "ARDUINO_MEGA2560_A_D47")
--set the display brightness in increments of 0.X ie 0=off and 1=on and 0.5=half hw_chr_display_set_brightness(display_chr_id, 0,0,0.1) hw_chr_display_set_brightness(display_chr_id, 1,0,0.1) hw_chr_display_set_brightness(display_chr_id, 2,0,0.1)
function com1_frequency(com1active,com1standby,nav1active, nav1standby) --setup for the first MAX7219 display "0" com1standbyvar=var_format(com1standby/10,0) --trunctae the last digits off the standby display display1show=string.format("%05.02f %d", com1active, com1standbyvar) --combine the both active and standby hw_chr_display_set_text(display_chr_id, 0, 0, display1show ) --show it on display0
--setup for the second MAX7219 display "1" --because the second display is partial of the first, we need to strip off the first digits of standby --as they are already displayed. this second display is essentially a contiunuation of the first --initially, take standby and moving the decimal place to get to first two digits (123.45 -> 12.345), --truncate from the decimal (12.345 becomes 12) --times it by 10 (12 becomes 120) --take this from the orginal (123.45 - 120 = 3.45) --display that onto the second MAX7219 (display0 and display1 are glued together, so will look like a continuation) --** note: the number is padded with spaces for testing... when this gets added to the NAV.. that padding will change --there might be a prettier way to do this (under linux I would used CUT and CAT... but no API in this script. --com1standby value newstandby=tostring(com1standby) --scriptcalulator dooesnt like the fsx presents its code standbyconcatenated= tostring(newstandby-(string.format("%02.f", newstandby/10)*10))--remove the decimal display2show=string.format("%03.02f %0.f", standbyconcatenated, nav1active) ---clean the total and add padding to move to start of max
hw_chr_display_set_text(display_chr_id, 1, 0, display2show ) --show it on display1 --setup display2 --this will only have the last digits of the nav1active and the remainder is nav1standby newactive=var_format(nav1active,0) activeconcatenated= string.format("%02.0f", (nav1active-newactive)*100) display2show=string.format("%0.f %0.2f", activeconcatenated, nav1standby) ---clean the total and add padding to move to start of max
hw_chr_display_set_text(display_chr_id, 2, 0, display2show ) --show it on display1
end
--pull out both the active and standby frequencies from FSX and call the com1_frequency routine fsx_variable_subscribe("COM ACTIVE FREQUENCY:1", "Mhz", "COM STANDBY FREQUENCY:1", "Mhz", "NAV ACTIVE FREQUENCY:1", "Mhz", "NAV STANDBY FREQUENCY:1", "Mhz", com1_frequency) -- print(string.format("%07.03f", 123.456)) String formating for the radiostack
|
|
|
Post by AlbEagle on Nov 3, 2020 14:54:54 GMT 2
This is for the board right? As the count i have is 1st row 20 characters, 2nd row 20 characters 3rd 8 characters, 4th row 4 2letters and 4 2 letters, 5th row 8 characters and bottom row 20 characters. If i look at your diagramin the post this does not match the pcb board. I see : - 24
- 24
- 4 +2 letters 4+2 letters
- 8
- 8
- 24
A bit confused, take your time. As for the code there is a lot of formating that needs to be done. Commands like
-- print(string.format("%07.03f", 123.456)) -- 7 characters, 3 after the decimal. So when i have split the displays or address them.
"interesting code from Airmanager forum"
--AirManager 3.7.10 - COM1 active and standby display onto 2 cascaded MAX7219 displays. -- Written because I could not find any coding that allowed FSX to display to MAX7219 -- I was told no-one is developing for FSX/3.7 so had to build it myself - it probably --exists somewhere - but nothing that I could find anything shared anyway so probably re-invented the wheel. --FWIW: Other platforms a(such as mobiflight) seem to do this within the interface - AM needs doing in code
--this is a work in progress and will need to be further enhanced to add NAV functions too. --NOTE: no "calling" added to this yet.. this work is only to get the displays to replicate the COM1 in FSX. --still to add: NAV display; "swap button"; call functions on change (if needed); encoder functions. --1.0 get the display to connect to MAX7219 -- heavily borrowed from api/documentation and forum input --1.1 changes to the formatting.. added brightness settings to reduce powerload on MAX/Arduino (no external 5v VCC in prototype) --2.0 added Standby and truncate the last 2 digits so it will fit in 8x7seg display --3.1 added standby to the 2nd display --3.2 formatting changes - calculate the dropping of first digits (ugly but seems to be only kludgy way) --3.3 padding to get everything to line up --3.4 cleaned documentation for clarity and publish to forum --4.0 added NAV variables and set the displa1 to have the %0.f to show first 3 digits at the end. --4.1 added nav standby and active. problem: cannot get a . to add to the active - only accesspts 0.xx now sure how to fix
-- Call "MAX7219" and set to 3 modules with the following data lines DIN, CLK, LOAD display_chr_id = hw_chr_display_add("MAX7219", 3, "ARDUINO_MEGA2560_A_D46", "ARDUINO_MEGA2560_A_D48", "ARDUINO_MEGA2560_A_D47")
--set the display brightness in increments of 0.X ie 0=off and 1=on and 0.5=half hw_chr_display_set_brightness(display_chr_id, 0,0,0.1) hw_chr_display_set_brightness(display_chr_id, 1,0,0.1) hw_chr_display_set_brightness(display_chr_id, 2,0,0.1)
function com1_frequency(com1active,com1standby,nav1active, nav1standby) --setup for the first MAX7219 display "0" com1standbyvar=var_format(com1standby/10,0) --trunctae the last digits off the standby display display1show=string.format("%05.02f %d", com1active, com1standbyvar) --combine the both active and standby hw_chr_display_set_text(display_chr_id, 0, 0, display1show ) --show it on display0
--setup for the second MAX7219 display "1" --because the second display is partial of the first, we need to strip off the first digits of standby --as they are already displayed. this second display is essentially a contiunuation of the first --initially, take standby and moving the decimal place to get to first two digits (123.45 -> 12.345), --truncate from the decimal (12.345 becomes 12) --times it by 10 (12 becomes 120) --take this from the orginal (123.45 - 120 = 3.45) --display that onto the second MAX7219 (display0 and display1 are glued together, so will look like a continuation) --** note: the number is padded with spaces for testing... when this gets added to the NAV.. that padding will change --there might be a prettier way to do this (under linux I would used CUT and CAT... but no API in this script. --com1standby value newstandby=tostring(com1standby) --scriptcalulator dooesnt like the fsx presents its code standbyconcatenated= tostring(newstandby-(string.format("%02.f", newstandby/10)*10))--remove the decimal display2show=string.format("%03.02f %0.f", standbyconcatenated, nav1active) ---clean the total and add padding to move to start of max
hw_chr_display_set_text(display_chr_id, 1, 0, display2show ) --show it on display1 --setup display2 --this will only have the last digits of the nav1active and the remainder is nav1standby newactive=var_format(nav1active,0) activeconcatenated= string.format("%02.0f", (nav1active-newactive)*100) display2show=string.format("%0.f %0.2f", activeconcatenated, nav1standby) ---clean the total and add padding to move to start of max
hw_chr_display_set_text(display_chr_id, 2, 0, display2show ) --show it on display1
end
--pull out both the active and standby frequencies from FSX and call the com1_frequency routine fsx_variable_subscribe("COM ACTIVE FREQUENCY:1", "Mhz", "COM STANDBY FREQUENCY:1", "Mhz", "NAV ACTIVE FREQUENCY:1", "Mhz", "NAV STANDBY FREQUENCY:1", "Mhz", com1_frequency) -- print(string.format("%07.03f", 123.456)) String formating for the radiostack
I need to check, maybe i have changed the order or something in the PCB version and I don't remember. Good work on doing this with airmanager, i was also interested to see if there is any lag, because after some time flying, while using mobiflight, i was getting lag while changing frequencies for example. I also found the Transponder switches:
|
|
|
Post by AlbEagle on Nov 3, 2020 15:14:31 GMT 2
Can you take a look if this helps a little:
|
|
bosal
New Member
Posts: 42
|
Post by bosal on Nov 4, 2020 12:00:46 GMT 2
Hi polarair, Following the schematics there are 3 daisychains for the MAXdisplay on the Encoder Arduino. First thing I'll do is printing some own text to the displays and see what happens. Just to get familiar with the adresses of the displays otherwise you have no overview and no clue what is happening.
For example print "12345" to display 1 on daisychain 1, if that works then add display 2 to the code and also print "12345", ... . Keep going until it doesn't work on the next display and then switch over to daisychain 2 and do the same. When you got the structure of all the displays then start adding the variables from the flightsim into the code.
I'm also planning to connect the radiostack to Airmanager and probably all other hardware to Mobiflight.
|
|
|
Post by polarair on Nov 4, 2020 15:09:35 GMT 2
I have some code done for bottom pannel switches, ignition, trim, fuel selector, fuel cut off with LED. I can share if you wish. The main pannel encoders are easy with AM.
|
|
|
Post by polarair on Nov 5, 2020 11:16:54 GMT 2
Bosal, If you get the wet compass we will need to get a zero point made inside, i was thinking of a hall or optical sensor that detects a hole in the 360 round cilinder on top of the stepper motor. AM will not allow you to get it back to 0 automatically so i/we need to program it with additional hardware. Just for your info. The SIMMAX.IT wetcompas is also without the zero and the one on this site also. If using mobiflight for the compass you need to make sure that you quit the simulator correctly every time, or manually set the 0 point.
I dont know if i will go mobi or AM for the WET compass. Any Ideas... or others mike
|
|
|
Post by polarair on Nov 5, 2020 11:18:12 GMT 2
This is for the board right? I need to check, maybe i have changed the order or something in the PCB version and I don't remember. Good work on doing this with airmanager, i was also interested to see if there is any lag, because after some time flying, while using mobiflight, i was getting lag while changing frequencies for example. I also found the Transponder switches: View AttachmentThe image shows 6 positions? in a 5 position switch?
|
|
bosal
New Member
Posts: 42
|
Post by bosal on Nov 5, 2020 14:24:02 GMT 2
The selector switch on the PCB: upper middle is GND, the upper selector pins are pin TranspSw1 to 5 from left to right. On first sight pin TranspSwA is not routed on the PCB.
|
|
|
Post by polarair on Nov 8, 2020 17:33:04 GMT 2
HELP!! I made some sample code to look at the displays and see it they are responding. I also made a video excecuting this simple code and see the results. Original Arduinos, All soldering is rechecked. I only bought nice components. Im getting fustrated that this is not working. What is wrong? It looks like a speed thing, the PC is Intel 7i so that should not be the problem.
The code: -- First display -- Tried with 2-3-4-5 charecters -- Create a new Max7219 based character display display_chr_1 = hw_chr_display_add("MAX7219", 8, "ARDUINO_MEGA2560_A_D22", "ARDUINO_MEGA2560_A_D24", "ARDUINO_MEGA2560_A_D23")
-- Set text "12345" on display 0 (first), line 0 hw_chr_display_set_text(display_chr_1, 0, 0, "01") hw_chr_display_set_text(display_chr_1, 1, 0, "02") hw_chr_display_set_text(display_chr_1, 2, 0, "03") hw_chr_display_set_text(display_chr_1, 3, 0, "04") hw_chr_display_set_text(display_chr_1, 4, 0, "05") hw_chr_display_set_text(display_chr_1, 5, 0, "06") hw_chr_display_set_text(display_chr_1, 6, 0, "07") hw_chr_display_set_text(display_chr_1, 7, 0, "08")
-- second display
-- Create a new Max7219 based character display display_chr_2 = hw_chr_display_add("MAX7219", 8, "ARDUINO_MEGA2560_A_D25", "ARDUINO_MEGA2560_A_D27", "ARDUINO_MEGA2560_A_D26")
-- Set text "12345" on display 0 (first), line 0 hw_chr_display_set_text(display_chr_2, 0, 0, "11") hw_chr_display_set_text(display_chr_2, 1, 0, "12") hw_chr_display_set_text(display_chr_2, 2, 0, "13") hw_chr_display_set_text(display_chr_2, 3, 0, "14") hw_chr_display_set_text(display_chr_2, 4, 0, "15") hw_chr_display_set_text(display_chr_2, 5, 0, "16") hw_chr_display_set_text(display_chr_2, 6, 0, "17") hw_chr_display_set_text(display_chr_2, 7, 0, "18")
-- third display
-- Create a new Max7219 based character display display_chr_3 = hw_chr_display_add("MAX7219", 8, "ARDUINO_MEGA2560_A_D28", "ARDUINO_MEGA2560_A_D30", "ARDUINO_MEGA2560_A_D29")
-- Set text "12345" on display 0 (first), line 0 hw_chr_display_set_text(display_chr_3, 0, 0, "21") hw_chr_display_set_text(display_chr_3, 1, 0, "22") hw_chr_display_set_text(display_chr_3, 2, 0, "23") hw_chr_display_set_text(display_chr_3, 3, 0, "24") hw_chr_display_set_text(display_chr_3, 4, 0, "25") hw_chr_display_set_text(display_chr_3, 5, 0, "26") hw_chr_display_set_text(display_chr_3, 6, 0, "27") hw_chr_display_set_text(display_chr_3, 7, 0, "28")
-- display_chr_id = hw_chr_display_add("MAX7219", 2, "ARDUINO_MEGA2560_A_D22", "ARDUINO_MEGA2560_A_D24", "ARDUINO_MEGA2560_A_D23")
|
|
|
Post by AlbEagle on Nov 8, 2020 18:13:11 GMT 2
Are you using external power ro power up the displays (eg. Pc power supply). There is one thing i have learned about max chips (from the experience playing with them), they need to be supplied first with power than start the program that you want to run. The sequence i run my radio is: first supply with power from a power supply, than connect the arduinos, and than run the mobiflight ( in this case AM).
|
|
bosal
New Member
Posts: 42
|
Post by bosal on Nov 8, 2020 18:57:50 GMT 2
My LED displays stay black?? Any idea? Button input works so the Arduino's are connected to Air Manager.
|
|
|
Post by polarair on Nov 8, 2020 19:00:20 GMT 2
There is a 10AMP 5volt powersupply giving power to the board, then the 3 Arduinos They should all light up. If i do them seperately they do work if i keep running the program. Could it be the arduino, i can replace it with a backup. I presume i dont need to give the 12 volts to the board also as it was for backlighting only. Again this has been fustrating. Lots of time spend in tracing the problem.
Hope somebody comes with a solutio or idea where it could be.
|
|
|
Post by polarair on Nov 8, 2020 19:01:28 GMT 2
My LED displays stay black?? Any idea? Button input works so the Arduino's are connected to Air Manager. Use my little program in Airmanager, creat an instrument and past this in the code. The correct pins are done.. Testing made easy
|
|