Description
HEX is a hexagonal RGB LED panel. Total 37 RGB LEDs. With a input port and a output port, you can have mutiple of them in series connection.
This how LEDs layout in the panel. Pay attention to the sequence in your code.
Product Features
- Total LED: 37
- Software development platform: Arduino,UIFlow(Blockly & python)
- Two Lego-compatible holes
Kit includes
- 1x HEX Unit
- 1x Grove Cable
Documents
Neopixel Library on Arduino
Learn
Example
1. Arduino IDE
FastLED library on Arduino presents excellent and colorful lighting effects. Before compile, it is require to install the FastLED library and connect HEX to GROVE A.
To get the complete code, please click here。
/*
Install FastLED library first.(HEX is connected to GROVE A)
*/
#include <M5Stack.h>
#include "FastLED.h"
#define Neopixel_PIN 21
#define NUM_LEDS 37
CRGB leds[NUM_LEDS];
uint8_t gHue = 0;
void setup() {
Serial.begin(115200);
M5.begin();
M5.Lcd.clear(BLACK);
M5.Lcd.setTextColor(YELLOW); M5.Lcd.setTextSize(2); M5.Lcd.setCursor(40, 0);
M5.Lcd.println("HEX Example");
M5.Lcd.setTextColor(WHITE);
M5.Lcd.setCursor(0, 25);
M5.Lcd.println("Display rainbow effect");
// Neopixel initialization
FastLED.addLeds<WS2811,Neopixel_PIN,GRB>/
(leds, NUM_LEDS).setCorrection(TypicalLEDStrip);
FastLED.setBrightness(10);
}
void loop(){
fill_rainbow( leds, NUM_LEDS, gHue, 7);
FastLED.show();// must be executed for neopixel becoming effective
EVERY_N_MILLISECONDS( 20 ) { gHue++; }
}
UIFlow
To get the complete code, please click here.
More information
PinMap
HEX connected to GROVE A
M5Core(GROVE A) | GPIO22 | GPIO21 | 5V | GND |
HEX Unit | / | HEX Pin | 5V | GND |
HEX connected to GROVE B
M5Core(GROVE B) | GPIO36 | GPIO26 | 5V | GND |
HEX Unit | / | HEX Pin | 5V | GND |
HEX connected to GROVE C
M5Core(GROVE C) | GPIO16 | GPIO17 | 5V | GND |
HEX Unit | / | HEX Pin | 5V | GND |