Examples

Basic Setup

The simplest NeoRing sketch:

#include <RobotechPixel.h>

RobotechPixel px(BOARD_NEORING, 1, 7);

void setup() {
  px.begin();
  px.setBrightness(150);
}

void loop() {
  fxRainbowWheel(px, millis());
  px.show();
}

Multi-Board Setup

Using 3 daisy-chained NeoRings:

#include <RobotechPixel.h>

#define DATA_PIN    7
#define NUM_BOARDS  3
#define MAX_BRIGHTNESS 150

RobotechPixel px(BOARD_NEORING, NUM_BOARDS, DATA_PIN);

void setup() {
  Serial.begin(115200);
  randomSeed(analogRead(A0));
  px.begin();
  px.setBrightness(MAX_BRIGHTNESS);
}

void loop() {
  unsigned long now = millis();
  fxComets(px, now);
  px.show();
}

Effect Switching via Serial

Control effects from the Serial Monitor:

#include <RobotechPixel.h>
#include <NeoRingEffects.h>

RobotechPixel px(BOARD_NEORING, 1, 7);
char currentEffect = 'a';  // Start with auto-cycle

void setup() {
  Serial.begin(115200);
  px.begin();
  px.setBrightness(150);
  Serial.println("Send a-z for effects, 0 for OFF");
}

void loop() {
  if (Serial.available()) {
    currentEffect = Serial.read();
  }

  unsigned long now = millis();

  switch (currentEffect) {
    case 'a': fxAutoCycle(px, now); break;
    case 'b': fxPixelWalk(px, now); break;
    case 'c': fxRadarSweep(px, now); break;
    case 'd': fxDualSpin(px, now); break;
    case 'e': fxComets(px, now); break;
    // ... add more as needed
    case '0': px.clear(); break;
  }

  px.show();
}

Custom Colors

Using the color helper and individual LED control:

#include <RobotechPixel.h>

RobotechPixel px(BOARD_NEORING, 1, 7);

void setup() {
  px.begin();
  px.setBrightness(150);

  // Set inner ring to red gradient
  for (int i = 0; i < 48; i++) {
    uint8_t brightness = (i * 255) / 48;
    px.setRingLed(0, 0, i, px.color(brightness, 0, 0));
  }

  // Set outer ring to blue gradient
  for (int i = 0; i < 48; i++) {
    uint8_t brightness = (i * 255) / 48;
    px.setRingLed(0, 1, i, px.color(0, 0, brightness));
  }

  px.show();
}

void loop() {
  // Static display — nothing to update
}