Created
February 13, 2018 09:50
-
-
Save limtbk/17187f0ab19227724ef94fa65f2ed015 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <Adafruit_NeoPixel.h> | |
const int LED_PIN = 2; //D4 | |
// 0 - D3 | |
// 1 - TX | |
// 2 - D4 LED | |
// 3 - RX | |
// 4 - D2 | |
// 5 - D1 | |
// 6 - halt | |
// 7 - halt | |
// 8 - halt | |
// 9 - halt | |
// 10 - SK | |
// 11 - halt | |
// 12 - D6 | |
// 13 - D7 | |
// 14 - D5 | |
// 15 - D8 | |
// 16 - D0 | |
#define P_WIDTH 32 | |
#define P_HEIGHT 8 | |
#define P_TOTAL (P_WIDTH*P_HEIGHT) | |
#define PIN 14 | |
#define NUMPIXELS P_TOTAL | |
const uint16_t PixelCount = NUMPIXELS; | |
const uint8_t PixelPin = PIN; | |
#define colorSaturation 2 | |
Adafruit_NeoPixel pixels = Adafruit_NeoPixel(NUMPIXELS, PIN, NEO_GRB + NEO_KHZ800); | |
int k = 0; | |
void setup() { | |
pinMode(LED_PIN, OUTPUT); | |
pixels.begin(); | |
for (int i = 0; i < PixelCount; i++) { | |
pixels.setPixelColor(i, pixels.Color(0,0,0)); | |
} | |
pixels.show(); | |
k = 0; | |
} | |
void loop() { | |
digitalWrite(LED_PIN, LOW); | |
for (int i = 0; i < PixelCount; i++) { | |
pixels.setPixelColor(i, pixels.Color((k+i)&0xff,(k+i)&0xff,(k+i)&0xff)); | |
} | |
pixels.show(); | |
k++; | |
digitalWrite(LED_PIN, HIGH); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment