Open3
ATOM Matrix であそんだ記録
コンパイル環境
mac(Mojave)の場合 python2.7をどうしても使うようで
python3をpyenvで切り替えてるからかビルドができなくなっていました。
$ sudo pip3 install --target /Library/Python/2.7/site-packages pyserial
ATOM Matrix
fastLEDのサンプルを書き換える
推奨の輝度を設定
Note: When using FastLED lib, the recommended brightness of RGB LED is 20. Please do not set it to a high brightness value to avoid damage to the LED and acrylic screen. (In ATOM lib, we have mapped its appropriate brightness range to 0~100)
FastLED.setBrightness(20);
DATA_PIN
//#define DATA_PIN 3
#define DATA_PIN 27
NUM_LEDS
LEDの数 5x5 = 25
//#define NUM_LEDS 1
#define NUM_LEDS 25
FastLED.addLeds
//FastLED.addLeds<NEOPIXEL, DATA_PIN>(leds, NUM_LEDS);
FastLED.addLeds<WS2812, DATA_PIN, GRB>(leds, NUM_LEDS);
結果
#include <FastLED.h>
// How many leds in your strip?
//#define NUM_LEDS 1
#define NUM_LEDS 25
// For led chips like WS2812, which have a data line, ground, and power, you just
// need to define DATA_PIN. For led chipsets that are SPI based (four wires - data, clock,
// ground, and power), like the LPD8806 define both DATA_PIN and CLOCK_PIN
// Clock pin only needed for SPI based chipsets when not using hardware SPI
//#define DATA_PIN 3
#define DATA_PIN 27
//#define CLOCK_PIN 13
// Define the array of leds
CRGB leds[NUM_LEDS];
void setup() {
// Uncomment/edit one of the following lines for your leds arrangement.
// ## Clockless types ##
FastLED.addLeds<WS2812, DATA_PIN, GRB>(leds, NUM_LEDS); // GRB ordering is typical
FastLED.setBrightness(20);
}
void loop() {
// Turn the LED on, then pause
leds[0] = CRGB::Red;
FastLED.show();
delay(500);
// Now turn the LED off, then pause
leds[0] = CRGB::Black;
FastLED.show();
delay(500);
}
ColorPalette
以下に書き換え
#define LED_PIN 27
#define NUM_LEDS 25
#define BRIGHTNESS 20
#define LED_TYPE WS2812
DemoReel100
キラキラ感あってかっこいい。
定数が上部に固まってて編集しやすい
NoisePlayground
キラキラ感あってかっこいい。
メソッドの中にパラメータが埋まってる。