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
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.