Go Back   VEX Forum > Community > Technical Discussion

Technical Discussion Open Technical Discussion of the VEX Robotics System.

Reply
 
Thread Tools
  #11  
Old 04-29-2012, 07:04 PM
jpearman's Avatar
jpearman jpearman is offline
Senior Member
VEX # 8888
 
Join Date: Apr 2011
Location: Los Angeles
Posts: 3,302
Images: 2
Re: EasyC 4 sound library for cortex

Quote:
Originally Posted by devinc View Post
I tried your code out today. it worked perfectly. it was really weird hearing super mario and pac man coming out of my robot. I really hope that the speaker is not legal in competition because it got annoying just after a few seconds.
Glad it worked for you, I agree that it can be really annoying, it's not something I'm going to encourage on team 8888's robot but it may be fun for the demonstrations we do at elementary schools.

I'm posting another version with the code cleaned up a bit and some null pointer and invalid parameter checking. There is no change in functionality, I just wanted to clean it up a little (the old versions have been removed). I will also email Intelitek and hopefully they can incorporate some official functions soon, when they do that this code should not be used as it will conflict with their code.

Functions available are as follows, see the source and demo code for explanations.

Code:
void PlayFrequency( int freq, int amplitude, int timems );
void PlayFrequencyWait( int freq, int amplitude, int timems );
void ClearSounds( void );

int  InitChipToneSong( int len );
void DeinitChipToneSong( void );
void StartChipToneSong( int repeat );
void SetNextChipTone( int freq, int amplitude, int timems );
void DebugChipTone( void );

char *PlayRtttl( char *song , int amplitude, int repeat );
Attached Files
File Type: zip sounddemo.zip (109.6 KB, 110 views)
Reply With Quote
  #12  
Old 12-07-2012, 04:02 PM
jpearman's Avatar
jpearman jpearman is offline
Senior Member
VEX # 8888
 
Join Date: Apr 2011
Location: Los Angeles
Posts: 3,302
Images: 2
Re: EasyC 4 sound library for cortex

I'm just bumping this as it has some explanation of the sound library that I wrote back in April. The code attached to Post #11 is the same that Kingof1337 attached to the sticky in the EasyC tech forum
Reply With Quote
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump


All times are GMT -6. The time now is 01:14 AM.


VEX and VEX Robotics are trademarks or service marks of Innovation First International, Inc.
Copyright © 2002-2013. All Rights Reserved. VEX Robotics, Inc. is a subsidiary of Innovation First International, Inc.
All other product names/marks of others are the property of their respective owners.