my program is this:
#include <REGX51.h> #include <math.h>
#define s_pin P2^0; #define w_sensor P2^7; #define red_led P3^0; #define yellow_led P3^1; #define buzr P1^0;
main() { while(1) { if(s_pin==0 & w_sensor==1) { SET yellow_led; CLR red_led; } else if(switch_pin==1) { SET red_led; CLR yellow_led; SET buzr; }
} }
and error are these:
Build target 'Target 1' compiling ff.c... FF.C(14): error C141: syntax error near ';' FF.C(14): error C141: syntax error near '==' FF.C(14): error C141: syntax error near '==' FF.C(14): error C141: syntax error near ')' FF.C(16): error C202: 'SET': undefined identifier FF.C(17): error C202: 'CLR': undefined identifier FF.C(17): error C141: syntax error near 'P3' FF.C(19): error C141: syntax error near 'else' FF.C(19): error C202: 'switch_pin': undefined identifier FF.C(21): error C202: 'SET': undefined identifier FF.C(21): error C141: syntax error near 'P3' FF.C(22): error C202: 'CLR': undefined identifier FF.C(22): error C141: syntax error near 'P3' FF.C(23): error C202: 'SET': undefined identifier FF.C(23): error C141: syntax error near 'P1' Target not created
You are the person who have a C code containing SET and CLR. You should then know why you would use such words in your code. Why don't you tell us why you decided to use SET and CLR?
More convetional developers would often create
#define ON 0 // Assuming LED connected VCC and port pin, so low pin turns on the LED. #define OFF 1 ... my_led = ON;
Thanks a lot brother... I am new to it... and i was so much confused in it..thanks a lot.. All the C202 error are gone..
now i am left with these.....:
Build target 'Target 1' compiling ff.c... FF.C(16): error C141: syntax error near ';' FF.C(16): error C141: syntax error near '==' FF.C(16): error C141: syntax error near '==' FF.C(16): error C141: syntax error near ')' FF.C(18): error C141: syntax error near '=' FF.C(19): error C141: syntax error near '=' FF.C(21): error C141: syntax error near 'else' FF.C(21): error C141: syntax error near ';' FF.C(21): error C141: syntax error near '==' FF.C(21): error C141: syntax error near ')' FF.C(23): error C141: syntax error near '=' FF.C(24): error C141: syntax error near '=' FF.C(25): error C141: syntax error near '=' Target not created
So have you looked at line 16 - or the non-empty line immediately before line 16 - and checked if it fulfills the C syntax rules?
Need your urgent help brother... please get me on this ASAP...
Bro, I told u earlier also... i am new on this... i have checked the line...its fine.. and i dnt know much about that... if you could provide me the running program....plz
No - when the compiler complains then the compiler is correct and that line - or a line above it - is not correct.
But you have never let us see the lines - we have zero knowledge what is line 16.
And you have not made use of the special tags clearly described above the message input box when you posted the source code which means all the text from the source code gets totally different line breaks making it even harder to try to guess what might be line 16.
Hey bro. ow yoo doin.
look bro. u gotta put eyeballs on ur code and tink. tink hard. tink like u got a brain.
SET yellow_led; CLR red_led;
now bro. hint time. wot do compiler think SET and CLR are?
tink man. tink!