arm/disarm beep indication - Solved

This forum is dedicated to all issues and questions related to your individual setups and configurations
Post Reply
ramdg
Posts: 15
Joined: Thu Aug 29, 2013 12:32 pm

arm/disarm beep indication - Solved

Post by ramdg »

Is there a way to configure a beep when the board is arm/disarm

Thanks.
_________________________________________________________
OK, I've added this functionality for my MW2.3
file: MultiWii.cpp functions: go_arm() , go_disarm()
Add the two lines (red) with asterisk below

void go_arm() {
if(calibratingG == 0
#if defined(ONLYARMWHENFLAT)
&& f.ACC_CALIBRATED
#endif
#if defined(FAILSAFE)
&& failsafeCnt < 2
#endif
) {
if(!f.ARMED && !f.BARO_MODE) { // arm now!
f.ARMED = 1;
headFreeModeHold = att.heading;
magHold = att.heading;
#if defined(VBAT)
if (analog.vbat > NO_VBAT) vbatMin = analog.vbat;
#endif
#ifdef LCD_TELEMETRY // reset some values when arming
#if BARO
BAROaltMax = alt.EstAlt;
#endif
#if GPS
GPS_speedMax = 0;
#endif
#ifdef POWERMETER_HARD
powerValueMaxMAH = 0;
#endif
#endif
#ifdef LOG_PERMANENT
plog.arm++; // #arm events
plog.running = 1; // toggle on arm & disarm to monitor for clean shutdown vs. powercut
// write now.
writePLog();
#endif
alarmArray[0] = 2; //***************************************************************************
}
} else if(!f.ARMED) {
blinkLED(2,255,1);
alarmArray[8] = 1;
}
}
void go_disarm() {
if (f.ARMED) {
f.ARMED = 0;
#ifdef LOG_PERMANENT
plog.disarm++; // #disarm events
plog.armed_time = armedTime ; // lifetime in seconds
if (failsafeEvents) plog.failsafe++; // #acitve failsafe @ disarm
if (i2c_errors_count > 10) plog.i2c++; // #i2c errs @ disarm
plog.running = 0; // toggle @ arm & disarm to monitor for clean shutdown vs. powercut
// write now.
writePLog();
#endif
alarmArray[0] = 2; //***************************************************************************
}
}
Last edited by ramdg on Mon Apr 28, 2014 7:09 pm, edited 1 time in total.

User avatar
haydent
Posts: 583
Joined: Sun Jun 17, 2012 1:35 am
Location: NSW, AU

Re: arm/disarm beep indication

Post by haydent »

if you have a buzzer connected yes

ramdg
Posts: 15
Joined: Thu Aug 29, 2013 12:32 pm

Re: arm/disarm beep indication

Post by ramdg »

I do have a buzzer but there is no indication.

sismeiro
Posts: 173
Joined: Tue Feb 21, 2012 12:33 pm

Re: arm/disarm beep indication

Post by sismeiro »

Hi,

I bought a buzzer and one of the purposes was to have a audio signal when arming and disarming, in my case it didn't work either. I didn't look at the code since I think it's not a bug, according to the information on the wiki it's not supposed to make sounds when arming and disarming: http://www.multiwii.com/wiki/index.php?title=Extra_features#Buzzer. Either way, it would be a nice feature to have.

Regards,
Luis Sismeiro

Andy7
Posts: 129
Joined: Fri Dec 28, 2012 5:09 pm
Location: Oxford, UK
Contact:

Re: arm/disarm beep indication

Post by Andy7 »

Curious to know why you'd want a beep on arm/disarm.
Isn't the beautiful whirring of motors a dead giveaway that they're armed?

sismeiro
Posts: 173
Joined: Tue Feb 21, 2012 12:33 pm

Re: arm/disarm beep indication

Post by sismeiro »

Andy7 wrote:Curious to know why you'd want a beep on arm/disarm.
Isn't the beautiful whirring of motors a dead giveaway that they're armed?

Hi,

For all the people that don't use the MOTOR_STOP option, yes the motors noise would suffice to indicate that they are armed and running. In my Xcopter I use this option and it would be a good addition to the buzzer sound signals the arm/disarm to alert me but also people that could be near by. Just my 2 euro cents.

Regards,
Luis Sismeiro

User avatar
haydent
Posts: 583
Joined: Sun Jun 17, 2012 1:35 am
Location: NSW, AU

Re: arm/disarm beep indication

Post by haydent »

hey, you will need to code it to beep. i can do it for you. does your buzzer just take normal voltage to beep or a pwm signal. and what version mw are you running

sismeiro
Posts: 173
Joined: Tue Feb 21, 2012 12:33 pm

Re: arm/disarm beep indication

Post by sismeiro »

haydent wrote:hey, you will need to code it to beep. i can do it for you. does your buzzer just take normal voltage to beep or a pwm signal. and what version mw are you running

Hi,

It would be a good addition to the MultiWii code for everybody with a buzzer. When someone uses the MOTOR_STOP option it would enable the buzzer sound for arm/disarm. My buzzer works with the current 2.3 output, no changes needed to make it sound.

Regards,
Luis Sismeiro

User avatar
haydent
Posts: 583
Joined: Sun Jun 17, 2012 1:35 am
Location: NSW, AU

Re: arm/disarm beep indication

Post by haydent »

there you go

sismeiro
Posts: 173
Joined: Tue Feb 21, 2012 12:33 pm

Re: arm/disarm beep indication

Post by sismeiro »

haydent wrote:there you go

It would be nice if the change was added to the development trunk.

sismeiro
Posts: 173
Joined: Tue Feb 21, 2012 12:33 pm

Re: arm/disarm beep indication - Solved

Post by sismeiro »

Hi,

Two suggestions for the code above instead of the red lines. If you want to always beep on arm/disarm:

Code: Select all

#ifdef BUZZER
  alarmArray[0] = 2;
#endif

If you want to beep on arm/disarm only when using MOTOR_STOP option:

Code: Select all

#ifdef BUZZER && MOTOR_STOP
       alarmArray[0] = 2;
#endif

Regards,
Luis Sismeiro

Post Reply