CAS cheat sheet

SandBox online arduino tool:
sand box online arduino emulator
 

Neo Pixel example

Neo Pixel Library from git hub. Click on the download zip button on the right.

#include <Adafruit_NeoPixel.h>

#define PIN            6
#define NUMPIXELS      12

Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800);

int delayval = 200; 

void setup() {
  pixels.begin(); 
}

void loop() {
  
  int activeLed = 0;
  
  pixelOn( activeLed, 100, 0, 0 ); 
  delay(20);
  pixelOff(activeLed);
  delay(20);
}

void pixelOn(int index, int r, int g, int b){
  pixels.setPixelColor( index, pixels.Color( r, g, b) ); 
  pixels.show(); 
}

void pixelOff( int index ){
  pixels.setPixelColor(index, pixels.Color(0,0,0));
  pixels.show(); 
}

Advertisements
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s