I have just created a account in this forum because i have created a new light wight feature ...
I have build a medium size Quadcopter with 4 HobbyKing High Power Led's used as Navigation Lights (one red led on each front arm, one green led on each rear arm). I operate them by using a small led driver with a control input. This input is driven by D7 which i have configured as LEDFLASHER output pin. I want to use the LOWBATT indication but I was not happy with the beeper used for low battery alarms as i can't hear it when airborne. Another led as pilot lamp? .. noooo .. i have already leds which can be controlled by the MultiWii so I want to use them.
So I have created a patch which attaches to the low battery alarm and sets the led flasher sequence .. but see your self:
Code: Select all
Index: src/MultiWii/Alarms.cpp
===================================================================
--- src/MultiWii/Alarms.cpp (revision 1648)
+++ src/MultiWii/Alarms.cpp (working copy)
@@ -541,6 +541,30 @@
}
#endif
+ #if defined(LED_FLASHER_SEQUENCE_LOWBAT1)
+ /* do we have a special led sequence for battery alarm 1 ? */
+ if (alarmArray[6] == 1) {
+ led_flasher_set_sequence(LED_FLASHER_SEQUENCE_LOWBAT1);
+ return;
+ }
+ #endif
+
+ #if defined(LED_FLASHER_SEQUENCE_LOWBAT2)
+ /* do we have a special led sequence for battery alarm 2 ? */
+ if (alarmArray[6] == 2) {
+ led_flasher_set_sequence(LED_FLASHER_SEQUENCE_LOWBAT2);
+ return;
+ }
+ #endif
+
+ #if defined(LED_FLASHER_SEQUENCE_BATCRIT)
+ /* do we have a special led sequence for critical battery voltage ? */
+ if (alarmArray[6] == 4) {
+ led_flasher_set_sequence(LED_FLASHER_SEQUENCE_BATCRIT);
+ return;
+ }
+ #endif
+
#if defined(LED_FLASHER_SEQUENCE_ARMED)
/* do we have a special sequence for armed copters? */
if (f.ARMED) {
Index: src/MultiWii/config.h
===================================================================
--- src/MultiWii/config.h (revision 1648)
+++ src/MultiWii/config.h (working copy)
@@ -581,15 +581,18 @@
//#define LED_RING
/******************************** LED FLASHER ***********************************/
- //#define LED_FLASHER
- //#define LED_FLASHER_DDR DDRB
- //#define LED_FLASHER_PORT PORTB
- //#define LED_FLASHER_BIT PORTB4
+ #define LED_FLASHER
+ #define LED_FLASHER_DDR DDRD
+ #define LED_FLASHER_PORT PORTD
+ #define LED_FLASHER_BIT PORTD7
//#define LED_FLASHER_INVERT
- //#define LED_FLASHER_SEQUENCE 0b00000000 // leds OFF
- //#define LED_FLASHER_SEQUENCE_ARMED 0b00000101 // create double flashes
- //#define LED_FLASHER_SEQUENCE_MAX 0b11111111 // full illumination
- //#define LED_FLASHER_SEQUENCE_LOW 0b00000000 // no illumination
+ #define LED_FLASHER_SEQUENCE 0b00000000 // leds OFF
+ #define LED_FLASHER_SEQUENCE_ARMED 0b00000101 // create double flashes
+ #define LED_FLASHER_SEQUENCE_LOWBAT1 0b01100110 // used for low bat threshold 1
+ #define LED_FLASHER_SEQUENCE_LOWBAT2 0b01010101 // used for low bat threshold 2
+ #define LED_FLASHER_SEQUENCE_BATCRIT 0b00000000 // used for critical battery voltage
+ #define LED_FLASHER_SEQUENCE_MAX 0b11111111 // full illumination
+ #define LED_FLASHER_SEQUENCE_LOW 0b00000000 // no illumination
/******************************* Landing lights *********************************/
So the user has to configure the low battery thresholds as usual, and when the led flasher is used the LED_FLASHER_SEQUENCE_LOWBAT1, LED_FLASHER_SEQUENCE_LOWBAT2 and/or LED_FLASHER_SEQUENCE_BATCRIT can be used to signalize the alarm.
I think this is a very light wight feature which will help a lot of pilots out there by adding a very practical method of low battery indication

I will upload a video to youtube to demonstrate the feature and post the link here.
Hope you like it, br
Julian F.