-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
14 changed files
with
220 additions
and
64 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
name: PlatformIO CI | ||
|
||
on: [push] | ||
|
||
jobs: | ||
build-test: | ||
runs-on: ubuntu-22.04 | ||
strategy: | ||
matrix: | ||
example: | ||
- examples/basic | ||
conf: | ||
- esp32-idf4-arduino.ini | ||
- esp32-idf5-idf.ini | ||
- esp32s3-idf4-arduino.ini | ||
- esp32s3-idf5-idf.ini | ||
steps: | ||
- uses: actions/checkout@v3 | ||
- name: Set up Python | ||
uses: actions/setup-python@v4 | ||
- name: Install dependencies | ||
run: | | ||
python3 -m pip install --upgrade pip | ||
python3 -m pip install platformio | ||
- name: Build examples | ||
run: platformio ci --lib="." --project-conf="./test-inis/${{ matrix.conf }}" | ||
env: | ||
PLATFORMIO_CI_SRC: ${{ matrix.example }} |
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,14 @@ | ||
cmake_minimum_required(VERSION 3.0) | ||
|
||
set(SRCS | ||
"src/Color.cpp" | ||
"src/RmtDriver4.cpp" | ||
"src/RmtDriver5.cpp" | ||
"src/SmartLeds.cpp" | ||
) | ||
|
||
idf_component_register( | ||
SRCS ${SRCS} | ||
INCLUDE_DIRS "./src" | ||
REQUIRES driver | ||
) |
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,62 @@ | ||
#ifdef LX16A_ARDUINO | ||
#include <Arduino.h> | ||
#else | ||
#include <freertos/FreeRTOS.h> | ||
#include <freertos/task.h> | ||
static void delay(int ms) { vTaskDelay(pdMS_TO_TICKS(ms)); } | ||
static uint32_t millis() { return xTaskGetTickCount(); } | ||
#endif | ||
|
||
#include <SmartLeds.h> | ||
|
||
const int LED_COUNT = 15; | ||
const int DATA_PIN = 22; | ||
const int CHANNEL = 0; | ||
|
||
// SmartLed -> RMT driver (WS2812/WS2812B/SK6812/WS2813) | ||
SmartLed leds(LED_WS2812B, LED_COUNT, DATA_PIN, CHANNEL, DoubleBuffer); | ||
|
||
const int CLK_PIN = 23; | ||
// APA102 -> SPI driver | ||
//Apa102 leds(LED_COUNT, CLK_PIN, DATA_PIN, DoubleBuffer); | ||
|
||
void setup() {} | ||
|
||
uint8_t hue; | ||
void showGradient() { | ||
hue++; | ||
// Use HSV to create nice gradient | ||
for (int i = 0; i != LED_COUNT; i++) | ||
leds[i] = Hsv { static_cast<uint8_t>(hue + 30 * i), 255, 255 }; | ||
leds.show(); | ||
// Show is asynchronous; if we need to wait for the end of transmission, | ||
// we can use leds.wait(); however we use double buffered mode, so we | ||
// can start drawing right after showing. | ||
} | ||
|
||
void showRgb() { | ||
leds[0] = Rgb { 255, 0, 0 }; | ||
leds[1] = Rgb { 0, 255, 0 }; | ||
leds[2] = Rgb { 0, 0, 255 }; | ||
leds[3] = Rgb { 0, 0, 0 }; | ||
leds[4] = Rgb { 255, 255, 255 }; | ||
leds.show(); | ||
} | ||
|
||
void loop() { | ||
if (millis() % 10000 < 5000) | ||
showGradient(); | ||
else | ||
showRgb(); | ||
delay(50); | ||
} | ||
|
||
#ifndef ARDUINO | ||
extern "C" void app_main() { | ||
setup(); | ||
while (true) { | ||
loop(); | ||
vTaskDelay(0); | ||
} | ||
} | ||
#endif |
This file was deleted.
Oops, something went wrong.
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
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,23 @@ | ||
; PlatformIO Project Configuration File | ||
; | ||
; Build options: build flags, source filter | ||
; Upload options: custom upload port, speed and extra flags | ||
; Library options: dependencies, extra library storages | ||
; Advanced options: extra scripting | ||
; | ||
; Please visit documentation for the other options and examples | ||
; http://docs.platformio.org/page/projectconf.html | ||
|
||
[env:esp32dev] | ||
platform = espressif32@5.3.0 | ||
board = esp32dev | ||
framework = arduino | ||
|
||
upload_speed = 921600 | ||
monitor_speed = 115200 | ||
|
||
build_unflags = -std=gnu++11 | ||
build_flags = | ||
-std=gnu++14 | ||
-fmax-errors=5 | ||
-DLX16A_ARDUINO=1 |
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,22 @@ | ||
; PlatformIO Project Configuration File | ||
; | ||
; Build options: build flags, source filter | ||
; Upload options: custom upload port, speed and extra flags | ||
; Library options: dependencies, extra library storages | ||
; Advanced options: extra scripting | ||
; | ||
; Please visit documentation for the other options and examples | ||
; http://docs.platformio.org/page/projectconf.html | ||
|
||
[env:esp32dev] | ||
platform = espressif32@6.3.2 | ||
board = esp32dev | ||
framework = espidf | ||
|
||
upload_speed = 921600 | ||
monitor_speed = 115200 | ||
|
||
build_unflags = -std=gnu++11 | ||
build_flags = | ||
-std=gnu++14 | ||
-fmax-errors=5 |
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,23 @@ | ||
; PlatformIO Project Configuration File | ||
; | ||
; Build options: build flags, source filter | ||
; Upload options: custom upload port, speed and extra flags | ||
; Library options: dependencies, extra library storages | ||
; Advanced options: extra scripting | ||
; | ||
; Please visit documentation for the other options and examples | ||
; http://docs.platformio.org/page/projectconf.html | ||
|
||
[env:esp32dev] | ||
platform = espressif32@6.3.2 | ||
board = esp32-s3-devkitc-1 | ||
framework = arduino | ||
|
||
upload_speed = 921600 | ||
monitor_speed = 115200 | ||
|
||
build_unflags = -std=gnu++11 | ||
build_flags = | ||
-std=gnu++14 | ||
-fmax-errors=5 | ||
-DLX16A_ARDUINO=1 |
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,22 @@ | ||
; PlatformIO Project Configuration File | ||
; | ||
; Build options: build flags, source filter | ||
; Upload options: custom upload port, speed and extra flags | ||
; Library options: dependencies, extra library storages | ||
; Advanced options: extra scripting | ||
; | ||
; Please visit documentation for the other options and examples | ||
; http://docs.platformio.org/page/projectconf.html | ||
|
||
[env:esp32dev] | ||
platform = espressif32@6.3.2 | ||
board = esp32-s3-devkitc-1 | ||
framework = espidf | ||
|
||
upload_speed = 921600 | ||
monitor_speed = 115200 | ||
|
||
build_unflags = -std=gnu++11 | ||
build_flags = | ||
-std=gnu++14 | ||
-fmax-errors=5 |