AP_Rangefinder: example fix travis warning

missing function declaration
implicit cast
some style fix
This commit is contained in:
Pierre Kancir 2017-04-13 13:33:02 +02:00 committed by Francisco Ferreira
parent 09364085ed
commit 4a2b90b707

View File

@ -5,6 +5,9 @@
#include <AP_HAL/AP_HAL.h> #include <AP_HAL/AP_HAL.h>
#include <AP_RangeFinder/AP_RangeFinder.h> #include <AP_RangeFinder/AP_RangeFinder.h>
void setup();
void loop();
const AP_HAL::HAL& hal = AP_HAL::get_HAL(); const AP_HAL::HAL& hal = AP_HAL::get_HAL();
static AP_SerialManager serial_manager; static AP_SerialManager serial_manager;
@ -17,8 +20,8 @@ void setup()
// setup for analog pin 13 // setup for analog pin 13
AP_Param::set_object_value(&sonar, sonar.var_info, "_TYPE", RangeFinder::RangeFinder_TYPE_PLI2C); AP_Param::set_object_value(&sonar, sonar.var_info, "_TYPE", RangeFinder::RangeFinder_TYPE_PLI2C);
AP_Param::set_object_value(&sonar, sonar.var_info, "_PIN", -1); AP_Param::set_object_value(&sonar, sonar.var_info, "_PIN", -1.0f);
AP_Param::set_object_value(&sonar, sonar.var_info, "_SCALING", 1.0); AP_Param::set_object_value(&sonar, sonar.var_info, "_SCALING", 1.0f);
// initialise sensor, delaying to make debug easier // initialise sensor, delaying to make debug easier
hal.scheduler->delay(2000); hal.scheduler->delay(2000);