sakuraclamp / arducopter

Automatically exported from code.google.com/p/arducopter
0 stars 0 forks source link

2.4.1 Voltage/Current alarm fix for new APM 2 hardware #362

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Sensors.PDE:

    }

    #if BATTERY_EVENT == 1
-   //if(battery_voltage < g.low_voltage)
-   //  low_battery_event();

    if((battery_voltage1 < g.low_voltage) || (g.battery_monitoring == 4 && current_total1 > g.pack_capacity)){
        low_battery_event();

        #if PIEZO_LOW_VOLTAGE == 1
        // Only Activate if a battery is connected to avoid alarm on USB only
-       if (battery_voltage1 > 1){
-           piezo_on();
-       }else{
-           piezo_off();
-       }
+
+            #if USB_MUX_PIN > 0
+            //APM2
+                if (!usb_connected) {
+            #else
+            //APM1
+                if (battery_voltage1 > 1) {
+            #endif
+                    piezo_on();
+                } else {
+                    piezo_off();
+                }
        #endif

    }else{

Original issue reported on code.google.com by fueck...@gmail.com on 24 Feb 2012 at 10:01

GoogleCodeExporter commented 8 years ago
I think this is done in 2.9 by the following code in events.pde

#if COPTER_LEDS == ENABLED
    if ( bitRead(g.copter_leds_mode, 3) ) {         // Only Activate if a battery is connected to avoid alarm on USB only
        piezo_on();
    }
#endif // COPTER_LEDS

Original comment by Benny.Si...@gmail.com on 20 Jan 2013 at 10:56

GoogleCodeExporter commented 8 years ago
Issue closed. 
If you find this is an error please report it in the new issues list
https://github.com/diydrones/ardupilot/issues?labels=ArduCopter&page=1&state=ope
n

Original comment by Benny.Si...@gmail.com on 20 Jan 2013 at 10:56