Tutorials/VEX Speaker module
(Created page with "<yambe:breadcrumb self="NXTBee Programming for ROBOTC">Tutorials|Tutorials</yambe:breadcrumb> <br /> {| width="740px" |- |VEX Speaker...") |
|||
| (6 intermediate revisions by one user not shown) | |||
| Line 1: | Line 1: | ||
| − | <yambe:breadcrumb self=" | + | {{DISPLAYTITLE:{{SUBPAGENAME}}}} |
| + | <yambe:breadcrumb self="VEX Speaker module">Tutorials|Tutorials</yambe:breadcrumb> | ||
<br /> | <br /> | ||
| Line 20: | Line 21: | ||
To help you get started, here are two sample programs to try out your new VEX speaker attachment. | To help you get started, here are two sample programs to try out your new VEX speaker attachment. | ||
|} | |} | ||
| + | <br /> | ||
| + | |||
| + | == Unboxing == | ||
| + | <gallery> | ||
| + | File:Tut-vex-box-1.jpg|VEX Speaker Unboxing | ||
| + | File:Tut-vex-box-2.jpg|VEX Speaker Unboxing | ||
| + | File:Tut-vex-box-3.jpg|VEX Speaker Unboxing | ||
| + | File:Tut-vex-speaker.jpg|Attached to Cortex | ||
| + | </gallery> | ||
<br /> | <br /> | ||
| Line 28: | Line 38: | ||
task main() | task main() | ||
{ | { | ||
| − | //Basic "Play Sound" commands | + | //Basic "Play Sound" commands |
| − | PlaySound(soundBeepBeep); | + | PlaySound(soundBeepBeep); |
| − | wait1Msec(200); | + | wait1Msec(200); |
| − | //Intelligent "Play Sound" command | + | //Intelligent "Play Sound" command |
| − | //Delay until sound is done playing | + | //Delay until sound is done playing |
| − | PlaySound(soundFastUpwardTones); | + | PlaySound(soundFastUpwardTones); |
| − | while(bSoundActive) | + | while(bSoundActive) |
| − | wait1Msec(1); | + | wait1Msec(1); |
| − | //Play a tone: | + | //Play a tone: |
| − | //First Parameter: Frequence in Hz | + | //First Parameter: Frequence in Hz |
| − | //Second Parameter: Length to play in 1/100th of a seconds (50 = .5 seconds) | + | //Second Parameter: Length to play in 1/100th of a seconds (50 = .5 seconds) |
| − | PlayTone(440, 50); | + | PlayTone(440, 50); |
| − | wait1Msec(500); | + | wait1Msec(500); |
| − | //Play a Sound File (need to use the File Management to Upload First) | + | //Play a Sound File (need to use the File Management to Upload First) |
| − | PlaySoundFile("1.wav"); | + | PlaySoundFile("1.wav"); |
| − | wait1Msec(1000); | + | wait1Msec(1000); |
} | } | ||
</syntaxhighlight> | </syntaxhighlight> | ||
| + | <br /> | ||
| + | |||
| + | == Sample Program Downloads == | ||
| + | *[[Media:VEX Songs.c|VEX Songs.c]] | ||
| + | *[[Media:Sound Test.c|Sound Test.c]] | ||
| + | <br /> | ||
| + | |||
| + | == PowerPoint explaining VEX Speaker == | ||
| + | *[[Media:VEX-Sounds.pptx|VEX-Sounds.pptx]] | ||
| + | <br /> | ||
| + | |||
| + | == Sound Files == | ||
| + | *[[Media:Numbers.zip|Numbers.zip]] | ||
| + | *[[Media:Alphabet.zip|Alphabet.zip]] | ||
<br /> | <br /> | ||
Revision as of 08:57, 7 May 2012
| Got a new VEX Speaker?
Wiki Link: VEX2_Functions_Sound To help you get started, here are two sample programs to try out your new VEX speaker attachment. |
Contents |
Unboxing
Example Code
Sound Test:
task main() { //Basic "Play Sound" commands PlaySound(soundBeepBeep); wait1Msec(200); //Intelligent "Play Sound" command //Delay until sound is done playing PlaySound(soundFastUpwardTones); while(bSoundActive) wait1Msec(1); //Play a tone: //First Parameter: Frequence in Hz //Second Parameter: Length to play in 1/100th of a seconds (50 = .5 seconds) PlayTone(440, 50); wait1Msec(500); //Play a Sound File (need to use the File Management to Upload First) PlaySoundFile("1.wav"); wait1Msec(1000); }
Sample Program Downloads
PowerPoint explaining VEX Speaker
Sound Files