Skip to content

Commit 1869adb

Browse files
committed
add sketch that need low delays in sending sensor data especially over BLE
1 parent 43a62f6 commit 1869adb

File tree

1 file changed

+34
-0
lines changed

1 file changed

+34
-0
lines changed
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
/*
2+
* Use this sketch if you want to control nicla from
3+
* an external device acting as a host.
4+
* Here, nicla just reacts to external stimuli coming from
5+
* the eslov port or through BLE
6+
*
7+
* NOTE: Remember to choose your Nicla configuration!
8+
* If Nicla is used as a Shield, provide the NICLA_AS_SHIELD parameter.
9+
* If you want to enable just one between I2C and BLE,
10+
* use NICLA_I2C or NICLA_BLE parameters.
11+
*
12+
*/
13+
14+
#include "Arduino.h"
15+
#include "Arduino_BHY2.h"
16+
17+
// Set DEBUG to true in order to enable debug print
18+
#define DEBUG false
19+
20+
void setup()
21+
{
22+
#if DEBUG
23+
Serial.begin(115200);
24+
BHY2.debug(Serial);
25+
#endif
26+
27+
BHY2.begin();
28+
}
29+
30+
void loop()
31+
{
32+
// Update and then sleep only for 1ms
33+
BHY2.update(1);
34+
}

0 commit comments

Comments
 (0)