File tree Expand file tree Collapse file tree 1 file changed +43
-0
lines changed
examples/Example7_GetVersion Expand file tree Collapse file tree 1 file changed +43
-0
lines changed Original file line number Diff line number Diff line change 1+ #include " SparkFun_Qwiic_OTOS_Arduino_Library.h"
2+ #include " Wire.h"
3+
4+ // Create an OTOS object
5+ QwiicOTOS myOtos;
6+
7+ void setup ()
8+ {
9+ // Start serial
10+ Serial.begin (115200 );
11+ Serial.println (" Qwiic OTOS Example 7 - Get Version" );
12+
13+ Wire.begin ();
14+
15+ // Attempt to begin the sensor
16+ while (myOtos.begin () == false )
17+ {
18+ Serial.println (" OTOS not connected, check your wiring and I2C address!" );
19+ delay (1000 );
20+ }
21+
22+ Serial.println (" OTOS connected!" );
23+
24+ // Get the hardware and firmware version
25+ otos_version_t hwVersion;
26+ otos_version_t fwVersion;
27+ myOtos.getVersionInfo (hwVersion, fwVersion);
28+
29+ // Print the hardware and firmware version
30+ Serial.print (" OTOS Hardware Version: v" );
31+ Serial.print (hwVersion.major );
32+ Serial.print (" ." );
33+ Serial.println (hwVersion.minor );
34+ Serial.print (" OTOS Firmware Version: v" );
35+ Serial.print (fwVersion.major );
36+ Serial.print (" ." );
37+ Serial.println (fwVersion.minor );
38+ }
39+
40+ void loop ()
41+ {
42+ // Nothing to do in this example
43+ }
You can’t perform that action at this time.
0 commit comments