- Thu Dec 18, 2014 10:31 pm
#177889
Good day.
I am trying to integrate the code for the ML 8511 into an existing working sketch with a TSl 2561 and printing data out to a 16 x 2 LCD through an I2C controller. I am on Linux and using an Arduino Uno R3.
While trying to integrate the appropriate code from the MP8511 Read Example into my sketch I get the following error:
TSL_2561_MGM_1.ino: In function 'void loop()':
TSL_2561_MGM_1.ino:91:40: error: 'averageAnalogRead' was not declared in this scope
TSL_2561_MGM_1.ino:97:67: error: 'mapfloat' was not declared in this scope
Error compiling.
This occurs after I put the following code into the void loop(void) area of the Arduino sketch.
int uvLevel = averageAnalogRead(UVOUT);
int refLevel = averageAnalogRead(REF_3V3);
//Use the 3.3V power pin as a reference to get a very accurate output value from sensor
float outputVoltage = 3.3 / refLevel * uvLevel;
float uvIntensity = mapfloat(outputVoltage, 0.99, 2.9, 0.0, 15.0);
I think there is a conflict here but I am quite new at this coding and don't know how to error trap this. I will provide any extra information requested in order to solve this.
Thank you
Matadormac
I am trying to integrate the code for the ML 8511 into an existing working sketch with a TSl 2561 and printing data out to a 16 x 2 LCD through an I2C controller. I am on Linux and using an Arduino Uno R3.
While trying to integrate the appropriate code from the MP8511 Read Example into my sketch I get the following error:
TSL_2561_MGM_1.ino: In function 'void loop()':
TSL_2561_MGM_1.ino:91:40: error: 'averageAnalogRead' was not declared in this scope
TSL_2561_MGM_1.ino:97:67: error: 'mapfloat' was not declared in this scope
Error compiling.
This occurs after I put the following code into the void loop(void) area of the Arduino sketch.
int uvLevel = averageAnalogRead(UVOUT);
int refLevel = averageAnalogRead(REF_3V3);
//Use the 3.3V power pin as a reference to get a very accurate output value from sensor
float outputVoltage = 3.3 / refLevel * uvLevel;
float uvIntensity = mapfloat(outputVoltage, 0.99, 2.9, 0.0, 15.0);
I think there is a conflict here but I am quite new at this coding and don't know how to error trap this. I will provide any extra information requested in order to solve this.
Thank you
Matadormac