Open3

ATOM Matrix であそんだ記録

コンパイル環境

mac(Mojave)の場合 python2.7をどうしても使うようで
python3をpyenvで切り替えてるからかビルドができなくなっていました。

https://community.m5stack.com/topic/2521/v1-0-6-of-board-manager-not-working-solved/9

https://qiita.com/Nabeshin/items/b429675faa918f12c415#解決方法
$ sudo pip3 install --target /Library/Python/2.7/site-packages pyserial

ATOM Matrix

https://github.com/m5stack/M5Atom
https://docs.m5stack.com/en/core/atom_matrix

fastLEDのサンプルを書き換える

https://github.com/FastLED/FastLED/blob/master/examples/Blink/Blink.ino

推奨の輝度を設定

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);
}
ログインするとコメントできます