I’m currently trying to switch a 5v relay with a Sharp IR sensor. The problem is that I keep getting an error message when I try to upload the code. Any help on this would be greatful. Below is the error message I keep getting.
Arduino: 1.8.5 (Mac OS X), Board: "Arduino/Genuino Uno"
In file included from /Users/liammadden/Documents/Arduino/Sharp IR and relay/sharp_IR_and_relay_1/sharp_IR_and_relay_1.ino:1:0:
/Users/liammadden/Documents/Arduino/libraries/SharpIR/src/SharpIR.h: In function ‘void loop()’:
/Users/liammadden/Documents/Arduino/libraries/SharpIR/src/SharpIR.h:40:13: error: ‘uint8_t SharpIR::distance’ is private
* uint8_t distance;
sharp_IR_and_relay_1:26: error: within this context
__ int dis=SharpIR.distance(); // this returns the distance to the object you’re measuring*__
sharp_IR_and_relay_1:26: error: expression cannot be used as a function
* int dis=SharpIR.distance(); // this returns the distance to the object you’re measuring*
exit status 1
within this context
This report would have more information with
"Show verbose output during compilation"
option enabled in File → Preferences.[/b]
Can anyone point me in the right direction as to what is going on here.