How to play beep sound without changing motor speed

Discussions about all things Bitcraze
Post Reply
imranmomtaz
Beginner
Posts: 26
Joined: Tue Mar 17, 2020 7:01 pm

How to play beep sound without changing motor speed

Post by imranmomtaz »

Hello,
I see that the when sounds are played during the startup, it is coming from motorsBeep definition from https://github.com/bitcraze/crazyflie-f ... ors.c#L270. I also see that it is changing the speed as well (found from the documentation available in motors.h).

I would like to be able to play sound only *without* changing the speed (i plan to use this during the flight, and speed command will come from the controller. Additionally, I dont intend to use buzzer deck for this). Please let me know how I should change the code to achieve this.

Thanks.
tobias
Bitcraze
Posts: 2037
Joined: Mon Jan 28, 2013 7:17 pm
Location: Sweden

Re: How to play beep sound without changing motor speed

Post by tobias »

It might be possible to do this but it will definitely degrade the motor response, might still be able to fly though.

You would have to change the motor driver to constantly change the motor PWM in accordance to the sound you want to play. It's not trivial how to do this.
Post Reply