qub1750ul / Arduino_SharpIR

Arduino library that allows to acquire distance data from Sharp IR sensors
Creative Commons Attribution Share Alike 4.0 International
21 stars 11 forks source link

"Not declared in this scope" error #6

Closed djipco closed 4 years ago

djipco commented 4 years ago

When I try the example, I get this error:

error: 'GP2Y0A21YK0F' is not a member of 'SharpIR'
 SharpIR sensorName(SharpIR::GP2Y0A21YK0F, A0);
                          ^~~~~~~~~~~~
exit status 1
'GP2Y0A21YK0F' is not a member of 'SharpIR'

The problem is with this static member:SharpIR::GP2Y0A21YK0F. If I use an integer instead, it works fine:

SharpIR sensor(1, A0);

Am I doing something wrong?

djipco commented 4 years ago

I just realized I had an old version of the library installed. When I installed the latest version (2.0.1), the problem went away. Sorry for the trouble!