File tree Expand file tree Collapse file tree 4 files changed +84
-0
lines changed Expand file tree Collapse file tree 4 files changed +84
-0
lines changed Original file line number Diff line number Diff line change 30
30
* .exe
31
31
* .out
32
32
* .app
33
+
34
+ # Build SAMD
35
+ * .bin
36
+ * .elf
37
+ * .hex
38
+ * .map
Original file line number Diff line number Diff line change
1
+ /*
2
+ BLE experiments
3
+
4
+ This example:
5
+ - reads the acceleration values from the LSM6DS3 sensor
6
+ - sends the position data to the serial
7
+
8
+ The circuit:
9
+ - Arduino Nano 33 IoT
10
+
11
+ created 7 Nov 2020
12
+ by Olivier Staquet
13
+
14
+ This example code is in the public domain.
15
+ */
16
+
17
+ #include < Arduino_LSM6DS3.h>
18
+
19
+ void setup () {
20
+ // Initialize internal LED (for visual debugging)
21
+ pinMode (LED_BUILTIN, OUTPUT);
22
+ digitalWrite (LED_BUILTIN, LOW);
23
+
24
+ // Initialize Serial connection
25
+ Serial.begin (115200 );
26
+ // while(!Serial.available()) {
27
+ // digitalWrite(LED_BUILTIN, HIGH);
28
+ // delay(500);
29
+ // digitalWrite(LED_BUILTIN, LOW);
30
+ // delay(500);
31
+ // }
32
+
33
+ // Initialize IMU
34
+ if (!IMU.begin ()) {
35
+ // Failed to initialize IMU, blink the internal LED
36
+ while (1 ) {
37
+ digitalWrite (LED_BUILTIN, HIGH);
38
+ delay (100 );
39
+ digitalWrite (LED_BUILTIN, LOW);
40
+ delay (100 );
41
+ }
42
+ }
43
+ }
44
+
45
+ void loop () {
46
+ float x, y, z;
47
+
48
+ // Read gyroscope values
49
+ if (IMU.gyroscopeAvailable ()) {
50
+ IMU.readGyroscope (x, y, z);
51
+ delay (900 );
52
+ digitalWrite (LED_BUILTIN, HIGH);
53
+ delay (100 );
54
+ digitalWrite (LED_BUILTIN, LOW);
55
+ }
56
+
57
+ // Show gyroscope values on serial
58
+ Serial.print (" Position " );
59
+ Serial.print (x);
60
+ Serial.print (" ," );
61
+ Serial.print (y);
62
+ Serial.print (" ," );
63
+ Serial.println (z);
64
+ }
Original file line number Diff line number Diff line change
1
+ {
2
+ "cpu" : {
3
+ "fqbn" : " arduino:samd:nano_33_iot" ,
4
+ "name" : " Arduino NANO 33 IoT" ,
5
+ "port" : " serial:///dev/cu.usbmodem14201"
6
+ }
7
+ }
Original file line number Diff line number Diff line change
1
+ {
2
+ "cpu" : {
3
+ "fqbn" : " arduino:samd:nano_33_iot" ,
4
+ "name" : " Arduino NANO 33 IoT" ,
5
+ "port" : " serial:///dev/cu.usbmodem14201"
6
+ }
7
+ }
You can’t perform that action at this time.
0 commit comments