We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent de51d85 commit 9b1df93Copy full SHA for 9b1df93
examples/Basic/Basic.ino
@@ -0,0 +1,23 @@
1
+#include <7semi_ADXL335.h>
2
+
3
+// Connect ADXL335 X/Y/Z outputs to A0, A1, A2
4
+ADXL335_7semi accel;
5
6
+void setup() {
7
+ Serial.begin(115200);
8
+ accel.begin();
9
+ Serial.println(" ADXL335 Accelerometer Reading");
10
+ Serial.println("===========================================");
11
+}
12
13
+void loop() {
14
+ float x, y, z;
15
+ accel.readG(x, y, z);
16
17
+ Serial.print("X: "); Serial.print(x, 2);
18
+ Serial.print("g\tY: "); Serial.print(y, 2);
19
+ Serial.print("g\tZ: "); Serial.print(z, 2);
20
+ Serial.println("g");
21
22
+ delay(500);
23
0 commit comments