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 support@ccsinfo.com

Help with Ex_Patg

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



Joined: 18 Aug 2005
Posts: 3

View user's profile Send private message

Help with Ex_Patg
PostPosted: Mon Apr 10, 2006 10:54 am     Reply with quote

I was wonderinf if someone could help me with the first couple of iterations of the for loop in the ex_patg.c example. I am hainvg trouble following the code.

I get that wave_period and counter are both arrays of long's, and wave_period is going to be a constant array and counter will change in the for loop.

port_b_image (from another website) makes the output into an integer. Does it do this for each output? I could not find anything on this in the manual.

For the for loop, I understand that it will increment i as long as it is less that 7 (num_outputs). I get confused once you get to the if statement. For if((++counter[i] == wave_period[i], I think that it will keep incrementing i, which relates to a number in the array, until it equals the i th number in the wave_period array. Can you give me an example of what counter array and i would look like for this loop?? (ie, i = 0, constant [1,0,0,0,0,0,0] port_image = ?, i = 1 constant = [2,0,0,0,0,0,0] port_image = ?, etc)

From what I gather from the bit_test function in the manual, it will check to see if the bit at the specified loaction (i) is a 1 or 0, and returns a true or false. If it is true, bit_clear will make that bit a 0. Else (the bit was a false, it will set it to a 1 (true))

Am I on the right track or am i completly off base.

Sorry for the noobie question.
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