expected unqualified-id before numeric constant

Hi guys,

I got the following errors. I’m not sure how to proceed as I’m a beginner. If someone can suggest, it would be of great help?

ERROR:

In file included from sketch_mar15a.ino:2:0:
C:\Users\susmitha\Documents\arduino-1.5.8\libraries\BH1750FVI/BH1750FVI.h:35:15: error: expected unqualified-id before numeric constant
#define reset 0x07
^
C:\Users\susmitha\Documents\arduino-1.5.8\libraries\FreeSixIMU/FIMU_ITG3200.h:170:8: note: in expansion of macro ‘reset’
void reset(); // after reset all registers have default values
^

AND HERE IS THE CODE I’M USING

#include<Wire.h>
#include<BH1750FVI.h>
#include <FreeSixIMU.h>
#include <FIMU_ADXL345.h>
#include <FIMU_ITG3200.h>

BH1750FVI LightSensor1;
BH1750FVI LightSensor2;

int i,p, lux1, lux2;
int maxlux[14], angle[14];
int shelfposition,currentlux;

int max_lux=0,optimum_angle;

int tilt_s1 = 2;
int tilt_s2 = 3;

float angles[3]; // yaw pitch roll

// Set the FreeSixIMU object
FreeSixIMU sixDOF = FreeSixIMU();

void setup() {
// put your setup code here, to run once:
Serial.begin(9600);

Wire.begin();
delay(5);
sixDOF.init(); //begin the IMU

LightSensor1.begin();
LightSensor1.SetAddress(Device_Address_L);//Address 0x23
LightSensor1.SetMode(Continuous_H_resolution_Mode);

LightSensor2.begin();
LightSensor2.SetAddress(Device_Address_H);
LightSensor2.SetMode(Continuous_H_resolution_Mode);

Serial.println(“light sensed…”);

pinMode(tilt_s1, INPUT);
pinMode(tilt_s2, INPUT);

}

void loop() {
// put your main code here, to run repeatedly:

for(i=1;i<=15;i++)
{
currentlux=readlux();
shelfposition=getTiltPosition();

maxlux*=currentlux;*
_ angle*= shelfposition;*_

* if(currentlux>max_lux)
_
{ _
max_lux=currentlux;
optimum_angle=angle;
_ }*_

* turn_right();
_ delay(3400);_
motor_stop();
_ Serial.print(“turned”);
}*_

Serial.print(“maximum lux and angle”);
Serial.print(max_lux);
Serial.print(optimum_angle);
Serial.print(maxlux*);*
Serial.print(angle*);*

}
//---------------------------------------------------------------------------------------------------------//
//READING LUMINANCE VALUE
int readlux()
{
uint16_t lux = LightSensor1.GetLightIntensity();// Get Lux value
Serial.print("Light 1: ");
Serial.print(lux);
Serial.println(" lux");
delay(10);
uint16_t lux1 = LightSensor2.GetLightIntensity();// Get Lux value
Serial.print("Light 2: ");
Serial.print(lux1);
Serial.println(" lux");
if(lux1-lux<=30 || lux-lux1<=30)
{
p = min(lux1,lux);
}
else
p=0;
delay(1000);
return p;
}
//------------------------------------------------------------------------------------//
//READING ANGLE VALUE
int getTiltPosition()
{

sixDOF.getEuler(angles);

Serial.print(angles[0]);
*Serial.print(" | "); *
Serial.print(angles[1]);
Serial.print(" | ");
Serial.println(angles[2]);

return angle[0];
* // int s1 = digitalRead(tilt_s1);
//int s2 = digitalRead(tilt_s2);
_ // return (s1 << 1) | s2; //bitwise math to combine the values*
}
//------------------------------------------------------------------------------------//
//MOTOR
void turn_left(){
digitalWrite(3, LOW);
digitalWrite(2, HIGH);
}
void motor_stop(){
digitalWrite(3, LOW);
digitalWrite(2, LOW);
}
void turn_right()
{
digitalWrite(2, HIGH);
digitalWrite(3, LOW);
}_

AND HERE IS THE CODE I’M USING

I am willing to bet that the code you are using does not match that in your post unless the IDE that you are using allows italics.

read this before posting a programming questionNote the advice about the need to use code tags.

Follow UKHeliBob's advice and please use the code tags like I did below.

You'll need to dig through one of the libraries and change one of the reset instances. It appears the easiest to replace is the define. Open this file: C:\Users\susmitha\Documents\arduino-1.5.8\libraries\BH1750FVI/BH1750FVI.h and replace the define with another name, like this:

// change this
#define reset 0x07
// to this
#define BHreset 0x07

Then go through the BH1750FVI library code and correct any errors generated when the BH1750FVI library refers to reset, and change it to BHreset.

Hello and welcome,

Try use this library instead: https://github.com/claws/BH1750

The one that you use was made by someone who didn't respect the naming convention for #define macros (which is your problem, it's conflicting with a function, also named 'reset')