CCS C Software and Maintenance Offers
FAQFAQ   FAQForum Help   FAQOfficial CCS Support   SearchSearch  RegisterRegister 

ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

CCS does not monitor this forum on a regular basis.

Please do not post bug reports on this forum. Send them to CCS Technical Support

Buzzer interrupt using rs232

 
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion
View previous topic :: View next topic  
Author Message
farizah



Joined: 26 Dec 2009
Posts: 5

View user's profile Send private message

Buzzer interrupt using rs232
PostPosted: Wed Jan 06, 2010 6:36 pm     Reply with quote

Hello, I'm new here and need some help. For example: play the happy birthday on buzzer, hold if there is incoming data sending from rs232, do another .c, then play again the sound. thanks for your help. (I'm using ccs v4.084)
Code:

/////////////////////////////////////////////////////////////////////////
////                          EX_TONES.C                             ////
////                                                                 ////
////  This example plays the song "Happy Birthday."                  ////
////                                                                 ////

c:\program files\picc\examples\ex_tones.c


+++++++++++++++++++++++
Code removed.
Reason: Forum rule #10

10. Don't post the CCS example code or drivers.

-- Forum Moderator
+++++++++++++++++++++++
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Thu Jan 07, 2010 1:16 pm     Reply with quote

You can use getc() to wait for a character to arrive on the RS-232
serial port. Then it will get the character.

This post shows how to do it. In a while(1) loop, getc() is called at
the top of the loop. When it gets a character, it uses a switch-case
statement to detect which character was received. It then takes action
based on the character. In this example, it does SPI actions.
You could substitute code to call the generate_tone() function.
http://www.ccsinfo.com/forum/viewtopic.php?t=39145&start=1

If you have any questions, add them to this thread. Do not post on
the SPI thread.
Display posts from previous:   
Post new topic   Reply to topic    CCS Forum Index -> General CCS C Discussion All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group