Hi,

I am currently working with the 2.048 version of the code, and trying to test and understand how the individual parts (sensors, etc) contribute to the overall working design.  My problem is, this project is my first experience using Arduino--I am accustomed to AVR studio.  While Arduino is pretty easy to get around in, I am not clear on how to use the individual *.pde files.  Do I open them up compile them then upload them to a reset (EEPROM) APM (using ATmega2560)?

PS--AP_pid will not compile alone; here are some of the errors from Arduino:

AP_pid.cpp: In function 'void setup()':
AP_pid:25: error: request for member 'kP' in 'pid', which is of non-class type 'PID ()()'
AP_pid:26: error: request for member 'kI' in 'pid', which is of non-class type 'PID ()()'
AP_pid:27: error: request for member 'kD' in 'pid', which is of non-class type 'PID ()()'
AP_pid:28: error: request for member 'imax' in 'pid', which is of non-class type 'PID ()()'

 

Thanks in advance!

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

Join diydrones

Email me when people reply –

Replies

  • Developer

    Hi Angela,

     

    ***Wow - somehow I missed the whole thread before I wrote this reply.  Well, I'll just leave it rather than delete as maybe it will add a little clarity, or at least not cloud the issue.

     

    The individual .pde files cannot be used individually.  They are just an Arduino way to separate a program into multiple files.  You can sort of think of each .pde file as a pared down .h file and .cpp file squashed into one, although that is a bit of a rough analogy.  Or you could look at it as the compiler simply concatenates all the .pde files together.  They are in no way meant to be compiled separately.

     

    If all you want to do is to test the baro sensor, then you can either compile the full ArduPlane or ArduCopter, set the slide switch to invoke the CLI, go to the test menu, and run the pressure test.  Or, you can compile the baro test program from the baro library test folder (which is in the examples folder of the baro library).  That is a relatively small, single .pde file, but it does still rely on the libraries, including of course the APM_BMP085 library for all the low level interaction with the sensor.

  • if AP_ADC_test compiles then there are no other steps.

    it connects at 115200 and immediately sends the message "ArduPilot Mega ADC library test" then pauses for 1 second before init of the adc

    so you will see "ArduPilot Mega ADC library test" in the arduino serial monitor

    don't forget to select the correct serial port and to upload the program using the upload button :)

    if you have usb driver or upload issues then checkout arduino.cc or their forum

  • compared to avr studio the arduino ide does everything for you

    there is always a master .pde such as arducopter.pde. it has to match the folder name that contains the .pde files

    have you copied over the libraries as per the wiki?

    if so, then you just open the arducopter.pde in arduino ide. it should open all the .pde/h/cpp files in the folder

    then you select the board you are using from the tools menu, plug in usb, select serial port and compile and upload.

    if using a programmer then click the programmer override on the tools menu or read up about how to configure a boards entry to use a programmer.

    when the ide compiles it joins all the .pde files into a single temp .cpp. that's actually what gets compiled. so everything in .pde files can be considered to be a single code file

    every .pde in the sketch folder is automatically included in the compile

This reply was deleted.

Activity