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

CCS compiler easy answer I think...

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



Joined: 15 Apr 2012
Posts: 5

View user's profile Send private message

CCS compiler easy answer I think...
PostPosted: Sun Apr 15, 2012 2:01 pm     Reply with quote

I have been getting myself familiarized with the CCS IDE and compiler and was trying to get the basic blink a light project working and for some reason I get the weirdest error when compiling. It indicates there needs to be a closed ")" at the end of "output_low(yellow)" and "output_high(yellow)" but that makes no sense after looking over the documentation and videos. I hate to be posting such a simple question but I don't know what else to try, I've been adding () and {} all over the place hoping to catch this simple mistake but it just makes no sense.
Code:

#include "C:\Documents and Settings\Garry\Desktop\CCS trial\blink_light.h"
#define yellow PIN_J5;


void main(){

 while(TRUE){
   output_high(yellow);
   delay_ms(1000);
   output_low(yellow);
   delay_ms(1000);
   }

}
PCM programmer



Joined: 06 Sep 2003
Posts: 21708

View user's profile Send private message

PostPosted: Sun Apr 15, 2012 2:03 pm     Reply with quote

Look closely at the #define statement. What happens if you put the
defined symbol into the output statements ?
agross



Joined: 15 Apr 2012
Posts: 5

View user's profile Send private message

PostPosted: Sun Apr 15, 2012 2:10 pm     Reply with quote

WHAT?!?!!? ok now I'm lost, got the little bugger to compile but I thought I was assigning "yellow" to J5, what is going on here? Also much thanks for the info but now it leads to more questions. In the examples I've seen they show that the syntax I'm using should be correct to "name" my output pin.
jeremiah



Joined: 20 Jul 2010
Posts: 1321

View user's profile Send private message

PostPosted: Sun Apr 15, 2012 2:17 pm     Reply with quote

Your define syntax is incorrect for what you are trying to do. Remember, EVERYTHING (except for comments) after the word yellow gets put where the word yellow is found. Do the substitution on a piece of paper and see what output_low(yellow); looks like with the substitution.
agross



Joined: 15 Apr 2012
Posts: 5

View user's profile Send private message

PostPosted: Sun Apr 15, 2012 2:23 pm     Reply with quote

I will most certainly be re reading the library files, and give that substitution a run through. So weird when you change compilers (was using mcc18) all the things you used to know are still valid but with a little twist. After I run through the substitution I will then be headed down the rabbit hole to see if I can make my ICD 3 program my board. Thanks for the input, do appreciate it.
dezso



Joined: 04 Mar 2010
Posts: 102

View user's profile Send private message

PostPosted: Sun Apr 15, 2012 2:44 pm     Reply with quote

Code:
#define yellow PIN_J5;
#define yellow PIN_J5

_________________
I'm could be wrong many time's, at least I know what I'm doing Smile
Ttelmah



Joined: 11 Mar 2010
Posts: 19328

View user's profile Send private message

PostPosted: Mon Apr 16, 2012 2:40 am     Reply with quote

agross wrote:
I will most certainly be re reading the library files, and give that substitution a run through. So weird when you change compilers (was using mcc18) all the things you used to know are still valid but with a little twist. After I run through the substitution I will then be headed down the rabbit hole to see if I can make my ICD 3 program my board. Thanks for the input, do appreciate it.


The fault, would give problems with _every_ C compiler in existence.....

Best Wishes
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