how to solve this error pwm.c(76): error: #137: expression must be a modifiable lvalue
17 #define left1 IOPIN0 = (1 << 11)
18 #define right1 IOPIN0 = (1 << 8) . . . 74 if(center)
75 return 0;
76 else if(left1 | right1 ) {... ..
You could start by giving some serious thought to whether it is good idea to use actions (like "write this number to this register"), whose value is a constant, as conditions in an if() clause.
The superficial issue is that your macros lack sufficient parentheses.