-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathaccelerometer_test.ino
More file actions
37 lines (24 loc) · 1.31 KB
/
accelerometer_test.ino
File metadata and controls
37 lines (24 loc) · 1.31 KB
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
#include "Accelerometer.h"
Accelerometer acc; // Create object of the Accelerometer class
// SETUP --------------------------------------------------------------------------------------------------------------------
void setup(void) {
Serial.begin(9600); // Begin communication with sensor
acc.setUpAccelerometer(45); // Accelerometer Setup function
}
// LOOP -------------------------------------------------------------------------------------------------------------------
void loop(void) {
// // Test String print for Calibration
// acc.mapXYZ();
// Serial.println(acc.testCreateString());
// // Default Mapping
// acc.mapXYZ(); // Map the raw sensor values
// Serial.println(acc.createString()); // Print string to Serial Monitor
// // Modular Map Examples
// acc.modMapXYZ(0,100,0,100,0,100); // Same as mapXYZ but 6 arguments set the min and max range for mapping x, y, and z respectively
// Serial.println(acc.modCreateString(1,0,1)); // Three arguments in booleans to choose whether to send x,y, and z values (in that order)
// My requirement
acc.modMapXYZ(0, 720, 0, 720, 0, 720);
Serial.println(acc.modCreateString(1,0,1));
// Delay in milliseconds
delay(acc.getLatency()); // Latency adjustment
}