This commit is contained in:
shrkey
2016-10-09 19:59:24 +01:00
parent 5da6e541cf
commit 3010f2b489
2 changed files with 45 additions and 0 deletions

36
examples/Motor/Motor.cpp Normal file
View File

@@ -0,0 +1,36 @@
/*
Provided to you by Emlid Ltd (c) 2014.
twitter.com/emlidtech || www.emlid.com || info@emlid.com
Example: Read accelerometer, gyroscope and magnetometer values from
MPU9250 inertial measurement unit over SPI on Raspberry Pi + Navio.
Navio's onboard MPU9250 is connected to the SPI bus on Raspberry Pi
and can be read through /dev/spidev0.1
To run this example navigate to the directory containing it and run following commands:
make
./AccelGyroMag
*/
#include "darkwater/DW640.h"
#include "darkwater/Util.h"
#include <stdlib.h>
//=============================================================================
int main()
{
if (check_apm()) {
return 1;
}
//-------------------------------------------------------------------------
DW640 dw;
dw.initialize();
if(dw.testConnection()) {
printf("OK %4.f ", 2000);
} else {
printf("Not Ok %4.f ", 1000);
}
}