Skip to content

Search the documentation

Kit
Firmware

Buzzer

Mini

The robot’s buzzer: it plays songs in the background while your program goes on.

The Buzzer class is reached through this attribute of robot.

Can be None.

All the attributes of robot are in its table. Read Attributes that can be None to see when a part is None.

The text of the song now playing, or None.

current_song: Optional[str]

Read only.

How loud songs play, in percent (0-100).

volume

Read only.

Starts playing a song from SONGS (or your own song text) and returns at once; loop=True repeats it until stop().

play_song(song, loop: bool) -> bool

You can leave out loop.

Used in examples: Jukebox, Mini eyes

Stops the song.

stop()

Used in examples: Jukebox, Mini eyes

Pauses the song; resume() goes on from there.

pause()

Goes on with a song that pause() stopped.

resume()

True while a song is playing.

is_playing() -> bool

Used in examples: Jukebox

Sets how slowly songs play: one beat lasts tempo x max(50, 10 x tempo) ms (3, the default, is 150 ms); higher is slower.

set_tempo(tempo)

Used in examples: Jukebox

Sets how loud songs play, from 0 (silent) to 100 percent (the loudest); the default is about 8.

set_volume(percent)