10/11 Class Notes

Sewable Neopixels

Neopixel Programming:

Include Library
#include <Adafruit_NeoPixel.h>

Declare Variables
Adafruit_NeoPixel strip = Adafruit_NeoPixel(number of pixels, pin number on board, NEO_GRB + NEO_KHZ800);

Setup
strip.begin();
strip.show(); // Initialize all pixels to ‘off’

Loop
setPixelColor(pixel number, R, G, B); //sets a certain pixel number to a defined color, RGB
setBrightness(value); //sets brightness for all pixels

strip.show(); //use this every time you want to refresh the pixels

Working with Data:

Threshold

//if it is dark
if(lightSensorValue < 200) {
//turn LED on
digitalWrite(LEDpin, HIGH);
}
//if it is light
else {
//turn LED off
digitialWrite(LEDpin, LOW);
}

Multiple Thresholds

if (condition) {
do this
} else if (2nd condition) {
do something else
} else {
do the last thing if it’s neither of the above
}

Mapping

map(value, fromLow, from Hight, toLow, toHigh);

Calibration

https://www.arduino.cc/en/Tutorial/Calibration

Constraining

constrain(lightValue, 0, 255);

Smoothing

https://www.arduino.cc/en/Tutorial/Smoothing

http://whisper.iat.sfu.ca/

Homework: Final Project Proposals

You will have about 10 minutes to present your concept. Be clear and concise. Include imagery, sketches, background research, inspiration and possible solutions (technology, materials, techniques). Include a few minutes for Q&A.

Advertisements