Close or Esc Key

Arduino Projects   |   Raspberry Pi   |   Electronic Circuits   |   AVR   |   PIC   |   8051   |   Electronic Projects

operator '==' has no left operand

3 posts / 0 new
Last post
hareesh
hareesh's picture
Offline
Last seen: 3 months 3 hours ago
Joined: 19/03/2018 - 14:05
operator '==' has no left operand

i wrote a peogram for measuring voltage using pic.but copiled that program i got ths error.

 adcValue/=100;
    #if==adcData  \\here am getting that error.
    volt= (((float)adcValue*240.0)/1023.0);
    #else

 

am using ic is dspic30f2010

and the compiler is mplab c30

anyone please help for solving this error.

thanks

 

GANEEV SINGH
GANEEV SINGH's picture
Offline
Last seen: 2 months 1 week ago
Joined: 22/07/2013 - 16:08
HiThe error is correctly

Hi

The error is correctly highlighted by the compiler. This is because if() statement requires a condition to work on and in your case it must be something which when equals to adcData should run the if statement. The error has occured beacuse in above code that something is missing. Perform a dry-run, you will be able to figure it out.

Ashutosh Bhatt
Ashutosh Bhatt's picture
Offline
Last seen: 2 weeks 2 days ago
Joined: 21/12/2010 - 15:59
I think you are not familier

I think you are not familier with basics of C programming!!!!!

if==adcData

this does not have any meaning

it must be

if (x == adcdata)     // x can be any value

if statemet in C programming checks boolean condition as true or false

]]>]]>