I am attempting modify the ardupCopter code and use "analogRead( )" to interpret an external input. However, when compiling I receive the following error: "analogRead was not declared in this scope." I tried to include the Arduino.h file in the library (I am under the assumption that Arduino.h contains the instructions for the analogRead function). Any suggestions on how to include analogRead and other common arduino functions with the arduCopter code? The following is a brief description of what I am trying to accomplish. Any suggestion or different approaches are appreciated.
Currently I have a raspberry pi w/ camera module performing some color and shape recognition. When it detects the desired object, I have the pi output 3.3V at one of its ports. I am trying to connect this port to one of the analog input ports on the APM 2.6. The copter will be flying a predetermine route to scan an area for the object. When the object is detected I am having the high input signal the copter to switch from AUTO to LOITER flight mode.
Any help is greatly appreciated.