-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapplication.cpp
39 lines (36 loc) · 1.37 KB
/
application.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
/*
* application.cpp Created on: 29 Apr 2014
* Copyright (c) 2014 Derek Molloy (www.derekmolloy.ie)
* Made available for the book "Exploring Raspberry Pi"
* See: www.exploringrpi.com
* Licensed under the EUPL V.1.1
*
* This Software is provided to You under the terms of the European
* Union Public License (the "EUPL") version 1.1 as published by the
* European Union. Any use of this Software, other than as authorized
* under this License is strictly prohibited (to the extent such use
* is covered by a right of the copyright holder of this Software).
*
* This Software is provided under the License on an "AS IS" basis and
* without warranties of any kind concerning the Software, including
* without limitation merchantability, fitness for a particular purpose,
* absence of defects or errors, accuracy, and non-infringement of
* intellectual property rights other than copyright. This disclaimer
* of warranty is an essential part of the License and a condition for
* the grant of any rights to this Software.
*
* For more details, see http://www.derekmolloy.ie/
*/
#include <iostream>
#include "ADXL345.h"
#include <unistd.h>
#include <pthread.h>
using namespace std;
using namespace exploringRPi;
int main() {
ADXL345 sensor(1,0x53);
sensor.setResolution(ADXL345::NORMAL);
sensor.setRange(ADXL345::PLUSMINUS_4_G);
sensor.displayPitchAndRoll();
return 0;
}