-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🎨 (spike): Update lk_touch_sensor_kit
- Loading branch information
Showing
5 changed files
with
153 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,70 @@ | ||
// Leka - LekaOS | ||
// Copyright 2022 APF France handicap | ||
// SPDX-License-Identifier: Apache-2.0 | ||
|
||
#pragma once | ||
|
||
#include "PinNames.h" | ||
|
||
#include "drivers/BufferedSerial.h" | ||
#include "drivers/HighResClock.h" | ||
#include "rtos/ThisThread.h" | ||
|
||
#include "CoreEventFlags.h" | ||
#include "CoreLED.h" | ||
#include "CoreSPI.h" | ||
#include "EventLoopKit.h" | ||
#include "HelloWorld.h" | ||
#include "LedKit.h" | ||
#include "LogKit.h" | ||
|
||
using namespace leka; | ||
using namespace std::chrono; | ||
|
||
namespace leds { | ||
|
||
namespace internal { | ||
|
||
namespace ears { | ||
|
||
auto spi = CoreSPI {LED_EARS_SPI_MOSI, NC, LED_EARS_SPI_SCK}; | ||
constexpr auto size = 2; | ||
|
||
} // namespace ears | ||
|
||
namespace belt { | ||
|
||
auto spi = CoreSPI {LED_BELT_SPI_MOSI, NC, LED_BELT_SPI_SCK}; | ||
constexpr auto size = 20; | ||
|
||
} // namespace belt | ||
|
||
namespace animations { | ||
|
||
auto event_loop = EventLoopKit {}; | ||
|
||
} // namespace animations | ||
|
||
} // namespace internal | ||
|
||
auto ears = CoreLED<internal::ears::size> {internal::ears::spi}; | ||
auto belt = CoreLED<internal::belt::size> {internal::belt::spi}; | ||
|
||
void turnOn() | ||
{ | ||
ears.setColor(RGB::pure_blue); | ||
belt.setColor(RGB::pure_blue); | ||
ears.show(); | ||
belt.show(); | ||
} | ||
void turnOff() | ||
{ | ||
ears.setColor(RGB::black); | ||
belt.setColor(RGB::black); | ||
ears.show(); | ||
belt.show(); | ||
} | ||
|
||
auto ledkit = LedKit {leds::internal::animations::event_loop, leds::ears, leds::belt}; | ||
|
||
} // namespace leds |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters