Skip to main content

Buzzer Pattern

This block is used to play sound patterns on the buzzer.

Beep Block

You can specify the frequency in the block settings.

Beep Block
  • Patterns are defined as strings with specific characters:

    • -: buzzer is off
    • B or b: buzzer is on
    • ~: creates a looped pattern (can be placed anywhere in the string)
    • *: doubles the speed (can be placed anywhere, and used twice for 4x speed)
  • Maximum pattern length is 16 "steps"

  • When calling the method, you must specify whether the new pattern can interrupt an existing pattern:

    • 0 (PL_BEEP_NOINT): cannot interrupt
    • 1 (PL_BEEP_CANINT): can interrupt

For example, a pattern like "B-B-" would turn the buzzer on, then off, then on, then off. Adding a ~ would make this pattern loop continuously, and adding * would make it play twice as fast.