Play tones from speaker on EV3 brick
Play a tone, and then a short melody.
Create a connection to the EV3 brick called
myev3 = legoev3;
Play a tone that uses the default values.
Play a series of tones. Specify the frequencies, duration, and volume of each tone.
playTone(myev3,412.0,0.5,10) pause(0.5) playTone(myev3,550.0,0.75,50) pause(0.75) playTone(myev3,925.0,0.25,10) pause(0.25) playTone(myev3,734.2,0.80,50)
The pauses give each tone time to finish before the next tone starts.
freq— Frequency, in Hertz
The frequency of the tone in Hertz, specified as a double.
duration— Duration, in seconds
The duration of the tone in seconds, specified as a double.
volume— Relative volume
The relative volume of the tone, specified as a double.