HELP : Lua Code for a Batter Capacity Rest

  • skyfreak
  • skyfreak's Avatar
  • Offline
  • Platinum Member
  • Platinum Member
  • Posts: 2947
  • Thank you received: 1450

TPL_KUNENA_MESSAGE_REPLIED_NEW HELP : Lua Code for a Batter Capacity Rest

11 Aug 2021 07:14
#7
er will einen resett der capacity
die calculated capacity hat sows IMHO da kann er abschauen
denn so wie ich es verstehe will er keine app und auch nicht deine nutzen sondern seine um diese funktion erweitern
Fliegergruss
GUIDO



_________________________________________________________
Too many dicks on the dance floor.
Too many dicks!​


Please Log in or Create an account to join the conversation.

  • rolfbartels
  • rolfbartels's Avatar Topic Author
  • Offline
  • New Member
  • New Member
  • Posts: 9
  • Thank you received: 0

TPL_KUNENA_MESSAGE_REPLIED_NEW HELP : Lua Code for a Batter Capacity Rest

15 Aug 2021 13:13
#8
I am using powerboxes in my large scale planes, used/available mah capacity reported by the powerbox can be reset by assigning a switch to a channel, I am trying to find out how I can code a switch activation in lua, which i'll assign to the channel that will reset the capacity in the powerbox,

Please Log in or Create an account to join the conversation.

  • LeonAir
  • LeonAir's Avatar
  • Offline
  • Senior Member
  • Senior Member
  • Posts: 57
  • Thank you received: 58

TPL_KUNENA_MESSAGE_REPLIED_NEW HELP : Lua Code for a Batter Capacity Rest

15 Aug 2021 14:01
#9
As page 13 of the Lua api states:
You can register a Lua control via system.registerControl and then set it's state with system.setControl.
Then simply select the lua control as the input of the reset channel.

Leon

Please Log in or Create an account to join the conversation.

  • davidmcq137
  • davidmcq137's Avatar
  • Offline
  • Senior Member
  • Senior Member
  • Posts: 79
  • Thank you received: 87

TPL_KUNENA_MESSAGE_REPLIED_NEW HELP : Lua Code for a Batter Capacity Rest

19 Oct 2021 03:33
#10
@rolfbartels,

Lua apps can control an servo output .. look at the system.registerControl and system.setControl API calls. It creates a function (e.g. just like a stick or knob) but that is controlled by lua code and you can assign a servo output to it. I use it all the time, for example for autothrottle, or for my parachute deployment app.

Are you thinking about a lua app that, when it wakes up, and finds that the battery value has jumped up from a previously saved value, it cycles an output channel to tell the PB that the battery was charged?

Dave

Please Log in or Create an account to join the conversation.

Moderators: ThornIG-Modellbau
Time to create page: 0.321 seconds
Powered by Kunena Forum