Skip to content

Commit

Permalink
🎨 (spikes): Update lk_led_kit
Browse files Browse the repository at this point in the history
  • Loading branch information
HPezz committed Mar 3, 2022
1 parent 6d650cb commit 50236d3
Showing 1 changed file with 8 additions and 13 deletions.
21 changes: 8 additions & 13 deletions spikes/lk_led_kit/main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#include "HelloWorld.h"
#include "LedKit.h"
#include "LogKit.h"
#include "Sleeping.h"

using namespace leka;
using namespace std::chrono;
Expand All @@ -26,6 +27,7 @@ auto animation_thread = rtos::Thread {};
auto animation_event_queue = events::EventQueue {};

auto ledkit = LedKit {animation_thread, animation_event_queue, ears, belt};
led::animation::Sleeping animation_sleeping(ears, belt);

auto colors_available = std::to_array({
RGB::pure_green,
Expand All @@ -38,15 +40,6 @@ auto colors_available = std::to_array({

HelloWorld hello;

RGB sick1 = RGB {30, 255, 0};
RGB sick2 = RGB {94, 104, 1};
RGB singing_green = RGB {29, 168, 0};
RGB singing_red = RGB {255, 65, 61};
RGB singing_yellow = RGB {255, 217, 61};
RGB singing_blue = RGB {21, 125, 230};

RGB red_angry = RGB {255, 98, 98};

auto main() -> int
{
logger::init();
Expand All @@ -55,13 +48,15 @@ auto main() -> int

auto start = rtos::Kernel::Clock::now();

rtos::ThisThread::sleep_for(2s);

hello.start();

while (true) {
auto t = rtos::Kernel::Clock::now() - start;
log_info("A message from your board %s --> \"%s\" at %i s\n", MBED_CONF_APP_TARGET_NAME, hello.world,
int(t.count() / 1000));

ledkit.start(animation_sleeping);
rtos::ThisThread::sleep_for(40s);

ledkit.stop();
rtos::ThisThread::sleep_for(1s);
}
}

0 comments on commit 50236d3

Please sign in to comment.