Help CenterHelp Center
Play tones from speaker on EV3 brick
playTone(myev3)
playTone(myev3,freq,duration,volume)
example
playTone(myev3) plays a 500 Hz tone for 1 second at volume level 10 on the speaker that is located on the EV3 brick.
myev3
playTone(myev3,freq,duration,volume) plays a tone with a specific frequency, duration, and volume.
freq
duration
volume
collapse all
Play a tone, and then a short melody.
Create a connection to the EV3 brick called myev3.
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.
Connection to EV3 brick, specified as a string that represents the object created using legoev3.
legoev3
Example: myev3
Data Types: char
char
500
250
10000
The frequency of the tone in Hertz, specified as a double.
Example: 500
Data Types: double
double
0
30
The duration of the tone in seconds, specified as a double.
Example: 1
1
10
100
The relative volume of the tone, specified as a double.
Example: 50
50
legoev3 | beep
beep
You clicked a link that corresponds to this MATLAB command:
Run the command by entering it in the MATLAB Command Window. Web browsers do not support MATLAB commands.
Select a Web Site
Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .
You can also select a web site from the following list:
Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.
Contact your local office