mirror of
https://github.com/betaflight/betaflight.git
synced 2025-07-23 08:15:30 +03:00
Quickly hack up implementation of turn indicators.
With an LED strip length of 10, arrange the leds clockwise from 1 to 10 starting with led 1 at the north west (10:30hrs) with led 5 north east (01:30hrs), led 6 south east and led 10 south west. When armed or not, moving the roll stick to the left will make the leds on the left flash, and same for right and also for pitch forwards and backwards too.
This commit is contained in:
parent
651a433718
commit
bad872377b
3 changed files with 23 additions and 0 deletions
|
@ -394,7 +394,10 @@ void updateLedStrip(void)
|
|||
|
||||
static uint8_t stripState = 0;
|
||||
|
||||
const rgbColor24bpp_t *flashColor;
|
||||
|
||||
if (stripState == 0) {
|
||||
flashColor = &orange;
|
||||
if (f.ARMED) {
|
||||
setStripColors(stripOrientation);
|
||||
} else {
|
||||
|
@ -402,12 +405,30 @@ void updateLedStrip(void)
|
|||
}
|
||||
stripState = 1;
|
||||
} else {
|
||||
flashColor = &black;
|
||||
if (feature(FEATURE_VBAT) && shouldSoundBatteryAlarm()) {
|
||||
setStripColor(&black);
|
||||
}
|
||||
stripState = 0;
|
||||
}
|
||||
|
||||
if (rcCommand[ROLL] < -100) {
|
||||
setLedColor(0, flashColor);
|
||||
setLedColor(9, flashColor);
|
||||
}
|
||||
if (rcCommand[ROLL] > 100) {
|
||||
setLedColor(4, flashColor);
|
||||
setLedColor(5, flashColor);
|
||||
}
|
||||
if (rcCommand[PITCH] > 100) {
|
||||
setLedColor(0, flashColor);
|
||||
setLedColor(4, flashColor);
|
||||
}
|
||||
if (rcCommand[PITCH] < -100) {
|
||||
setLedColor(5, flashColor);
|
||||
setLedColor(9, flashColor);
|
||||
}
|
||||
|
||||
ws2811UpdateStrip();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue