forked from betaflight/betaflight
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
New led functions gps bar battery bar altitude (betaflight#13404)
* Add LED functions: Battery Bar, GPS Bar Battery Bar: Indicates the battery percentage with a loading bar style GPS Bar: Indicates the amount of locked GPS satellites with a loading bar style * LED altitude function Adds a new function: LED altitude. Sets the LED color based on the altitude, measured from the initialized position. * set led color to background if value decreases Even if the gps satellite count decreases at a later point in time, the LEDs update correctly now. It is the same for the battery level function. LEDs color changes more strongly now when based on altitude. * Added proper ifdefs for GPS and Barometer * fixed unittest and use estimate altitute - fixed unittest - cleaner indentation - the altitude function now uses the estimate function instead of the raw value (gps+barometer) * counters in struct, gps bar color gradient - Counters for the led bar are now handled in a structure. - Moved the led bar code to a seperate function that is only called when the led config changes. - improved usefulness of the gps led bar with less than 4 leds installed by adding a color gradient. * Update src/main/io/ledstrip.c Co-authored-by: Petr Ledvina <[email protected]> * Update src/main/io/ledstrip.c Co-authored-by: Petr Ledvina <[email protected]> * Update src/main/io/ledstrip.c Co-authored-by: Petr Ledvina <[email protected]> * Update src/main/io/ledstrip.h Co-authored-by: Petr Ledvina <[email protected]> * Update src/main/io/ledstrip.c Co-authored-by: Petr Ledvina <[email protected]> * one min led for very low battery, use failsafe sats to interpolate - at least one led is lit up for the battery/gps bar at all time (to show color gradient, also making the function more useful when only applying it to 1 led). - gps bar now takes the failsafe min sats (or default 8) to interpolate between red and green. - rewrote the led codes to be less fragile - some structural changes that also adress comments on the pull request * fix code if no gps rescue is used fixes code if no gps rescue is used. sets the default min sats to 8. * Update src/main/io/ledstrip.c Co-authored-by: Petr Ledvina <[email protected]> * Fixes per review ledvinap * Fixes per review Ledvinap 2 * Update src/main/io/ledstrip.c * Update src/main/io/ledstrip.c --------- Co-authored-by: jonas-becker <jonas@Thinkpad> Co-authored-by: Petr Ledvina <[email protected]> Co-authored-by: Mark Haslinghuis <[email protected]>
- Loading branch information
1 parent
5fd3852
commit d1ffa46
Showing
3 changed files
with
122 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters