Commit 0faebeb6 authored by Tomáš Hübelbauer's avatar Tomáš Hübelbauer

Commit the initial version

parents
{
"board": "arduino:avr:pro",
"configuration": "cpu=16MHzatmega328",
"port": "COM8",
"sketch": "index.ino"
}
\ No newline at end of file
{
"configurations": [
{
"name": "Win32",
"includePath": [
"C:\\Users\\Tom\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.6.21\\cores\\arduino"
],
"browse": {
"limitSymbolsToIncludedHeaders": false,
"path": [
"C:\\Users\\Tom\\AppData\\Local\\Arduino15\\packages\\arduino\\hardware\\avr\\1.6.21\\cores\\arduino"
]
},
"intelliSenseMode": "msvc-x64"
}
],
"version": 3
}
\ No newline at end of file
# Carpenter Brut Tee
## Configuring
- Download the [Arduino IDE](https://www.arduino.cc/en/Main/Software) (for desktop)
- Install the Visual Studio Code [Arduino extension](https://github.com/Microsoft/vscode-arduino#installation)
- Use *Arduino: Library Manager* to install `FastLED`
- Use *Arduino: Change Board Type* to select the board used (e.g.: *Arduino Pro or Pro Mini*)
- Use *Arduino: Select Serial Port* to select the correct serial port
## Uploading
- Use *Arduino: Upload*
#include "FastLED.h"
#define LED_COUNT 90
#define COLOR_COUNT 4
volatile unsigned long ledIndex = 0;
volatile unsigned long colorIndex = 0;
CRGB leds[LED_COUNT];
void setup() {
FastLED.addLeds<WS2812B, 7, GRB>(leds, LED_COUNT);
FastLED.setBrightness(200);
}
void loop() {
switch (colorIndex) {
case 0: leds[ledIndex] = CRGB::Red; break;
case 1: leds[ledIndex] = CRGB::Orange; break;
case 2: leds[ledIndex] = CRGB::Red; break;
case 3: leds[ledIndex] = CRGB::Yellow; break;
}
if (ledIndex % 3 == 0) {
if (colorIndex == COLOR_COUNT - 1) {
colorIndex = 0;
} else {
colorIndex++;
}
}
if (ledIndex == LED_COUNT - 1) {
ledIndex = 0;
} else {
ledIndex++;
}
FastLED.show();
delay(10);
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment