AM Desktop Beta 20

Let Sim Innovations know about your Air Manager experience and let us know about your dream feature addition

Moderators: russ, Ralph

Message
Author
Mike Horsten
Posts: 79
Joined: Tue Dec 01, 2020 8:50 am

AM Desktop Beta 20

#1 Post by Mike Horsten »

HI,
It seems that the ADC readout is not the same as the 3.71 or the beta 19. Im getting all kinds of strange readings. so not between the -- 0.0 : GND (lowest voltage)-- 1.0 : VCC (highest voltage) but from 0 to 0.015volt. When i go back to the same setup some code to 3.71 it works fine.
Its in my code but also in the new ver4.0 hardware options for throttle, mixure and prop.

Mike
Building a home Cessna 172SP Steam. X-plane/MFS2020
(ex Name on Airmanager forum Polarair)

User avatar
Ralph
Posts: 7917
Joined: Tue Oct 27, 2015 7:02 pm
Location: De Steeg
Contact:

Re: AM Desktop Beta 20

#2 Post by Ralph »

Did you flash the Arduino('s) in 4.0 and back to 3.7?

Mike Horsten
Posts: 79
Joined: Tue Dec 01, 2020 8:50 am

Re: AM Desktop Beta 20

#3 Post by Mike Horsten »

Yes and no. Let me explain.

The adc inputs where working fine in beta19 and in 3.7 (2 pc's one with Beta19 -now Beta20 & one with Beta20 and 3.7) Flashing to 4.0 all worked well in Beta19, as it did with Arduino flash for 3.7.1. After the update to Beta20 the ADC inputs went wrong.
So i presume as nothing else changed the beta20 is the issue. I moved the device to the other PC with 3.7 Arduino flashed and all worked also. My 3.7 pc is currently my working PC the one with the beta is a development pc.
Arduinos are flashed for the correct version of the frontend.

So im a bit lost. I can reflash the beta versions if you want me to try.

Mike
Building a home Cessna 172SP Steam. X-plane/MFS2020
(ex Name on Airmanager forum Polarair)

User avatar
Ralph
Posts: 7917
Joined: Tue Oct 27, 2015 7:02 pm
Location: De Steeg
Contact:

Re: AM Desktop Beta 20

#4 Post by Ralph »

We did not touch any Arduino code as far as I know, so I rather presume it's something electrical.

Mike Horsten
Posts: 79
Joined: Tue Dec 01, 2020 8:50 am

Re: AM Desktop Beta 20

#5 Post by Mike Horsten »

Ralph,

Ill do some testing on the same Arduino and PC today with both 3.7x and 4.0B20. with X-plane, P3d and FS2020

Mike
Building a home Cessna 172SP Steam. X-plane/MFS2020
(ex Name on Airmanager forum Polarair)

User avatar
Corjan
Posts: 2939
Joined: Thu Nov 19, 2015 9:04 am

Re: AM Desktop Beta 20

#6 Post by Corjan »

Hi,

We actually did make a change in the ADC code. The communication between AM and the Arduino changed from 10-bit -> 16-bit.
If you flash the Arduino with the AM version you want to connect it too, you should be good.

Corjan

Mike Horsten
Posts: 79
Joined: Tue Dec 01, 2020 8:50 am

Re: AM Desktop Beta 20

#7 Post by Mike Horsten »

Hi Corjan,

Did do the test today and the values are not the same, the liniar pod works fine with the flash from 3.7 but not when i flash the board to 4.x and the right desktop version (beta20). It did work fine in beta 19 not in beta 20.

checked it today and its the same in all sims so it must be something in AM somewhere.

As i only have on pc the sim with 3.7 its not that easy to do the tests in the work pc. i switched 2x times already and i have one licence move left.
Building a home Cessna 172SP Steam. X-plane/MFS2020
(ex Name on Airmanager forum Polarair)

User avatar
Corjan
Posts: 2939
Joined: Thu Nov 19, 2015 9:04 am

Re: AM Desktop Beta 20

#8 Post by Corjan »

Hi,


Just tested here with AM 4.0 (BETA 20), and seems to work fine.

Tested with an Arduino MEGA 2560 (flashed in AM 4.0 BETA 20) using the following script:

Code: Select all

-- Callback function which is called when the ADC input state changes
-- 0.0 : GND (lowest voltage)
-- 1.0 : VCC (highest voltage)
function adc_input_change(value)
  print("new value= " .. tostring(value) )
end

-- Bind to the first pin of hardware port A
hw_adc_input_add("ARDUINO_MEGA2560_A_A1", adc_input_change)

Corjan

Mike Horsten
Posts: 79
Joined: Tue Dec 01, 2020 8:50 am

Re: AM Desktop Beta 20

#9 Post by Mike Horsten »

Ill test it again, today with your script.

this is what i have been using:

Code: Select all

-- Throttel quadrant
function adc_input_throttle(trottle_value)
print("Trottle " .. trottle_value*100)
  -- X-Plane expects a value between 0 and 1, no conversion necessary
 xpl_dataref_write("sim/flightmodel/engine/ENGN_thro", "FLOAT[8]", {trottle_value})
end

function adc_input_prop(prop_value)
print("Prop " .. prop_value)
  -- X-Plane expects a value between 0 and 1, no conversion necessary
  xpl_dataref_write("sim/flightmodel/engine/ENGN_prop", "FLOAT[8]", {prop_value})
end

function adc_input_mixture(mixture_value)
print("Mixture " .. mixture_value)
  -- X-Plane expects a value between 0 and 1, no conversion necessary
  xpl_dataref_write("sim/flightmodel/engine/ENGN_mixt", "FLOAT[8]", {mixture_value})
end
function adc_input_flaps(flaps_value)
print("Flap " .. flaps_value)
  -- X-Plane expects a value between 0 and 1, no conversion necessary
  xpl_dataref_write("sim/multiplayer/controls/flap_request", "FLOAT[8]", {flaps_value})
end
-- Harware ADD Liniar POD for 3 TPM
hw_adc_input_add("ARDUINO_MEGA2560_A_A0", adc_input_throttle)
hw_adc_input_add("ARDUINO_MEGA2560_A_A1", adc_input_prop)
hw_adc_input_add("ARDUINO_MEGA2560_A_A2", adc_input_mixture)
One question about this also, how would i controle 2 engines with one throttle. Reason im building a C172 deck but sometime would be nice to run a twin, so running the throttle for engine1 and 2 or using the prop for engine 2.. Any tips or sugjestions.

Mike
Building a home Cessna 172SP Steam. X-plane/MFS2020
(ex Name on Airmanager forum Polarair)

User avatar
Ralph
Posts: 7917
Joined: Tue Oct 27, 2015 7:02 pm
Location: De Steeg
Contact:

Re: AM Desktop Beta 20

#10 Post by Ralph »

Write the same value to position 2 of the array.

Code: Select all

xpl_dataref_write("sim/flightmodel/engine/ENGN_thro", "FLOAT[8]", {trottle_value,trottle_value})

Post Reply