Cleanup
This commit is contained in:
@@ -9,7 +9,7 @@ This library depends on the wiringPi library. Make sure to install it first (`su
|
|||||||
4. have fun :)
|
4. have fun :)
|
||||||
|
|
||||||
## Including the library
|
## Including the library
|
||||||
After you have compiled and copied the library properly just include it (`#include <libgy521.h>`) and compile with the flag `lgy521`.
|
After you have compiled and copied the library properly just include it (`#include <libgy521.h>`) and compile with the flag `-lgy521`.
|
||||||
|
|
||||||
## Documentation
|
## Documentation
|
||||||
[MPU-6050 Datasheet](https://www.olimex.com/Products/Modules/Sensors/MOD-MPU6050/resources/RM-MPU-60xxA_rev_4.pdf)
|
[MPU-6050 Datasheet](https://www.olimex.com/Products/Modules/Sensors/MOD-MPU6050/resources/RM-MPU-60xxA_rev_4.pdf)
|
||||||
|
11
libgy521.c
11
libgy521.c
@@ -1,4 +1,3 @@
|
|||||||
//#include <wiringPi.h>
|
|
||||||
#include <wiringPiI2C.h>
|
#include <wiringPiI2C.h>
|
||||||
#include <math.h>
|
#include <math.h>
|
||||||
#include <stdio.h>
|
#include <stdio.h>
|
||||||
@@ -6,9 +5,7 @@
|
|||||||
#include "libgy521.h"
|
#include "libgy521.h"
|
||||||
|
|
||||||
//Constants
|
//Constants
|
||||||
|
#define MPU6050_I2C_ADDRESS 0x68 //I2C
|
||||||
#define MPU6050_I2C_ADDRESS 0x68 //I2C
|
|
||||||
|
|
||||||
#define GRAVITIY_MS2 9.80665
|
#define GRAVITIY_MS2 9.80665
|
||||||
|
|
||||||
// Scale Modifiers
|
// Scale Modifiers
|
||||||
@@ -95,12 +92,6 @@ int read_i2c_word_combined(int reg) {
|
|||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
float getTemp(void) {
|
float getTemp(void) {
|
||||||
/**
|
/**
|
||||||
|
Reference in New Issue
Block a user