bmooneyhan wrote: ↑Sat Mar 18, 2023 8:08 pm Okay, so I found that, thank you. I'm getting the impression that the screenshot is for a new version of AM than I'm running (3.6), as I don't see the same screen. Are you saying that the hardware functionality exists to do this properly in AM 4.x?
Thank you again.
Buddy
Wet / Magnetic Compass Questions
-
- Posts: 4336
- Joined: Thu Jul 27, 2017 12:22 am
Re: Wet / Magnetic Compass Questions
Re: Wet / Magnetic Compass Questions
That's indeed in version 4.
-
- Posts: 23
- Joined: Tue Jan 08, 2019 8:28 pm
Re: Wet / Magnetic Compass Questions
Hi Ralph,
Yes, I downloaded and installed version 4 as soon as I read it. Looks like there's a lot of other interesting and cool stuff in 4. One question. My code to display on 7-segment displays seems to be acting differently now. As an example, where I used to get "110.500", now I just get ".500", which is displayed on the 4 left-most display digits. Was there a change in how the MAX7219 handles the data, and now I need to pad the string to 8 digits?
Mine are 6-digit PCBs, and I use code that looks like this to output:
Thanks!
Yes, I downloaded and installed version 4 as soon as I read it. Looks like there's a lot of other interesting and cool stuff in 4. One question. My code to display on 7-segment displays seems to be acting differently now. As an example, where I used to get "110.500", now I just get ".500", which is displayed on the 4 left-most display digits. Was there a change in how the MAX7219 handles the data, and now I need to pad the string to 8 digits?
Mine are 6-digit PCBs, and I use code that looks like this to output:
Code: Select all
display_chr_id = hw_chr_display_add("MAX7219", 4, "ARDUINO_MEGA2560_B_D26", "ARDUINO_MEGA2560_B_D27", "ARDUINO_MEGA2560_B_D28")
hw_chr_display_set_brightness(display_chr_id,0,0.35)
function com1sb_code(data_code1)
data_str1 = (data_code1 / 100)
com1sb_str = tostring(data_str1)
hw_chr_display_set_text(display_chr_id, 1, 0, string.format("%.3f", com1sb_str))
end
xpl_dataref_subscribe("sim/cockpit/radios/com1_freq_hz", "int", mycom1_code)
xpl_dataref_subscribe("sim/cockpit/radios/com1_stdby_freq_hz", "int", com1sb_code)
-
- Posts: 4336
- Joined: Thu Jul 27, 2017 12:22 am
Re: Wet / Magnetic Compass Questions
Should have been an internal bug in AM prior to AM 3.7, which was allowing this to work ...bmooneyhan wrote: ↑Sun Mar 19, 2023 1:03 pm Hi Ralph,
Yes, I downloaded and installed version 4 as soon as I read it. Looks like there's a lot of other interesting and cool stuff in 4. One question. My code to display on 7-segment displays seems to be acting differently now. As an example, where I used to get "110.500", now I just get ".500", which is displayed on the 4 left-most display digits. Was there a change in how the MAX7219 handles the data, and now I need to pad the string to 8 digits?
Mine are 6-digit PCBs, and I use code that looks like this to output:
Thanks!Code: Select all
display_chr_id = hw_chr_display_add("MAX7219", 4, "ARDUINO_MEGA2560_B_D26", "ARDUINO_MEGA2560_B_D27", "ARDUINO_MEGA2560_B_D28") hw_chr_display_set_brightness(display_chr_id,0,0.35) function com1sb_code(data_code1) data_str1 = (data_code1 / 100) com1sb_str = tostring(data_str1) hw_chr_display_set_text(display_chr_id, 1, 0, string.format("%.3f", com1sb_str)) end xpl_dataref_subscribe("sim/cockpit/radios/com1_freq_hz", "int", mycom1_code) xpl_dataref_subscribe("sim/cockpit/radios/com1_stdby_freq_hz", "int", com1sb_code)
This is not correct :
Code: Select all
hw_chr_display_set_text(display_chr_id, 1, 0, string.format("%.3f", com1sb_str))
Code: Select all
hw_chr_display_set_text(display_chr_id, 1, 0, string.format("%03.3f", com1sb_str))
Code: Select all
hw_chr_display_set_text(display_chr_id, 1, 0, string.format("%3.3f", com1sb_str))
-
- Posts: 23
- Joined: Tue Jan 08, 2019 8:28 pm
Re: Wet / Magnetic Compass Questions
Thank you, all working now. Appreciate the help as always.
-
- Posts: 23
- Joined: Tue Jan 08, 2019 8:28 pm
Re: Wet / Magnetic Compass Questions
Regarding the compass, I have a couple of additional questions.
In the Create/Edit tab, I added the Hardware Function for the wet compass with manual calibration. I configured the pins for the stepper and calibrate button. I configured type, steps, speed. When I run the hardware from here, it functions perfectly, calibration works, rotate to new heading works fine, if I move the plane in xplane, the hardware follows.
When I go back to the panel and Show it, nothing happens at all. At this point there is no compass on the panel. SO, I added the same wet compass with manual calibration to the panel configure all the params and pins the same, still nothing happens. I feel like I'm missing something very simple and obvious, but what?
1. Is the instrument on the panel not tied to the hardware function?
2. Is the hardware function used instead of the instrument?
Thanks,
Buddy
In the Create/Edit tab, I added the Hardware Function for the wet compass with manual calibration. I configured the pins for the stepper and calibrate button. I configured type, steps, speed. When I run the hardware from here, it functions perfectly, calibration works, rotate to new heading works fine, if I move the plane in xplane, the hardware follows.
When I go back to the panel and Show it, nothing happens at all. At this point there is no compass on the panel. SO, I added the same wet compass with manual calibration to the panel configure all the params and pins the same, still nothing happens. I feel like I'm missing something very simple and obvious, but what?
1. Is the instrument on the panel not tied to the hardware function?
2. Is the hardware function used instead of the instrument?
Thanks,
Buddy
-
- Posts: 4336
- Joined: Thu Jul 27, 2017 12:22 am
Re: Wet / Magnetic Compass Questions
Indeed, a hardware instrument is never meant to be displaying something in any casebmooneyhan wrote: ↑Sun Mar 19, 2023 3:35 pm Regarding the compass, I have a couple of additional questions.
In the Create/Edit tab, I added the Hardware Function for the wet compass with manual calibration. I configured the pins for the stepper and calibrate button. I configured type, steps, speed. When I run the hardware from here, it functions perfectly, calibration works, rotate to new heading works fine, if I move the plane in xplane, the hardware follows.
When I go back to the panel and Show it, nothing happens at all. At this point there is no compass on the panel. SO, I added the same wet compass with manual calibration to the panel configure all the params and pins the same, still nothing happens. I feel like I'm missing something very simple and obvious, but what?
1. Is the instrument on the panel not tied to the hardware function?
2. Is the hardware function used instead of the instrument?
Thanks,
Buddy
For this expected purpose, we have to add a standard instrument without the hardware handling to avoid duplicate hardware handling
So :
1 x Instrument with display capability
1 x Instrument with hardware handling
or 1 x Instrument with both display and hardware capabilities
-
- Posts: 23
- Joined: Tue Jan 08, 2019 8:28 pm
Re: Wet / Magnetic Compass Questions
Hi SP, thanks for that info, still a bit confused.
The hardware instrument runs the motor fine to make the compass move when I run it in the Create/Edit tab. I don't need a compass instrument in my panel for my own use, are you saying that I need a standard compass instrument on the panel to "call" or tie to the hardware instrument?
The hardware instrument runs the motor fine to make the compass move when I run it in the Create/Edit tab. I don't need a compass instrument in my panel for my own use, are you saying that I need a standard compass instrument on the panel to "call" or tie to the hardware instrument?
-
- Posts: 4336
- Joined: Thu Jul 27, 2017 12:22 am
Re: Wet / Magnetic Compass Questions
Absolutely not, just answered to your request to show something on displaybmooneyhan wrote: ↑Sun Mar 19, 2023 3:57 pm Hi SP, thanks for that info, still a bit confused.
The hardware instrument runs the motor fine to make the compass move when I run it in the Create/Edit tab. I don't need a compass instrument in my panel for my own use, are you saying that I need a standard compass instrument on the panel to "call" or tie to the hardware instrument?
-
- Posts: 4336
- Joined: Thu Jul 27, 2017 12:22 am
Re: Wet / Magnetic Compass Questions
Just understood : binding in the [Create/Edit] tab is not the same thing than binding the instrument in the Panel through the [Home] tab
So we have to select the hardware instrument in the panel and bind to Arduino inputs for it to work
So we have to select the hardware instrument in the panel and bind to Arduino inputs for it to work