Hackster is hosting Impact Spotlights: Robotics. Watch the stream live on Thursday!Hackster is hosting Impact Spotlights: Robotics. Stream on Thursday!
Rodney Trusty
Published © GPL3+

Open Hardware Summit Badge 2025

A tutorial for how to assemble your OHS 2025 E-Textile Badge

IntermediateProtip1 hour1,679
Open Hardware Summit Badge 2025

Story

Read more

Code

Example Blinky

C/C++
This sketch blinks the LEDs red, green, and blue. The SAO pins are defined as macros for convenience, You may use this as a base for your own custom blinky and SAO
#include <Adafruit_NeoPixel.h>

// LED setup
#define LED_PIN    D7     // Data pin
#define LED_COUNT  2
#define BRIGHTNESS 100

Adafruit_NeoPixel leds(LED_COUNT, LED_PIN, NEO_GRB + NEO_KHZ800);

// SAO pin macros
#define SAO_PWR     D5
#define SAO_GND     D4
#define SAO_GPIO2   D2
#define SAO_GPIO1   D1

void setup() {
  leds.begin();
  leds.setBrightness(BRIGHTNESS);
  leds.show(); // Clear all LEDs
}

void loop() {
  setAll(255, 0, 0);   // First channel full
  delay(1000);

  setAll(0, 255, 0);   // Second channel full
  delay(1000);

  setAll(0, 0, 255);   // Third channel full
  delay(1000);
}

void setAll(uint8_t a, uint8_t b, uint8_t c) {
  for (int i = 0; i < LED_COUNT; i++) {
    leds.setPixelColor(i, leds.Color(a, b, c));
  }
  leds.show();
}

Credits

Rodney Trusty
2 projects • 12 followers
Anomaly

Comments