Neopixel: Difference between revisions

From Technologia Incognita
Jump to navigation Jump to search
Einstein (talk | contribs)
No edit summary
Einstein (talk | contribs)
Line 35: Line 35:
*** Using rgbcolors.h instead of rgb values in code
*** Using rgbcolors.h instead of rgb values in code


*** Simple on/off in one color
*** Simple on in one color
 
 
 
#include <Adafruit_NeoPixel.h>
 
#define PIN 6
#define NUM_LIGHTS  4
 
Adafruit_NeoPixel strip = Adafruit_NeoPixel(NUM_LIGHTS, PIN, NEO_GRB + NEO_KHZ800);
 
void setup() {
  strip.begin();
  strip.show(); // Initialize all pixels to 'off'
}
 
void loop() {
  allon();
}
void allon() {
 
    uint32_t low = strip.Color(0, 0, 0);
    uint32_t high = strip.Color(255,255,255);
 
    // Turn them off
    for( int i = 0; i<NUM_LIGHTS; i++){
        strip.setPixelColor(i, low);
        strip.show();
    } 
}
 
 
 
*** Simple blink in one color
*** Simple blink in one color


== STM ==
== STM ==

Revision as of 14:04, 17 September 2013

Projects
Participants Einstein
Skills Basic electronics, Programming, Arduino
Status Active
Niche Electronics
Purpose Fun

Welcome to our Neopixel wiki by Einstein

What do we use for this project

  • Neopixel Ledstrip WS2812 60leds/mtr
  • Controlerboard
    • Arduino (using Arduino Ethernet for this project)
    • STM

Other stuff you might need

  • Networkcable
  • USB cable
  • Powersupply

Control

Arduino

  • Connecting
    • PIN 6
      • Simple on in one color


  1. include <Adafruit_NeoPixel.h>
  1. define PIN 6
  2. define NUM_LIGHTS 4

Adafruit_NeoPixel strip = Adafruit_NeoPixel(NUM_LIGHTS, PIN, NEO_GRB + NEO_KHZ800);

void setup() {

 strip.begin();
 strip.show(); // Initialize all pixels to 'off'

}

void loop() {

 allon();

}

void allon() {

   uint32_t low = strip.Color(0, 0, 0); 
   uint32_t high = strip.Color(255,255,255);
 
   // Turn them off
   for( int i = 0; i<NUM_LIGHTS; i++){
       strip.setPixelColor(i, low);
       strip.show();
   }   

}


      • Simple blink in one color

STM

  • Connecting
    • PIN 1


What todo with your LED strip

  • Building your own OHM2013 lantern