Added example, added makefile

This commit is contained in:
2016-09-04 20:58:29 +02:00
parent 9b87fcc68c
commit 84d9a3d3a7
3 changed files with 42 additions and 6 deletions

14
gy521example.c Normal file
View File

@@ -0,0 +1,14 @@
#include <stdio.h>
#include <wiringPi.h>
#include "libgy521.h"
int main(void) {
wiringPiSetup();
setupgy521();
while (1) {
printf("AngleX = %f, AngleY = %f, AngleZ = %f\n", getAngleX(), getAngleY(), getAngleZ());
delay(100);
}
}