Author: Richard
Another Busy day
Today I am continuing the push to get stuff done for Puzzle Break as well as finishing up lighting for an artist. I have designed and milled out these crosses that will get installed into five pieces of small furniture. Originally the artist was going to just install red LEDs, but we decided to go with some WS2812B 5mm RGB LEDs.
We also have people from an arkitechture firm coming in to cut large acrylic blocks and engrave them with the laser cutter.
I am sure more will come up as well… Just another day at the office 🙂
IOT Holiday Lights
#include "application.h" #include "neopixel/neopixel.h" SYSTEM_MODE(AUTOMATIC); // IMPORTANT: Set pixel COUNT, PIN and TYPE #define PIXEL_PIN A5 #define PIXEL_COUNT 11 #define PIXEL_TYPE WS2812B Adafruit_NeoPixel strip = Adafruit_NeoPixel(PIXEL_COUNT, PIXEL_PIN, PIXEL_TYPE); int show = 0; int flash = 0; void setup() { strip.begin(); strip.show(); // Initialize all pixels to 'off' Spark.function("led",ledToggle); } void loop() { switch (show) { case 0: // your hand is nowhere near the sensor off(); break; case 1: // your hand is on the sensor rainbow(30); break; case 2: // your hand is close to the sensor theaterChaseRainbow(700); break; case 3: // your hand is a few inches from the sensor purple(); break; } delay(1); // delay in between reads for stability } int ledToggle(String command) { if (command=="off") { show = 0; return 0; } else if (command=="on"){ show = 1; return 1; } else if (command=="chase"){ show = 2; return 2; } else if (command=="purple"){ show = 3; return 3; } else if (command.indexOf("today") & command.indexOf("wind")){ int firstComma = command.indexOf(','); int secondComma = command.indexOf(',', firstComma + 1 ); purple(); } delay(1); // delay in between reads for stability } void rainbow(uint8_t wait) { uint16_t i, j; for(j=0; j<256; j++) { for(i=0; i<strip.numPixels(); i++) { strip.setPixelColor(i, Wheel(((i * 256 / (strip.numPixels()/3))+j) & 255)); } strip.show(); delay(wait); } //if (flash == 1){ // flash=0; //} else { // flash++; // } } void purple() { uint16_t i; for(i=0; i<strip.numPixels(); i++) { strip.setPixelColor(i, strip.Color(100,0,100)); } strip.show(); } void off() { uint16_t i; for(i=0; i<strip.numPixels(); i++) { strip.setPixelColor(i, strip.Color(0,0,0)); } strip.show(); } //Theatre-style crawling lights with rainbow effect void theaterChaseRainbow(uint8_t wait) { for (int j=0; j < 256; j++) { // cycle all 256 colors in the wheel for (int q=0; q < 2; q++) { for (int i=0; i < strip.numPixels(); i=i+2) { strip.setPixelColor(i+q, Wheel( ((i * 256 / (strip.numPixels()/2))+j) % 255)); //turn every third pixel on } strip.show(); delay(wait); for (int i=0; i < strip.numPixels(); i=i+2) { strip.setPixelColor(i+q, 0); //turn every third pixel off } } } } // Input a value 0 to 255 to get a color value. // The colours are a transition r - g - b - back to r. uint32_t Wheel(byte WheelPos) { if(WheelPos < 85) { return strip.Color(WheelPos * 3, 255 - WheelPos * 3, 0); } else if(WheelPos < 170) { WheelPos -= 85; return strip.Color(255 - WheelPos * 3, 0, WheelPos * 3); } else { WheelPos -= 170; return strip.Color(0, WheelPos * 3, 255 - WheelPos * 3); } }
Weather Cloud Project Update
I have ported the code over to the Particle Photon and am working on some new lighting and sounds to represent data being sent to the device.
Thanks to James Bruce and his How to Build a Cloud Lamp with Sound Reactive Lightning tutorial, I think I have found a cool Thunder animation. Continue reading Weather Cloud Project Update
I made an X-mass scarf today…
With family coming in for Thanksgiving from all over, I wanted to make a holiday scarf that really slapped people in the face with a big sack of JOY! Something not so annoyingly gaudy that I would not go out in public with it, but at the same time visually irresistible.
So the Ultimate Holiday Scarf is born.
This scarf is designed to look like a Christmas tree with all the trimmings. Aside from the glittery tinsel, I added some NeoPixel LEDs from Adafruit to really brighten the mood. Upon startup, the scarf will play a holiday tune to get you going while putting on a colorful LED light show. People love the scarf, then drop their jaws when it is turned on.