This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

error c141

Hello. I am interfacing a 4x3 keypad with my 8-51 microcontroller. But i keep getting an this error:

temp.c(53): error C141: syntax error near '='
temp.c(55): error C141: syntax error near '='

Here's the code: Please help

#include <reg51.h>

sbit R1 = P1^0; sbit R2 = P1^1; sbit R3 = P1^2; sbit R4 = P1^3; sbit C1 = P1^4; sbit C2 = P1^5; sbit C3 = P1^6;

void main (void)
{ R1=1; R2=0; R3=0; R4=0; if (C1==1) {P0^0 = 1;} if (C2==1) {P0^1 = 1;} if (C3==1) {P0^2 = 1;}

R1=0; R2=1; R3=0; R4=0; if (C1==1) {P0^3 = 1;} if (C2==1) {P0^4 = 1;} if (C3==1) {P0^5 = 1;}

R1=0; R2=0; R3=1; R4=0; if (C1==1) {P0^6 = 1;} if (C2==1) {P0^7 = 1;} if (C3==1) {P2^0 = 1;}

R1=0; R2=0; R3=0; R4=1; if (C1==1) {P2^1 = 1;} if (C2==1) {P2^2 = 1;} if (C3==1) {P2^3 = 1;}
}

0