😵💫
This commit is contained in:
commit
e842d97a1b
20
.editorconfig
Normal file
20
.editorconfig
Normal file
@ -0,0 +1,20 @@
|
|||||||
|
# EditorConfig is awesome: https://EditorConfig.org
|
||||||
|
root = true
|
||||||
|
|
||||||
|
# for all projects
|
||||||
|
[*]
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 4
|
||||||
|
end_of_line = lf
|
||||||
|
charset = utf-8
|
||||||
|
trim_trailing_whitespace = true
|
||||||
|
insert_final_newline = true
|
||||||
|
|
||||||
|
# C++
|
||||||
|
[{*.cpp,*.ino,*.hpp}]
|
||||||
|
indent_style = space
|
||||||
|
indent_size = 2
|
||||||
|
|
||||||
|
# Markdown
|
||||||
|
[*.md]
|
||||||
|
trim_trailing_whitespace = false
|
1
.gitignore
vendored
Normal file
1
.gitignore
vendored
Normal file
@ -0,0 +1 @@
|
|||||||
|
build/
|
24
LICENSE
Normal file
24
LICENSE
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
This is free and unencumbered software released into the public domain.
|
||||||
|
|
||||||
|
Anyone is free to copy, modify, publish, use, compile, sell, or
|
||||||
|
distribute this software, either in source code form or as a compiled
|
||||||
|
binary, for any purpose, commercial or non-commercial, and by any
|
||||||
|
means.
|
||||||
|
|
||||||
|
In jurisdictions that recognize copyright laws, the author or authors
|
||||||
|
of this software dedicate any and all copyright interest in the
|
||||||
|
software to the public domain. We make this dedication for the benefit
|
||||||
|
of the public at large and to the detriment of our heirs and
|
||||||
|
successors. We intend this dedication to be an overt act of
|
||||||
|
relinquishment in perpetuity of all present and future rights to this
|
||||||
|
software under copyright law.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
||||||
|
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
||||||
|
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
|
||||||
|
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
|
||||||
|
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
|
||||||
|
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
|
||||||
|
OTHER DEALINGS IN THE SOFTWARE.
|
||||||
|
|
||||||
|
For more information, please refer to <http://unlicense.org>
|
13
README.md
Normal file
13
README.md
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
---
|
||||||
|
gitea: none
|
||||||
|
include_toc: true
|
||||||
|
---
|
||||||
|
|
||||||
|
# 💡 LED Panel
|
||||||
|
|
||||||
|
...
|
||||||
|
|
||||||
|
|
||||||
|
## ✨ Requirements
|
||||||
|
|
||||||
|
* 🟡 `Adafruit_NeoPixel` [1.13.0](https://github.com/adafruit/Adafruit_NeoPixel/releases/tag/1.13.0)
|
7
compile.sh
Executable file
7
compile.sh
Executable file
@ -0,0 +1,7 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
BUILD_DIR="./build"
|
||||||
|
BOARD="arduino:avr:uno"
|
||||||
|
PROJECT_PATH="./src/LED_Panel"
|
||||||
|
|
||||||
|
arduino-cli compile --output-dir $BUILD_DIR -b $BOARD $PROJECT_PATH
|
8
src/LED_Panel/.clang-format
Normal file
8
src/LED_Panel/.clang-format
Normal file
@ -0,0 +1,8 @@
|
|||||||
|
Language: Cpp
|
||||||
|
BasedOnStyle: LLVM
|
||||||
|
IndentWidth: 2
|
||||||
|
ColumnLimit: 132
|
||||||
|
SortIncludes: true
|
||||||
|
AlignAfterOpenBracket: DontAlign
|
||||||
|
AllowShortIfStatementsOnASingleLine: AllIfsAndElse
|
||||||
|
AllowShortLoopsOnASingleLine: true
|
25
src/LED_Panel/LED_Panel.ino
Normal file
25
src/LED_Panel/LED_Panel.ino
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
/*
|
||||||
|
Author: Alexander Popov aka iiiypuk aka i3k
|
||||||
|
Repo: https://git.a2s.su/Pix-Backpack/LED-Panel
|
||||||
|
License: Public Domain
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <Adafruit_NeoPixel.h>
|
||||||
|
|
||||||
|
#include "config.hpp"
|
||||||
|
|
||||||
|
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(LED_COUNT, PIN, NEO_GRB + NEO_KHZ800);
|
||||||
|
|
||||||
|
void setup() {
|
||||||
|
pixels.begin();
|
||||||
|
pixels.show(); // disable all LED
|
||||||
|
}
|
||||||
|
|
||||||
|
void loop() {
|
||||||
|
for (int i = 0; i < LED_COUNT - 1; i++) {
|
||||||
|
pixels.setPixelColor(i - 1, pixels.Color(0, 0, 0));
|
||||||
|
pixels.setPixelColor(i, pixels.Color(255, 0, 0));
|
||||||
|
pixels.show();
|
||||||
|
delay(100);
|
||||||
|
}
|
||||||
|
}
|
4
src/LED_Panel/config.hpp
Normal file
4
src/LED_Panel/config.hpp
Normal file
@ -0,0 +1,4 @@
|
|||||||
|
const uint8_t PIN = 6; // DIN PIN
|
||||||
|
const uint8_t WIDTH = 16; // LED matrix width
|
||||||
|
const uint8_t HEIGHT = 20; // LED matrix height
|
||||||
|
const uint16_t LED_COUNT = WIDTH * HEIGHT; // LED count
|
Loading…
x
Reference in New Issue
Block a user