APM barometer

We will learn how to compile the example related to the Barometer (MS5611) mounted in Erle-Brain.

Cross-compiling method is recommended, it takes less time compiling the code

Clone the repository

$ git clone https://github.com/erlerobot/ardupilot.git

Enter to the AP_Barometer folder:

$ cd /path_to/ardupilot/libraries/AP_Baro/examples/BARO_generic

Compile the code and copy it into Erle-Brain:

#compile using 4 cores
$ make pxf -j4
#get into /tmp folder tp copy the example
$ cd /tmp/BARO_generic.build
$ scp BARO_generic.elf root@192.168.7.2:~/
# get into Erle-Brain
$ ssh root@192.168.7.2
#Run the example
$ cd ~
$ ./Baro_generic.elf
# You should see...
Barometer library test
Pressure:95541.25 Temperature:35.94 Altitude:-0.01 climb=0.61 t=1155
Pressure:95541.25 Temperature:35.94 Altitude:-0.01 climb=0.61 t=8
Pressure:95541.25 Temperature:35.94 Altitude:-0.01 climb=0.61 t=5
Pressure:95541.25 Temperature:35.94 Altitude:-0.01 climb=0.61 t=5
Pressure:95541.25 Temperature:35.94 Altitude:-0.01 climb=0.61 t=5
not healthy
not healthy
not healthy
not healthy
#press |ctrl| and |c| to end

If you wish to understand how the code works, check the BARO_generic.cpp file.