Documentation for using buzzer or jack?

  • Is there any documentation on how to use the buzzer or the 3.5mm jack?

  • Not yet unfortunately. I will add an API for the buzzer in the next SDK release. Until then you can hook directly into the Cypress layer. But you should take advantage of the Mono API layer as soon as we release a new SDK.

    How to buzz

    The buzzer is attached to a hardware PWM, this PWM is shared between the LED display backlights and the buzz speaker. This means they have the same clock frequency - but do not share the same duty cycle. To make a buzzing sound to have to change the duty cycle of the buzzer pwm control. By default it is 0 (off course).

    #include <project.h> // includes the Cypress C APIs
    PWM_WriteCompare2(64); // set the buzzer duty cycle to 1/4
    wait_ms(100);         // busy wait for 100 ms - this is not best practice!
    PWM_WriteCompare2(0);  // turn off the buzzer again

    We will release documentation on the 3.5mm mini jack connector soon.

Log in to reply