From 3010f2b489901f4a7ab0f310cad8c3dd9d17d9b3 Mon Sep 17 00:00:00 2001 From: shrkey Date: Sun, 9 Oct 2016 19:59:24 +0100 Subject: [PATCH] testing --- examples/Motor/Makefile | 9 +++++++++ examples/Motor/Motor.cpp | 36 ++++++++++++++++++++++++++++++++++++ 2 files changed, 45 insertions(+) create mode 100644 examples/Motor/Makefile create mode 100644 examples/Motor/Motor.cpp diff --git a/examples/Motor/Makefile b/examples/Motor/Makefile new file mode 100644 index 0000000..9a353c1 --- /dev/null +++ b/examples/Motor/Makefile @@ -0,0 +1,9 @@ +CC = g++ +DW = ../../darkwater +INCLUDES = -I ../.. + +all: + $(CC) $(INCLUDES) Motor.cpp $(DW)/DW640.cpp $(DW)/PCA9685.cpp $(DW)/I2Cdev.cpp $(DW)/gpio.cpp $(DW)/Util.cpp -o Motor + +clean: + rm Motor diff --git a/examples/Motor/Motor.cpp b/examples/Motor/Motor.cpp new file mode 100644 index 0000000..e08d213 --- /dev/null +++ b/examples/Motor/Motor.cpp @@ -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 +//============================================================================= + +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); + } + + }