Added example, added makefile
This commit is contained in:
14
gy521example.c
Normal file
14
gy521example.c
Normal 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);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user