Browse Source

AP_Notify: example fix travis warning

missing function declaration
implicit cast
some style fix
mission-4.1.18
Pierre Kancir 8 years ago committed by Francisco Ferreira
parent
commit
2f50e865c2
  1. 3
      libraries/AP_Notify/examples/AP_Notify_test/AP_Notify_test.cpp
  2. 23
      libraries/AP_Notify/examples/ToshibaLED_test/ToshibaLED_test.cpp

3
libraries/AP_Notify/examples/AP_Notify_test/AP_Notify_test.cpp

@ -7,6 +7,9 @@ @@ -7,6 +7,9 @@
#include <AP_Notify/AP_Notify.h> // Notify library
#include <AP_Notify/AP_BoardLED.h> // Board LED library
void setup();
void loop();
const AP_HAL::HAL& hal = AP_HAL::get_HAL();
// create board led object

23
libraries/AP_Notify/examples/ToshibaLED_test/ToshibaLED_test.cpp

@ -2,6 +2,11 @@ @@ -2,6 +2,11 @@
#include <AP_Notify/AP_Notify.h>
#include <AP_Notify/ToshibaLED_I2C.h>
void setup();
void loop();
void full_spectrum();
void blink();
const AP_HAL::HAL& hal = AP_HAL::get_HAL();
static ToshibaLED_I2C toshiba_led;
@ -49,10 +54,10 @@ void loop(void) @@ -49,10 +54,10 @@ void loop(void)
void full_spectrum()
{
// go through the full range of colours but only up to the dim light level
for (uint8_t red=0; red<=0x05; red++) {
for (uint8_t green=0; green<=0x05; green++) {
for (uint8_t blue=0; blue<=0x05; blue++) {
toshiba_led.set_rgb(red,green,blue);
for (uint8_t red = 0; red <= 0x05; red++) {
for (uint8_t green = 0; green <= 0x05; green++) {
for (uint8_t blue = 0; blue <= 0x05; blue++) {
toshiba_led.set_rgb(red, green, blue);
hal.scheduler->delay(5);
}
}
@ -65,16 +70,16 @@ void full_spectrum() @@ -65,16 +70,16 @@ void full_spectrum()
void blink()
{
// set colour to red
toshiba_led.set_rgb(LED_DIM,0,0);
toshiba_led.set_rgb(LED_DIM, 0, 0);
// full spectrum test
for (uint8_t c=0; c<=2; c++ ) {
if (c==0) {
toshiba_led.set_rgb(LED_DIM,0,0); // red
if (c == 0) {
toshiba_led.set_rgb(LED_DIM, 0, 0); // red
}else if (c==1) {
toshiba_led.set_rgb(0,LED_DIM,0); // green
toshiba_led.set_rgb(0, LED_DIM, 0); // green
}else{
toshiba_led.set_rgb(0,0,LED_DIM); // blue
toshiba_led.set_rgb(0, 0, LED_DIM); // blue
}
}
}

Loading…
Cancel
Save