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

Random.

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



Joined: 14 Apr 2008
Posts: 2

View user's profile Send private message

Random.
PostPosted: Mon Apr 14, 2008 8:09 pm     Reply with quote

Hi guys.

I am having difficulty trying to randomly select 3 function in any sequence, i have had a look at the post:

http://www.ccsinfo.com/forum/viewtopic.php?t=33663&highlight=rand

Functions are: one();
two();
three();

I have also got 4 leds which i want to randomly flash is there any way of achieving this?

Regards,

Pete.
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Tue Apr 15, 2008 4:20 pm     Reply with quote

Look at the sample code in this thread. It shows how to use some if()
statements to check if the random number is in a certain range. If it is,
then a specified function is called. If it's within a different range, then
a different function is called. Etc.
http://www.ccsinfo.com/forum/viewtopic.php?t=34212
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