| View previous topic :: View next topic | 
	
	
		| Author | Message | 
	
		| agross 
 
 
 Joined: 15 Apr 2012
 Posts: 5
 
 
 
			    
 
 | 
			
				| CCS compiler easy answer I think... |  
				|  Posted: Sun Apr 15, 2012 2:01 pm |   |  
				| 
 |  
				| 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
 
 
 
			    
 
 | 
			
				|  |  
				|  Posted: Sun Apr 15, 2012 2:03 pm |   |  
				| 
 |  
				| 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
 
 
 
			    
 
 | 
			
				|  |  
				|  Posted: Sun Apr 15, 2012 2:10 pm |   |  
				| 
 |  
				| 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: 1401
 
 
 
			    
 
 | 
			
				|  |  
				|  Posted: Sun Apr 15, 2012 2:17 pm |   |  
				| 
 |  
				| 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
 
 
 
			    
 
 | 
			
				|  |  
				|  Posted: Sun Apr 15, 2012 2:23 pm |   |  
				| 
 |  
				| 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
 
 
 
			    
 
 | 
			
				|  |  
				|  Posted: Sun Apr 15, 2012 2:44 pm |   |  
				| 
 |  
				|  	  | 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
  |  | 
	
		|  | 
	
		| Ttelmah 
 
 
 Joined: 11 Mar 2010
 Posts: 19967
 
 
 
			    
 
 | 
			
				|  |  
				|  Posted: Mon Apr 16, 2012 2:40 am |   |  
				| 
 |  
				|  	  | 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
 |  | 
	
		|  | 
	
		|  |