Yufeng’s Week 5 Homework

Motor Circuit

NeoPixel Circuit

include

define PIN 9

define NUM_LEDS 8

define BRIGHTNESS 50

// Parameter 1 = number of pixels in strip
// Parameter 2 = pin number (most are valid)
// Parameter 3 = pixel type flags, add together as needed:
// NEO_RGB Pixels are wired for RGB bitstream
// NEO_GRB Pixels are wired for GRB bitstream, correct if colors are swapped upon testing
// NEO_RGBW Pixels are wired for RGBW bitstream
// NEO_KHZ400 400 KHz bitstream (e.g. FLORA pixels)
// NEO_KHZ800 800 KHz bitstream (e.g. High Density LED strip), correct for neopixel stick
Adafruit_NeoPixel strip = Adafruit_NeoPixel(NUM_LEDS, PIN, NEO_GRBW + NEO_KHZ800);

void setup() {

strip.setBrightness(BRIGHTNESS);
strip.begin();
strip.show();
}

void loop() {
// Some example procedures showing how to display to the pixels:
// colorWipe(strip.Color(255, 0, 0), 50); // Red
// colorWipe(strip.Color(0, 255, 0), 50); // Green
// colorWipe(strip.Color(0, 0, 255), 50); // Blue
// colorWipe(strip.Color(0, 0, 0, 255), 50); // White
//
// whiteOverRainbow(20,75,5);
//
// pulseWhite(5);
//
// // fullWhite();
// // delay(1000);
//
// rainbowFade2White(3,3,1);
colorSidWipe(strip.Color(255, 81, 0),100);
colorSidWipe(strip.Color(239, 245, 66),100);
colorSidWipe(strip.Color(15, 2, 250),100);
}
void colorSidWipe(uint32_t c, uint8_t wait) {
for(uint16_t i=0; i<strip.numPixels(); i++) {
strip.setPixelColor(i, c);
strip.show();
delay(500);
}
}

Author: yufengyvan

Hi I’m Yufeng or you can call me Yvan. I’m from ShenZhen which is a beautiful modern city in the south of China. My undergrads major was Urban Planning which is considering a larger scale of development and design for the certain area of city. But I’m also interested in making beautiful and functional products as well as the thinking in systematic problem. I’m looking forward to the course for learning all kinds of new making methods with all of you.

Leave a comment

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 )

Google photo

You are commenting using your Google 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 )

Connecting to %s