Adafruit Motor Shield for Arduino

That was the first thing I did. Keypad key_down or key_up events do not invoke any calls to motor shield.

Sorry, that’s not what I wanted to know - you did state that earlier. I’m more interested in WHERE does the motor speed up, is it when the handler is invoked, is it when the handler exits? Stepping is a useful diagnostic tool, and given this seems to be specific to you I suspect there’s a code issue that perhaps only you can assist in debugging by stepping through code. It may also be worth getting back to the “simplest example code to show the fault” and posting that. Often times that is a quick way for someone who has the required hardware to try things out and see.

One final check. You have got the GNDs of your two disparate power sources tied together somewhere, right?

OK, I found the source of this problem but don’t understand the reason.

I have Piezo Buzzer connected between MOD(PMW) and Ground pins. Every time the key is pushed a beep is sounded by the following function:


public void Play(Note n, int octave, Duration t)
        {
            myPWM.Set(Frequency(n, octave) + _iBaseFrequency, 50);
            Thread.Sleep((int)t);
            myPWM.Set(0, 0);
        }

_iBaseFrequency = 4000; // Hz

Can anyone tell me why this call cause motors connected to motor shield go wild?

All PWM pins share the same frequency. You can change duty cycle.

Use output compare to sound the buzzer.

thanks Gus it now make sense. Can you post an example?

Hello,

I like to use this same shield with the Fez Cerbuino Bee and i have been looking to the pen setting.
And they look different between the Fez Domino and the Cerbuino.
Has someone already ported this lib to the Cerbuino and would it be easy to integrate that timer3 lib that someone showed on the forum?

Thanks

please start a new thread with your question.

@ Nicolas3, i tried to use your code only to see that there is an typo in the following quoted code. Sadly i cant get my head around what it should be. I marked the line bold.
Can you please tell me how that line should be?

Thanks