2323 https://github.com/sparkfun/SparkFun_Qwiic_TMF882X_Arduino_Library
2424
2525 Documentation:
26- https://sparkfun.github.io/SparkFun_Qwiic_OLED_Arduino_Library /
26+ https://sparkfun.github.io/SparkFun_Qwiic_TMF882X_Arduino_Library /
2727
2828 SparkFun code, firmware, and software is released under the MIT License(http://opensource.org/licenses/MIT).
2929*/
@@ -89,7 +89,9 @@ void setup()
8989
9090 // Now set some config parameters to support the spad map
9191 struct tmf882x_mode_app_config tofConfig;
92- if (!myTMF882X.getTMF882XConfig (tofConfig)) {
92+
93+ if (!myTMF882X.getTMF882XConfig (tofConfig))
94+ {
9395 Serial.println (" Error - unable to get device configuration." );
9496 while (1 ){}
9597 }
@@ -98,7 +100,8 @@ void setup()
98100 // - set the reporting period to 500 milliseconds
99101 tofConfig.report_period_ms = 500 ;
100102
101- if (!myTMF882X.setTMF882XConfig (tofConfig)) {
103+ if (!myTMF882X.setTMF882XConfig (tofConfig))
104+ {
102105 Serial.println (" Error - unable to set device configuration." );
103106 while (1 ){}
104107 }
@@ -117,7 +120,7 @@ void loop()
117120 Serial.print (" Result Number: " ); Serial.print (myResults.result_num );
118121 Serial.print (" Number of Results: " ); Serial.println (myResults.num_results );
119122
120- for (uint32_t i = 0 ; i < myResults.num_results ; ++i)
123+ for (int i = 0 ; i < myResults.num_results ; ++i)
121124 {
122125 Serial.print (" conf: " ); Serial.print (myResults.results [i].confidence );
123126 Serial.print (" distance mm: " ); Serial.print (myResults.results [i].distance_mm );
0 commit comments