File tree Expand file tree Collapse file tree 1 file changed +12
-11
lines changed
examples/Example06_DistanceBasicReadings Expand file tree Collapse file tree 1 file changed +12
-11
lines changed Original file line number Diff line number Diff line change @@ -88,13 +88,13 @@ void loop()
8888 radarSensor.getDistanceNumberDistances (numDistances);
8989
9090 if (numDistances == 0 )
91- Serial.println ( " No distance values detected ." );
91+ Serial.print ( " ." );
9292 else
9393 {
94- Serial.print (" Number of Distances Values Detected: " );
94+ Serial.println ();
95+ Serial.print (" Number of Values Detected: " );
9596 Serial.println (numDistances);
9697 }
97- Serial.println ();
9898
9999 uint32_t distance = 0 ;
100100 int32_t distanceStrength = 0 ;
@@ -107,22 +107,24 @@ void loop()
107107 Serial.println ();
108108 continue ;
109109 }
110- Serial.print (" Distance Peak " );
110+ Serial.print (" Distance Peak " );
111111 Serial.print (i);
112112 Serial.print (" : " );
113113 if (distance < 100 )
114114 {
115115 Serial.print (distance);
116- Serial.println (" mm" );
116+ Serial.print (" mm" );
117117 }
118118 else if (distance < 1000 )
119119 {
120120 Serial.print (distance * 0.1 );
121- Serial.println (" cm" );
121+ Serial.print (" cm" );
122122 }
123123 else
124+ {
124125 Serial.print (distance * 0.001 );
125- Serial.println (" m" );
126+ Serial.print (" m" );
127+ }
126128
127129 if (radarSensor.getDistancePeakStrength (i, distanceStrength) != ksfTkErrOk)
128130 {
@@ -131,13 +133,12 @@ void loop()
131133 Serial.println ();
132134 continue ;
133135 }
134- Serial.print (" Distance Peak Strength" );
136+ Serial.print (" Distance Peak Strength " );
135137 Serial.print (i);
136138 Serial.print (" : " );
137139 Serial.println (distanceStrength);
138- Serial.println ();
139140 }
140141
141- // Half a second delay for easier readings
142- delay (500 );
142+ // delay before next reading
143+ delay (2500 );
143144}
You can’t perform that action at this time.
0 commit comments