Skip to content

Commit

Permalink
AP_Notify: example fix travis warning
Browse files Browse the repository at this point in the history
missing function declaration
implicit cast
some style fix
  • Loading branch information
khancyr authored and OXINARF committed Apr 13, 2017
1 parent 0be0226 commit 2f50e86
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
23 changes: 14 additions & 9 deletions libraries/AP_Notify/examples/ToshibaLED_test/ToshibaLED_test.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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);
}
}
Expand All @@ -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
}
}
}
Expand Down

0 comments on commit 2f50e86

Please sign in to comment.