Things used in this project

Hardware components:
Cutout cortado grande
Punch Through LightBlue Bean
×1
1586 00
Adafruit NeoPixel Ring: WS2812 5050 RGB LED
×1
Mfr 25fbf52 2k21 sml
Resistor 2.21k ohm
×1
Mfr 25frf52 10k sml
Resistor 10k ohm
×1
Fairchild semiconductor pn2222abu. image
General Purpose Transistor NPN
×1
Globe Lightshade
×1
Hand tools and fabrication machines:
09507 01
Soldering iron (generic)
Drill
Hy gluegun
Hot glue gun (generic)
Wire Stripper
Knife

Code

Code snippet #1C/C++
#include <Adafruit_NeoPixel.h>
// The pin that is connected to the NeoPixels
#define PIN 5
// The amount of LEDs in the NeoPixels
#define NUMPIXELS 16
// LedReading is the type we get when we call Bean.getLedValues();
// For example, to get the amount of red in the Bean's LED,
// we use ledColor.red to get a value from 0 to 255
LedReading ledColor;
// previousLedColor will be used to check if the LED's color has changed
LedReading previousLedColor;
// Set up the NeoPixel library
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(
  NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);

void setup() {
  pixels.begin();  //  Initialize the NeoPixels
  Bean.enableWakeOnConnect(true);
}

void loop() {
  if(Bean.getConnectionState()) {
    ledColor = Bean.getLed();
    if(ledColor.red != previousLedColor.red ||
      ledColor.green != previousLedColor.green ||
      ledColor.blue != previousLedColor.blue) {
      for(int i = 0; i < NUMPIXELS; i++) {
        pixels.setPixelColor(
          i, pixels.Color(ledColor.red, ledColor.green, ledColor.blue));
        pixels.show();
      }
    previousLedColor = ledColor;
    }
  }
  else {
    Bean.sleep(0xFFFFFFF);
  }
}

Credits

11014907 917762441613247 2463536654633089299 o
Punch Through
16 projects • 37 followers
We’ve been building connected products since 2009. Our diverse team has expertise in every layer from hardware to software to web.
Contact

Replications

Did you replicate this project? Share it!

I made one

Love this project? Think it could be improved? Tell us what you think!

Give feedback

Comments

Add projectSign up / Login