Skip to content

Commit f452899

Browse files
committed
get_distance_top and bottom return a float
1 parent e42e72f commit f452899

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/Arduino_Alvik.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -683,12 +683,12 @@ void Arduino_Alvik::get_distance(float & left, float & center_left, float & cent
683683
xSemaphoreGive(distance_semaphore);
684684
}
685685

686-
void Arduino_Alvik::get_distance_top(float & top, const uint8_t unit){
687-
top = convert_distance(distances[5], MM, unit);
686+
float Arduino_Alvik::get_distance_top(const uint8_t unit){
687+
return convert_distance(distances[5], MM, unit);
688688
}
689689

690-
void Arduino_Alvik::get_distance_bottom(float & bottom, const uint8_t unit){
691-
bottom = convert_distance(distances[6], MM, unit);
690+
float Arduino_Alvik::get_distance_bottom(const uint8_t unit){
691+
return convert_distance(distances[6], MM, unit);
692692
}
693693

694694

src/Arduino_Alvik.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -195,8 +195,8 @@ class Arduino_Alvik{
195195
void get_imu(float & ax, float & ay, float & az, float & gx, float & gy, float & gz);
196196

197197
void get_distance(float & left, float & center_left, float & center, float & center_right, float & right, const uint8_t unit = CM);
198-
void get_distance_top(float & top, const uint8_t unit = CM);
199-
void get_distance_bottom(float & bottom, const uint8_t unit = CM);
198+
float get_distance_top(const uint8_t unit = CM);
199+
float get_distance_bottom(const uint8_t unit = CM);
200200

201201

202202
bool get_touch_any();

0 commit comments

Comments
 (0)