Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend BattCheck for FrSKY FLVS Advanced Lipo sensor (8 cells) #75

Closed
mha1 opened this issue Sep 10, 2022 · 11 comments
Closed

Extend BattCheck for FrSKY FLVS Advanced Lipo sensor (8 cells) #75

mha1 opened this issue Sep 10, 2022 · 11 comments

Comments

@mha1
Copy link

mha1 commented Sep 10, 2022

@offer-shmuely: Hi Offer, FrSky has a new 8 cell capable Lipo sensor. With PR 2302 I made a slight change to the Firmware side to have Cels deliver a max. of 8 cells instead of a max. of 6 cells. It would be very nice if you could look into extending your BattCheck LUA to display up to 8 cells. Thank you very much - Michael

PS: I did a quick and dirty change to V0.5's main.lua for my TX16s display as proof of concept but omitted the smaller displays. This is what I basically changed (based on V0.5) to make it show up to eight cells. I am sure you can do this much nicer and also for the smaller displays.

in local function create:

cellDataLive = { 0, 0, 0, 0, 0, 0, 0, 0 },
cellDataHistoryLowest = { 7, 7, 7, 7, 7, 7, 7, 7 },
cellDataHistoryCellLowest = 7,

in local function onTelemetryResetEvent:

wgt.cellDataLive = { 0, 0, 0, 0, 0, 0, 0, 0 }
wgt.cellDataHistoryLowest = { 7, 7, 7, 7, 7, 7, 7, 7 }
wgt.cellDataHistoryCellLowest = 7

in local function refreshZoneXLarge:

  local pos = { { x = 101, y = 38 }, { x = 154, y = 38 }, { x = 207, y = 38 }, { x = 260, y = 38 },
	        { x = 101, y = 57 }, { x = 154, y = 57 }, { x = 207, y = 57 }, { x = 260, y = 57 } }
  ...
  local pos = { { x = 101, y = 110 }, { x = 154, y = 110 }, { x = 207, y = 110 }, { x = 260, y = 110 }, 
	        { x = 101, y = 129 }, { x = 154, y = 129 }, { x = 207, y = 129 }, { x = 260, y = 129 } }
@offer-shmuely
Copy link
Contributor

no problem, but since I could not get one (I like to...)
I need to wait until the companion simulator will support it

@offer-shmuely
Copy link
Contributor

actually I can simulate it in code
so here...

image

image

@pfeerick
Copy link
Member

pfeerick commented Sep 11, 2022

There is a companion build for that PR, so should be able to simulate. It looks straightforward enough so is likely to be the next nightly firmware / main companion builds.

@mha1
Copy link
Author

mha1 commented Sep 11, 2022

@offer-shmuely looks great, thank you very much. Where can I find the updated version?

@mha1
Copy link
Author

mha1 commented Sep 11, 2022

@offer-shmuely please try this https://github.com/EdgeTX/edgetx/suites/8233289654/artifacts/359485951 with your updated BattCheck. Thanks - Michael

@offer-shmuely
Copy link
Contributor

#76

@mha1
Copy link
Author

mha1 commented Sep 12, 2022

Hi Offer,

Thank you very much. Have you tried this with the updated Companion (PR 2302 build)? Does the updated Companion telemetry simulator work for you?

And a question:
cellDataHistoryLowest = {5,5,5,5,5,5,5,5}, cellDataHistoryLowestPercent = {5,5,5,5,5,5,5,5}, cellDataHistoryCellLowest = 5,
I interpreted this as initial indexes of cell numbers (5 for the last cell of 6 cells considered). Shouldn't the 5's be 7's now?

Thanks - Michael

@offer-shmuely
Copy link
Contributor

Hi
yes, I checked it with the new companion, it works great.
still need to do some alignments on the 1/4 scale widgets, but I will do it some time in the future (since now I am busy with the LogViewer that I am building)
I do think to change the mechanism of the layout to be more automatic.

when you calculating min value, you are usually math.min(new-value, old-value)
in order it to work, the initial old-value should be a high number, so here it is 5v, since no cell voltage is expected to be more than 5v

@mha1
Copy link
Author

mha1 commented Sep 12, 2022

Awesome, thanks for the feedback!

@offer-shmuely
Copy link
Contributor

The pull request has merged
The issue can be closed

@mha1
Copy link
Author

mha1 commented Sep 16, 2022

Thank you very much!

@mha1 mha1 closed this as completed Sep 16, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants