Unfamiliar Code

Hi all,

  I've recently received the legacy Ardupilot and am trying to put everything together. I actually bought all the sensors separately (did not purchase the sensor shield from the DIYd store), and have been looking through the code to try to hook it up. Some issues:

A) Cannot find a pin declaration anywhere for reading airspeed data, though I think it should be A3. Am I overlooking some corner of the code? I did find the functions for reading data under the sensors tab.

B) Cannot find anything on the reading of the barometric sensor, period. Where can I find it?

C) More about coding than Ardupilot in particular: I haven't before used sketches with tabs. How does opening one .pde file allow all of them to appear in window? Also (using sensor tab as example), in the read_airspeed function, the main code is surrounded by "#if ... endif#". Why are the pound signs there? C++?

Thank you in advance for your help. :]

You need to be a member of diydrones to add comments!

Join diydrones

Email me when people reply –

Replies

  • A) File: defines.h and line: #define AIRSPEED_PIN 3 // Need to correct value

    B) File: sensors.ino and the function of: void read_airspeed(void), that will be called from Ardupilot.ino function of : void fast_loop() depending on #if AIRSPEED_SENSOR == 1 && GPS_PROTOCOL != 5  directive condition evaluates to a  value of TRUE.

    C) Folder of Ardupilot=Ardupilot.ino (the main file), other C/h/ino files in this folder will be opened as Tabs. The # symbol is for C Macro preprocessor. Try en.wikipedia.org/wiki/C_preprocessor

    Hope it helps.

This reply was deleted.