Difference between revisions of "Techinc Wheel"
(→Current code) |
m |
||
Line 23: | Line 23: | ||
The wheel is connected to [[Powerbars]] | The wheel is connected to [[Powerbars]] | ||
− | == Code == | + | == Old Code == |
− | Currently the ColorPalette code runs on the Arduino. | + | <s>Currently the ColorPalette code runs on the Arduino.</s> |
− | [https://github.com/techinc/wheel Arduino code] - ''work in progress'' | + | <s>[https://github.com/techinc/wheel Arduino code] - ''work in progress''</s> |
==Things to make and do== | ==Things to make and do== | ||
Line 46: | Line 46: | ||
Soldering: done | Soldering: done | ||
− | ''' | + | '''WS2801 12V magic strip''' |
* 12V | * 12V | ||
* 40 addressable pixels, color profile BRG | * 40 addressable pixels, color profile BRG | ||
Line 79: | Line 79: | ||
== Current code == | == Current code == | ||
− | + | <code> | |
#include <SPI.h> | #include <SPI.h> |
Revision as of 00:55, 26 March 2017
Projects | |
---|---|
Participants | Narya |
Skills | Electronics, Mechanics |
Status | Finished |
Niche | Electronics |
Purpose | Promotion |
Contents
Bringing the wheel to events
If you can't reach Narya or Mariejel, assume a "yes" when you (a techinc member) want to bring the wheel to an event. Please put it back on the wall when the event is over. If the LEDs come loose you can simply put it back with double-sided tape and/or ductape.
Summary
- The wooden techinc wheel has a WS2801 LED strip stuck on the back and is controlled via an Arduino Nano
- The 8 strips consist of 5 pixels each (3 LEDs per pixel). The first "spoke" goes outwards, the second inwards, the third outwards, etc
- The data pin is 12 and the clock pin 11.
- Color order is BRG, which is supported by the FastLED library, but for other libraries you need to put the colors in the right order
Feel free to put your Arduino code on it, add sensors or whatever.
The wheel is connected to Powerbars
Old Code
Currently the ColorPalette code runs on the Arduino.
Arduino code - work in progress
Things to make and do
This project has several parts: backlit the wheel, mount the wheel to the wall or on some stand, and make the wheel control something. It would be nice to be able to unmount the wheel and take it somewhere else, e.g. to display it at events.
Mount
Who: justa, narya, control-k
- Location: on the wall - done
Painting
- NO color painting!
- Scratched parts could eventually be fixed with varnish
Backlit
Who: Narya, Brainsmoke and Mariejel
Soldering: done
WS2801 12V magic strip
- 12V
- 40 addressable pixels, color profile BRG
- Wires: green 12V (not attached), blue clock (pin 11), red data (pin 12), black GND (pin GND)
Color patterns
- Make a few color patterns:
- No rotation: colors of logo
- From center to outside and vice versa (knight rider)
- Rainbow glow
- Rotating colors
- FIRE
- ...
Sensors
- Color sensor to change knight rider color for example
- Distance sensor: change color and/or speed. If hand is within 4cm it can function as a switch (switch between color programs)
Software
- FastLED library http://fastled.io/
- Neopixel library https://github.com/adafruit/Adafruit_NeoPixel
- Adafruit_WS2801 https://github.com/adafruit/Adafruit-WS2801-Library
- FastSPI library https://code.google.com/p/fastspi/
- ShiftPWM http://www.elcojacobs.com/using-shiftpwm-to-control-led-strips-with-arduino/
- Related projects @techinc: LEDLightDistrict, Neopixel
Old
Current code
- include <SPI.h>
void setup() {
SPI.begin(); SPI.setBitOrder(MSBFIRST); SPI.setDataMode(SPI_MODE0); SPI.setClockDivider(SPI_CLOCK_DIV8);
}
uint8_t fade[] = { //[ int(((.5-cos(2*pi*x/240.)*.5)**2.2)*255) for x in range(240) ] 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,3,3,4,4,5,6,7,7,8,9,10,12,13,14,16,17,19,20,22,24,26,28,30,33,35,38,40,43,46,49,52,55,58,62,65,69,72,76,80,84,88,92,96,100,104,108,113,117,121,126,130,135,139,144,148,153,157,162,166,171,175,179,184,188,192,196,200,204,208,211,215,218,222,225,228,231,234,236,239,241,243,245,247,248,250,251,252,253,254,254,254,255,254,254,254,253,252,251,250,248,247,245,243,241,239,236,234,231,228,225,222,218,215,211,208,204,200,196,192,188,184,179,175,171,166,162,157,153,148,144,139,135,130,126,121,117,113,108,104,100,96,92,88,84,80,76,72,69,65,62,58,55,52,49,46,43,40,38,35,33,30,28,26,24,22,20,19,17,16,14,13,12,10,9,8,7,7,6,5,4,4,3,3,2,2,2,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0 };
uint8_t r=0,g=80,b=160;
void loop() {
for(;;) { r+=1;g+=1;b+=1;
for (i=0; i<40; i++) { r+=6;g+=6;b+=6; if (r >= 240) r-= 240; if (g >= 240) g-= 240; if (b >= 240) b-= 240;
SPI.transfer(fade[r]); SPI.transfer(fade[g]); SPI.transfer(fade[b]);
} delay(20); }
}