c - error: lvalue required as left operand of assignment, error: void value not ignored as it ought to be -
im getting these errors:
error: lvalue required left operand of assignment error: void value not ignored ought
basically have i2c capacitive touch controller scanning checking scanned data , doing d actions if required repeating.
here code:
#include <avr/io.h> #include <util/delay.h> #include "i2cmaster.h" #define mpr03x 0x4a int main(void) { unsigned char tou; ddra = 0xff; ddrb = 0xff; porta = 0x03; _delay_ms(500); porta = 0x00; i2c_init(); //initialize i2c i2c_start_wait(mpr03x+i2c_write); //set device address , write mode i2c_write(0x44); //write address = 68 i2c_write(0x03); //calibration = on, runmode = 1, enabled = ele0, ele1, ele2 while(1) { porta = 0x01; i2c_start_wait(mpr03x=i2c_write); //set device address , write mode i2c_write(0x00); //write address = 68 i2c_rep_start(mpr03x+i2c_read); // set device address , read mode tou = i2c_readnak; i2c_stop; if(tou == 0x00); //if no pads pressed { porta = 0x00; _delay_ms(1); } else { if(tou == 0x01); //if pad 1 pressed { porta = 0x05; if(tou == 0x02); //if pad 2 pressed { porta = 0x09; if(tou == 0x03); //if pad 3 pressed { porta = 0x11; _delay_ms(1000); } } else { if(tou == 0x02); //if pad 2 pressed { porta = 0x09; if(tou == 0x03); //if pad 3 pressed { porta = 0x11; _delay_ms(1000); } else { if(tou == 0x03);//if pad 3 pressed { porta = 0x11; _delay_ms(1000); } } } } } } }`
any appreciated.
this cause problems:
i2c_start_wait(mpr03x=i2c_write); //set device address , write mode ^
... because mpr03x
not variable.
my assumption back-tick isn't in code on last line, i'll mention anyway.
as else pointed out, i2c_stop;
looks mistake.
Comments
Post a Comment