AnimationManager and PWM does not work at Core2 Board

Hi,

I am trying to use the AnimationManager togther with a PWM output to drive a buzzer with the Core2 board.

The AnimationManager as well as the buzzer working well alone. But as soon as I try to use a PWM output:

PwmOut *buzzer = new PwmOut( SERVO1_PWM );

the AnimationManager does not work anymore.

I tried serveral different pins for both, but no combination works.

Knowing the Core2 board is old (I have from the Crowd Supply campaign and it works very well for me), I hope someone could give me a hint.

Thanks

Michael

Hello @MichaelT,

Could you please describe the problem in more detail? I haven’t delved into the firmware much and I’m not even sure what the context is. Some questions that will help me better understand the context:

  • Are you using ROSbot, or do you have just the CORE2 board?
  • What code are you using?

Hi Rafal,

thanks for your quick response.

I have just a CORE2 board and my own robot (running with Jazzy on the Rpi).

But the problem occurs also independent from ROS. For testing I made a small project with the AnimationManager (copied from here: rosbot-firmware-new/lib/AnimationManager at master · husarion/rosbot-firmware-new · GitHub ) and a short buzzer sound.

My main routine is basically the following:

AnimationManager * anim_manager;

anim_manager = AnimationManager::getInstance();

anim_manager->init();

anim_manager->enableInterface(true);

anim_manager->setRainbowAnimation();

// Buzzer sound

PwmOut *buzzer = new PwmOut( SERVO2_PWM );
int period = 5000;

buzzer->period_us( period );

buzzer->pulsewidth_us( period / 2 );

ThisThread::sleep_for( 2000 );

The problem seems to be the initialization of the buzzer pointer. If I comment it out (and of course the rest) the AnimationManager works as expected, otherwise only the sound works.

Michael

Hello @MichaelT,

It’s hard for me to offer any advice. The problem looks like a resource conflict (perhaps they’re using the same timer). The repository is quite outdated, considering both the age of the code and the fact that it was developed using the mbed framework (which we no longer use). :confused:

Thanks for your help.

I think you are right, maybe I make some further investigations.

Michael