[solved] Strange potentiometer behaviour after AM 4.0 upgrade
Re: Strange potentiometer behaviour after AM 4.0 upgrade
On the compass code. You need to move the endless rotation command outside of the calibration function to the head of your code just after the motor add. You have been very lucky if this was what you used for a long time and it worked.
Air Manager panels at https://www.experimentalsimavionics.com
Youtube Channel https://www.youtube.com/channel/UC8ZqXX ... kfZMq5BKig
Air Manager API Tutorial Video Series https://youtube.com/playlist?list=PLNr0 ... baT4gJKg5D
Youtube Channel https://www.youtube.com/channel/UC8ZqXX ... kfZMq5BKig
Air Manager API Tutorial Video Series https://youtube.com/playlist?list=PLNr0 ... baT4gJKg5D
Re: Strange potentiometer behaviour after AM 4.0 upgrade
Hard to say, it's not posted as pure Lua script.
Re: Strange potentiometer behaviour after AM 4.0 upgrade
Ok, here is my simple test script:
If you can provide a pure LUA script to test a LED light on D8 position, please do so.
Thank you in advance
Code: Select all
-- Wet Compass LED internal ligthing
wc_led = hw_led_add("ARDUINO_UNO_C_D8", 0.0)
--BCN LIGHTS
function button_Test_Uno_pressed()
-- The following print function is not necessary but can help you to verify that the button has been pressed
print("Button Test_Uno pressed")
-- Toggle the Beacon FSX and Prepar3D
fsx_event("TOGGLE_BEACON_LIGHTS")
hw_led_set(wc_led, 1.0)
end
function button_Test_Uno_released()
-- The following print function is not necessary but can help you to verify that the button has been pressed
print("Button Test_Uno released")
-- Toggle the Beacon FSX and Prepar3D
fsx_event("TOGGLE_BEACON_LIGHTS")
hw_led_set(wc_led, 0.0)
end
--Button Hardware section
--++++++++++++++++++++++++++++--
hw_button_add("Button_Test_Uno", button_Test_Uno_pressed, button_Test_Uno_released)
Thank you in advance
Re: Strange potentiometer behaviour after AM 4.0 upgrade
I tinkered a little bit my UNO card and reflashed it with another channel just to be sure (use P instead of C) and other pin position for the LED (D12 instead of D8) and retested it, without success.
Since I have an extra MEGA card for an other project, I temporarely used it and flashed it as "P" MEGA and, bingo, I found something interesting:
with the UNO card mentionned in the logic.lua code there is no mention of the LED in the hardware properties window whereas with the MEGA mentionned the LED popup in the hardware properties window and, at last, my small test code runs as advertised (i.e the LED is lighted when pressing my D13 push-button).
Here are screenshots for both situation:
As a matter of fact the LED showing in the hardwarte properties window is not related to the actual connection of the UNO or MEGA card to the PC but only to the code written in the logic.lua window: Is it normal ?
Why the LED isn't showing when the UNO is used ?
Since I have an extra MEGA card for an other project, I temporarely used it and flashed it as "P" MEGA and, bingo, I found something interesting:
with the UNO card mentionned in the logic.lua code there is no mention of the LED in the hardware properties window whereas with the MEGA mentionned the LED popup in the hardware properties window and, at last, my small test code runs as advertised (i.e the LED is lighted when pressing my D13 push-button).
Here are screenshots for both situation:
As a matter of fact the LED showing in the hardwarte properties window is not related to the actual connection of the UNO or MEGA card to the PC but only to the code written in the logic.lua window: Is it normal ?
Why the LED isn't showing when the UNO is used ?
- Keith Baxter
- Posts: 4685
- Joined: Wed Dec 20, 2017 11:00 am
- Location: Botswana
Re: Strange potentiometer behaviour after AM 4.0 upgrade
Hi,
In your testing. After you make hardware/code changes do you shut down and restart both sim and AM?
Keith
In your testing. After you make hardware/code changes do you shut down and restart both sim and AM?
Keith
AMD RYZEN 9 5950X CPU, Corsair H80I cooler, ASUS TUF GAMING B550-PLUS AMD Ryzen Mother Board, 32Gb ram Corsair Vengeance 3000Mh, MSI GTX960 4G graphics card
Re: Strange potentiometer behaviour after AM 4.0 upgrade
Hi Keith,
AM is restarted after any change (code or hardware). P3Dv4.5 is restarded after major change (harwdware or major code rework) since it is a rather long process.
AM is restarted after any change (code or hardware). P3Dv4.5 is restarded after major change (harwdware or major code rework) since it is a rather long process.
Re: Strange potentiometer behaviour after AM 4.0 upgrade
Hi,
Restarting is not going to help, at least it shouldn't.
The Hardware ID should be ARDUINO_MEGA2560_P_D12 instead of ARDUINO_MEGA_P_D12. That is why it pops up as a hardware property since it is not a valid hardware ID.
I'll test your script today on an Arduino Uno, the scripts seems okay.
Corjan
Restarting is not going to help, at least it shouldn't.
The Hardware ID should be ARDUINO_MEGA2560_P_D12 instead of ARDUINO_MEGA_P_D12. That is why it pops up as a hardware property since it is not a valid hardware ID.
I'll test your script today on an Arduino Uno, the scripts seems okay.
Corjan
Re: Strange potentiometer behaviour after AM 4.0 upgrade
Hi,
Seems like the little Arduino ran out of memory...
Would you mind installing this AM BETA version and flash the Arduino within AM:
https://www.siminnovations.com/api4/dow ... n=HOME_USE
Corjan
Seems like the little Arduino ran out of memory...
Would you mind installing this AM BETA version and flash the Arduino within AM:
https://www.siminnovations.com/api4/dow ... n=HOME_USE
Corjan
Re: Strange potentiometer behaviour after AM 4.0 upgrade
Thank you Corjan,
will do so and report ASAP
will do so and report ASAP