Tangible Interactivity

<p>Tangible Interactivity – Spring 2016</p>

LED Arrays – Neopixel FeatherWing

Our new assignment is to make a creative animation with our Neopixel FeatherWing. I hope I’m wrong, but I don’t believe the example files that were uploaded for class were set up properly to take advantage of the RGB to HSB conversion table. I’m completely lost again, and really don’t clearly understand what I’m doing, feeling frustrated and starting to think I need to look at Max if I want to program anything that works in the future.

I wish I could post links of a site that  helped, but I really can’t find videos to help me program the FeatherWing. Really, the main issue is this color conversion code we are using, which I have zero control over after working on for hours. Over it.

Here’s what I’ve cooked up so far:

/*
Control a RGB led with Hue, Saturation and Brightness (HSB / HSV )

Hue is change by an analog input.
Brightness is changed by a fading function.
Saturation stays constant at 255

getRGB() function based on <http://www.codeproject.com/miscctrl/CPicker.asp>
dim_curve idea by Jims

created 05-01-2010 by kasperkamperman.com
*/

/*
dim_curve ‘lookup table’ to compensate for the nonlinearity of human vision.
Used in the getRGB function on saturation and brightness to make ‘dimming’ look more natural.
Exponential function used to create values below :
x from 0 – 255 : y = round(pow( 2.0, x+64/40.0) – 1)
*/

const byte dim_curve[] = {
0, 1, 1, 2, 2, 2, 2, 2, 2, 3, 3, 3, 3, 3, 3, 3,
3, 3, 3, 3, 3, 3, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4,
4, 4, 4, 5, 5, 5, 5, 5, 5, 5, 5, 5, 5, 6, 6, 6,
6, 6, 6, 6, 6, 7, 7, 7, 7, 7, 7, 7, 8, 8, 8, 8,
8, 8, 9, 9, 9, 9, 9, 9, 10, 10, 10, 10, 10, 11, 11, 11,
11, 11, 12, 12, 12, 12, 12, 13, 13, 13, 13, 14, 14, 14, 14, 15,
15, 15, 16, 16, 16, 16, 17, 17, 17, 18, 18, 18, 19, 19, 19, 20,
20, 20, 21, 21, 22, 22, 22, 23, 23, 24, 24, 25, 25, 25, 26, 26,
27, 27, 28, 28, 29, 29, 30, 30, 31, 32, 32, 33, 33, 34, 35, 35,
36, 36, 37, 38, 38, 39, 40, 40, 41, 42, 43, 43, 44, 45, 46, 47,
48, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 61, 62,
63, 64, 65, 66, 68, 69, 70, 71, 73, 74, 75, 76, 78, 79, 81, 82,
83, 85, 86, 88, 90, 91, 93, 94, 96, 98, 99, 101, 103, 105, 107, 109,
110, 112, 114, 116, 118, 121, 123, 125, 127, 129, 132, 134, 136, 139, 141, 144,
146, 149, 151, 154, 157, 159, 162, 165, 168, 171, 174, 177, 180, 183, 186, 190,
193, 196, 200, 203, 207, 211, 214, 218, 222, 226, 230, 234, 238, 242, 248, 255,
};

#include <Adafruit_NeoPixel.h>

Adafruit_NeoPixel pixels = Adafruit_NeoPixel(32, 6, NEO_GRB + NEO_KHZ800);

int rgb_colors[3]; //recieves the results from hsb conversion
int scenelength[3] = {5000, 5000, 1000};
int scene = 1;
byte matrix[8][4] = {
{24, 16, 8, 0}, //board oriented with USB cable at top
{25, 17, 9, 1},
{26, 18, 10, 2},
{27, 19, 11, 3},
{28, 20, 12, 4},
{29, 21, 13, 5},
{30, 22, 14, 6},
{31, 23, 15, 7}
};

byte matrix2[8][4] = {
{24, 16, 8, 0}, //board oriented with USB cable at top
{25, 17, 9, 1},
{26, 18, 10, 2},
{27, 19, 11, 3},
{28, 20, 12, 4},
{29, 21, 13, 5},
{30, 22, 14, 6},
{31, 23, 15, 7}
};

byte C[8][4] = {
{0, 1, 1, 0},
{1, 0, 0, 0},
{1, 0, 0, 0},
{1, 0, 0, 0},
{1, 0, 0, 0},
{1, 0, 0, 0},
{1, 0, 0, 0},
{0, 1, 1, 0}
};

int h, s, b;
byte column = 0;
byte row = 0;
byte offset = 0;
unsigned long lastTime = 0;
unsigned long columnTime = 0;
unsigned long offsetTime = 0;
unsigned long rowTime = 0;
unsigned long currentTime = 0;

void setup() {
pixels.begin();
// s = 250;
// b = 120;
}

void loop() {
currentTime = millis();
pixels.clear();
if (currentTime – lastTime > scenelength[scene – 1]) {
scene++;
lastTime = currentTime;
if (scene > 2) scene = 1;
}

switch (scene) {
case 1:
act1();//do something when var equals 1

break;
case 2:
act2();//do something when var equals 2
break;
// case 3:
// act3();
// break;
default:
// if nothing else matches, do the default
// default is optional
break;
}
pixels.show();
}

void act1() {
for (int i = 0; i < 8; i++) {
pixels.setPixelColor(matrix[i][column], (pixels.Color(rgb_colors[0], rgb_colors[1], rgb_colors[2])));
for (int y = 0; y < 4 ; y++) {
pixels.setPixelColor(matrix[row][y], (pixels.Color(rgb_colors[0], rgb_colors[1], rgb_colors[2])));
h = ((cos((currentTime + i * 200) / 1000.0) + 1.0) * 100.0); // 180 is max to hit full 360 color range.
if (h > 1 && h < 300) {
b = 200;
s = 255;
} else {
b = 50;
s = 255;
}
}
}
if (currentTime – columnTime > 200) {
column++;
if (column > 3)column = 0;
columnTime = currentTime;
}
if (currentTime – rowTime > 50) {
row++;
if (row > 7)row = 0;
rowTime = currentTime;
}
getRGB(h, s, b, rgb_colors); // converts HSB to RGB
}

void act2() {
for (int i = 0; i < 4; i++) {
pixels.setPixelColor(matrix2[row][i], (pixels.Color(rgb_colors[0], rgb_colors[1], rgb_colors[2])));
h = ((sin((currentTime + i * 500) / 100) + 1.0) * 100); //((sin((currentTime + 1 * ??) / strobespeed) +1.0 *
s = 255;
b = 200;
}
if (currentTime – rowTime > 400) {
row++;
if (row > 7)row = 0;
rowTime = currentTime;
}
getRGB(h, s, b, rgb_colors); // converts HSB to RGB
}

void act3() {
for (int x = 0; x < 4; x++) {
for (int y = 0; y < 8; y++) {
if ( C[y][(x + offset) % 4] ) { //keep (x + offset) in bounds of the array
pixels.setPixelColor(matrix[y][x], pixels.Color(200, 0, 100));
}
}
}
if (currentTime – offsetTime > 100) {
offset–;
if (offset < 0)offset = 3;
offsetTime = currentTime;
}
}
void getRGB(int hue, int sat, int val, int colors[3]) {
/* convert hue, saturation and brightness ( HSB/HSV ) to RGB
The dim_curve is used only on brightness/value and on saturation (inverted).
This looks the most natural.
*/
val = dim_curve[val];
sat = 255 – dim_curve[255 – sat];

int r;
int g;
int b;
int base;

hue = hue % 360; //account for hues going over the 360

if (sat == 0) { // Acromatic color (gray). Hue doesn’t mind.
colors[0] = val;
colors[1] = val;
colors[2] = val;
} else {

base = ((255 – sat) * val) >> 8;

switch (hue / 60) {
case 0:
r = val;
g = (((val – base) * hue) / 60) + base;
b = base;
break;

case 1:
r = (((val – base) * (60 – (hue % 60))) / 60) + base;
g = val;
b = base;
break;

case 2:
r = base;
g = val;
b = (((val – base) * (hue % 60)) / 60) + base;
break;

case 3:
r = base;
g = (((val – base) * (60 – (hue % 60))) / 60) + base;
b = val;
break;

case 4:
r = (((val – base) * (hue % 60)) / 60) + base;
g = base;
b = val;
break;

case 5:
r = val;
g = base;
b = (((val – base) * (60 – (hue % 60))) / 60) + base;
break;
}

colors[0] = r;
colors[1] = g;
colors[2] = b;
}
}

 

Neopixel Animation

We ditched the regular LEDs for a much more sophisticated RGB LED Neopixel. Our assignment was to create a narrative using only one Neopixel light. I decided to depict a journey through the solar system that represented the sun and all 8 planets (sorry Pluto, I’ll never forget) working from the center outward. I’m still having a hard time condensing my code into clean and organized thoughts. We worked through another student’s project in class to get a better understanding of controlling time, but I seriously feel lost with this concept. The example code was a loop with randomization, not a straight path through time which is what I need to accomplish my planet animation. I took the same approach to timing the animation as my previous project because this is the only way I know how to make it work. Hopefully I can get a better grasp in the next class before we start working with LED arrays.

Well I had an animation I was happy with, but I screwed up my code when consolidating it, so the animation didn’t even work when I presented it. Here is the code:

#include <Adafruit_NeoPixel.h> //Connect to NeoPixel library.

Adafruit_NeoPixel pixels = Adafruit_NeoPixel(1, 6, NEO_GRB + NEO_KHZ800);

int r = 1;
int g = 1;
int b = 1;

bool rUp = 1; //On or off. 1 = on.
bool gUp = 1; //On or off. 1 = on.
bool bUp = 1; //On or off. 1 = on.

unsigned long currentTime = 0;
unsigned long lastTime = 0;
unsigned long counter = 0;
int timer1 = 2;
int timer2 = 10;
int timer3 = 10;
int timer4 = 15;
int timer5 = 15;
int timer6 = 10;
int timer7 = 15;
int timer8 = 10;
int timer9 = 10;

unsigned long scene1 = 5000;
unsigned long scene2 = 10000;
unsigned long scene3 = 15000;
unsigned long scene4 = 20000;
unsigned long scene5 = 25000;
unsigned long scene6 = 30000;
unsigned long scene7 = 35000;
unsigned long scene8 = 40000;
unsigned long scene9 = 45000;

void setup() {
pixels.begin();

}

void loop() {
currentTime = millis();

if (currentTime < scene1) {
fader(2, 254, 170, 80, 40, 2, 1); //Sun
}

if (currentTime > scene1 && currentTime <= scene2) {
fader(10, 65, 64, 65, 64, 65, 64); //Mercury
}

if (currentTime > scene2 && currentTime <= scene3) {
fader(10, 254, 250, 254, 160, 2, 1); //Venus
}

if (currentTime > scene3 && currentTime <= scene4) {
fader2(15, 2, 1, 125, 110, 254, 1); //Earth
}

if (currentTime > scene4 && currentTime <= scene5) {
fader(15, 254, 120, 40, 1, 25, 15); //Mars
}

if (currentTime > scene5 && currentTime <= scene6) {
fader(10, 180, 165, 140, 1, 25, 15); //Jupiter
}

if (currentTime > scene6 && currentTime <= scene7) {
fader(10, 115, 90, 59, 57, 17, 15); //Saturn
}

if (currentTime > scene7 && currentTime <= scene8) {
fader(10, 45, 35, 204, 180, 220, 212); //Uranus
}

if (currentTime > scene8 && currentTime <= scene9) {
fader(15, 165, 140, 30, 1, 240, 220); //Neptune
}
}

void fader(int timer,int redMax,int redMin, int greenMax, int greenMin, int blueMax, int blueMin) { //Sun

if (currentTime – lastTime > timer) {

if (rUp) {
r++;
} else r–;

if (gUp) {
g++;
} else g–;
if (bUp) {
b++;
} else b–;

if (r > redMax) rUp = 0;
if (r < redMin) rUp = 1;
if (g > greenMax) gUp = 0;
if (g < greenMin) gUp = 1;
if (b > blueMax) bUp = 0;
if (b < blueMin) bUp = 1;

pixels.setPixelColor(0, pixels.Color(r, g, b));
pixels.show();
lastTime = currentTime;
}
}

void fader2(int timer,int redMax,int redMin, int greenMax, int greenMin, int blueMax, int blueMin) { //Earth

if (currentTime – lastTime > timer) {

if (rUp) {
r++;
} else r–;

if (gUp) {
g++;
} else g–;
if (bUp) {
b = (cos(currentTime / 500.0) + 1.0) * 128.0;
} else b = (sin(currentTime / 500.0) – 1.0) * 128.0;

if (redMax > 2) rUp = 0;
if (redMin < 1) rUp = 1;
if (greenMax > 125) gUp = 0;
if (greenMin < 110) gUp = 1;
if (blueMax > 254) bUp = 0;
if (blueMin < 1) bUp = 1;

pixels.setPixelColor(0, pixels.Color(r, g, b));
pixels.show();
lastTime = currentTime;
}
}

I’m going back to Shiffman’s Function tutorials, because I just can’t seem to get this stuff to stick in my brain. I’m having the same challenge with programming as I did with advanced math, in one ear and out the other, especially when it comes to multiple levels of abstraction. In the end, I think I may be more successful in my future multimedia projects using a visual programming aid like Max. I feel like it’s important for me to understand programming at the deepest level I can handle.

Meanwhile, I’m checking out some different project examples to spark some creative ideas for what I’m guessing will be a more elaborate project assignment involving our use of LEDs. For my own entertainment, I’d love to get a strip of neopixels attached to me Parrot 2.0 drone, but these glasses are pretty badass too.

 

LED Arrays – Adafruit Feather

4/5/17

The assignment yesterday (4/4/17) was to program 4 LED’s flashing independently from each other with different fading effects. I’m currently stuck on only getting the first LED in the chain lit. We wrote some complicated (to me) code to control the timing instead of just using a simpler but less efficient delay(); function. I do not understand the workaround code at all and can only get one light to turn on (pin 5), but still feel like I’m writing this out properly. I’m about to check each light to see if I’m just experiencing a hardware malfunction… and back. All of the LED’s are functioning, so I’m going to reset my whole breadboard… and back! Ok so the breadboard must have not been set up right. I am now able to get all the lights on, but only with the delay(); function.

This is the key to my problems, I have to figure out how to control this section:

int rTime = millis();
if (rTime – redTime > 1000) {
if (toggle) {
digitalWrite(ledRed, HIGH);
toggle = false;
} else {
digitalWrite(ledRed, LOW);
toggle = true;
}
redTime = rTime;
}

This breadboard doesn’t have a proper ground wire bridging the gap. Derp!

4/9/17

I found out that my breadboard’s ground column is split in 2 sections, thats why most of my lights weren’t working, I wasn’t bridging the gap with ground wire! We went further into our code today, creating new functions with arrays to control multiple LEDs through PWM contacts on the Feather. There are 7 contacts that can accept PWM signals: 3, 5, 6, 9, 10, 11, 13.

Our new assignment was to run at least 6 flashing LEDs and one digital on/off LED in a fashion that represents a narrative. The confusing aspect to me was how to create more than one looping scene that kept accurate time of each scene in sequence. I woke up with the answer in my head Saturday morning,  I realized I had to create different variables that represented specific milliseconds since my timeline is being measured in millis(); I wrapped my forLoops in an if statement that checks the currentTime and activates each loop in order (tenSec, twentySec, ect). My code is really heavy and I know it can be simplified, so I’m looking forward to learning how to package this up neatly. This is the work in progress:

 

Here’s the final code! It’s a loose interpretation of someone channel surfing, so each scene is interrupted by a quick strobing flash before moving to the next scene.

unsigned long currentTime = 0;

unsigned long stage1 = 7000; //Writing the name of your variable literally can create bias and establish boundaries
unsigned long stage2 = 7500;
unsigned long stage3 = 15000;
unsigned long stage4 = 15500;
unsigned long stage5 = 20000;
unsigned long stage6 = 20500;
unsigned long stage7 = 23000;
unsigned long stage8 = 26000;
unsigned long stage9 = 26500;
unsigned long stage10 = 38000;
unsigned long stage11 = 42000;
//Digital ON/OFF variables
int green = A5;
bool toggle = true;
unsigned long greenTime = 0;

//PWM LED variables
const int numLeds = 7;
int pin [numLeds] = {3, 5, 6, 9, 10, 11, 13};
int brightness [numLeds] = {0, 0, 0, 0, 0, 0, 0};
int fadeIn [numLeds] = {3, 2, 2, 1, 2, 2, 3};
int fadeOut [numLeds] = { -1, -2, -2, -3, -2, -2, -1};
bool fadeUp [numLeds] = {1, 1, 1, 1, 1, 1, 1};
unsigned long lastTime [numLeds] = {0, 0, 0, 0, 0, 0, 0};
int flckrSpd [numLeds] = {6, 4, 2, 8, 2, 4, 6};

//PWM LED variables 2
int pin2 [numLeds] = {3, 5, 6, 9, 10, 11, 13};
int brightness2 [numLeds] = {0, 0, 0, 0, 0, 0, 0};
int fadeIn2 [numLeds] = {10, 10, 10, 10, 10, 10, 10};
int fadeOut2 [numLeds] = { -1, -1, -2, -3, -4, -4, -4};
bool fadeUp2 [numLeds] = {1, 1, 1, 1, 1, 1, 1};
unsigned long lastTime2 [numLeds] = {0, 0, 0, 0, 0, 0, 0};
int flckrSpd2 [numLeds] = {1, 2, 3, 4, 5, 5, 5};

//PWM LED variables 3
int pin3 [numLeds] = {3, 5, 6, 9, 10, 11, 13};
int brightness3 [numLeds] = {0, 0, 0, 0, 0, 0, 0};
int fadeIn3 [numLeds] = {3, 3, 3, 3, 3, 3, 3};
int fadeOut3 [numLeds] = { -10, -1, -10, -1, -10, -1, -10};
bool fadeUp3 [numLeds] = {1, 1, 1, 1, 1, 1, 1};
unsigned long lastTime3 [numLeds] = {0, 0, 0, 0, 0, 0, 0};
int flckrSpd3 [numLeds] = {30, 10, 30, 10, 30, 10, 30};

//PWM LED variables 4
int pin4 [numLeds] = {3, 5, 6, 9, 10, 11, 13};
int brightness4 [numLeds] = {1, 1, 1, 1, 1, 1, 1};
int fadeIn4 [numLeds] = {1, 1, 1, 1, 1, 1, 1};
int fadeOut4 [numLeds] = { -8, -3, -4, -5, -6, -7, -8};
bool fadeUp4 [numLeds] = {1, 1, 1, 1, 1, 1, 1};
unsigned long lastTime4 [numLeds] = {0, 0, 0, 0, 0, 0, 0};
int flckrSpd4 [numLeds] = {10, 3, 1, 10, 1, 3, 10};

//PWM LED variables 5
int pin5 [numLeds] = {3, 5, 6, 9, 10, 11, 13};
int brightness5 [numLeds] = {0, 0, 0, 0, 0, 0, 0};
int fadeIn5 [numLeds] = {1, 1, -1, 1, -1, 1, 1};
int fadeOut5 [numLeds] = { -5, -1, -2, -3, -2, -1, -5};
bool fadeUp5 [numLeds] = {1, 1, 1, 1, 1, 1, 1};
unsigned long lastTime5 [numLeds] = {0, 0, 0, 0, 0, 0, 0};
int flckrSpd5 [numLeds] = {15, 15, 15, 15, 15, 15, 15};

//PWM LED variables 6
int pin6 [numLeds] = {3, 5, 6, 9, 10, 11, 13};
int brightness6 [numLeds] = {0, 0, 0, 0, 0, 0, 0};
int fadeIn6 [numLeds] = {1, 1, 1, 1, 1, 1, 1};
int fadeOut6 [numLeds] = { -1, -1, -1, -1, -1, -1, -1};
bool fadeUp6 [numLeds] = {1, 1, 1, 1, 1, 1, 1};
unsigned long lastTime6 [numLeds] = {0, 0, 0, 0, 0, 0, 0};
int flckrSpd6 [numLeds] = {30, 30, 30, 30, 30, 30, 30};

void setup() {

pinMode(green, OUTPUT);

// for loop initializes each pin as an output:
for (int i = 0; i < numLeds; i++) {
pinMode(pin[i], OUTPUT);
}

for (int j = 0; j < numLeds; j++) {
pinMode(pin[j], OUTPUT);
}

for (int k = 0; k < numLeds; k++) {
pinMode(pin[k], OUTPUT);
}

for (int l = 0; l < numLeds; l++) {
pinMode(pin[l], OUTPUT);
}

for (int m = 0; m < numLeds; m++) {
pinMode(pin[m], OUTPUT);
}
}

void loop() {
currentTime = millis();
// Run stage 1
if (currentTime < stage1) {
for (int i = 0; i < numLeds; i++) {
fader(i);
}
blinker();
}
// Run stage 2
if ((currentTime > stage1) && (currentTime < stage2)) {
for (int j = 0; j < numLeds; j++) {
fader2(j);
}
blinker2();
}
// Run stage 3
if ((currentTime > stage2) && (currentTime < stage3)) {
for (int k = 0; k < numLeds; k++) {
fader3(k);
}
blinker3();
}
// Run stage 4
if ((currentTime > stage3) && (currentTime < stage4)) {
for (int l = 0; l < numLeds; l++) {
fader2(l);
}
blinker2();
}
// Run stage 5
if ((currentTime > stage4) && (currentTime < stage5)) {
for (int m = 0; m < numLeds; m++) {
fader4(m);
}
blinker4();
}

// Run stage 6
if ((currentTime > stage5) && (currentTime < stage6)) {
for (int m = 0; m < numLeds; m++) {
fader2(m);
}
blinker2();
}

// Run stage 7
if ((currentTime > stage6) && (currentTime < stage7)) {
for (int m = 0; m < numLeds; m++) {
fader5(m);
}
blinker5();
}

// Run stage 8
if ((currentTime > stage7) && (currentTime < stage8)) {
for (int m = 0; m < numLeds; m++) {
fader3(m);
}
blinker3();
}

// Run stage 9
if ((currentTime > stage8) && (currentTime < stage9)) {
for (int m = 0; m < numLeds; m++) {
fader2(m);
}
blinker2();
}

// Run stage 10
if ((currentTime > stage9) && (currentTime < stage10)) {
for (int m = 0; m < numLeds; m++) {
fader5(m);
}
blinker5();
}
// Run stage 11
if ((currentTime > stage10) && (currentTime < stage11)) {
for (int m = 0; m < numLeds; m++) {
fader6(m);
}
blinker2();
}
}
void fader(int LED) {
if (currentTime – lastTime[LED] > flckrSpd[LED]) {
analogWrite(pin[LED], brightness[LED]);
// change the brightness for next time through the loop:
if (fadeUp[LED]) {
brightness[LED] = brightness[LED] + fadeIn[LED];
} else {
brightness[LED] = brightness[LED] + fadeOut[LED];
}

// reverse the direction of the fading at the ends of the fade:
if (brightness[LED] <= 0) {
fadeUp[LED] = true;
}
else if (brightness[LED] >= 255) {
fadeUp[LED] = false;
}
lastTime[LED] = currentTime;
}
}

void fader2(int LED) {
if (currentTime – lastTime2[LED] > flckrSpd2[LED]) {
analogWrite(pin2[LED], brightness2[LED]);
// change the brightness for next time through the loop:
if (fadeUp2[LED]) {
brightness2[LED] = brightness2[LED] + fadeIn2[LED];
} else {
brightness2[LED] = brightness2[LED] + fadeOut2[LED];
}

// reverse the direction of the fading at the ends of the fade:
if (brightness2[LED] <= 0) {
fadeUp2[LED] = true;
}
else if (brightness2[LED] >= 60) {
fadeUp2[LED] = false;
}
lastTime2[LED] = currentTime;
}
}

void fader3(int LED) {
if (currentTime – lastTime3[LED] > flckrSpd3[LED]) {
analogWrite(pin3[LED], brightness3[LED]);
// change the brightness for next time through the loop:
if (fadeUp3[LED]) {
brightness3[LED] = brightness3[LED] + fadeIn3[LED];
} else {
brightness3[LED] = brightness3[LED] + fadeOut3[LED];
}

// reverse the direction of the fading at the ends of the fade:
if (brightness3[LED] <= 0) {
fadeUp3[LED] = true;
}
else if (brightness3[LED] >= 70) {
fadeUp3[LED] = false;
}
lastTime3[LED] = currentTime;
}
}

void fader4(int LED) {
if (currentTime – lastTime4[LED] > flckrSpd4[LED]) {
analogWrite(pin4[LED], brightness4[LED]);
// change the brightness for next time through the loop:
if (fadeUp4[LED]) {
brightness4[LED] = brightness4[LED] + fadeIn4[LED];
} else {
brightness4[LED] = brightness4[LED] + fadeOut4[LED];
}

// reverse the direction of the fading at the ends of the fade:
if (brightness4[LED] <= 0) {
fadeUp4[LED] = true;
}
else if (brightness2[LED] >= 255) {
fadeUp4[LED] = false;
}
lastTime4[LED] = currentTime;
}
}

void fader5(int LED) {
if (currentTime – lastTime5[LED] > flckrSpd5[LED]) {
analogWrite(pin5[LED], brightness5[LED]);
// change the brightness for next time through the loop:
if (fadeUp2[LED]) {
brightness5[LED] = brightness5[LED] + fadeIn5[LED];
} else {
brightness5[LED] = brightness5[LED] + fadeOut5[LED];
}

// reverse the direction of the fading at the ends of the fade:
if (brightness5[LED] <= 0) {
fadeUp5[LED] = true;
}
else if (brightness5[LED] >= 10) {
fadeUp5[LED] = false;
}
lastTime5[LED] = currentTime;
}
}

void fader6(int LED) {
if (currentTime – lastTime6[LED] > flckrSpd6[LED]) {
analogWrite(pin5[LED], brightness5[LED]);
// change the brightness for next time through the loop:
if (fadeUp6[LED]) {
brightness6[LED] = brightness6[LED] + fadeIn6[LED];
} else {
brightness5[LED] = brightness6[LED] + fadeOut6[LED];
}

// reverse the direction of the fading at the ends of the fade:
if (brightness6[LED] <= 0) {
fadeUp6[LED] = true;
}
else if (brightness5[LED] >= 255) {
fadeUp6[LED] = false;
}
lastTime6[LED] = currentTime;
}
}

void blinker() {
if (currentTime – greenTime > 1500) {
if (toggle) {
digitalWrite(green, HIGH);
toggle = false;
} else {
digitalWrite(green, LOW);
toggle = true;
}
greenTime = currentTime;
}
}

void blinker2() {
if (currentTime – greenTime > 50) {
if (toggle) {
digitalWrite(green, HIGH);
toggle = false;
} else {
digitalWrite(green, LOW);
toggle = true;
}
greenTime = currentTime;
}
}

void blinker3() {
if (currentTime – greenTime > 270) {
if (toggle) {
digitalWrite(green, HIGH);
toggle = false;
} else {
digitalWrite(green, LOW);
toggle = true;
}
greenTime = currentTime;
}
}

void blinker4() {
if (currentTime – greenTime > 80) {
if (toggle) {
digitalWrite(green, HIGH);
toggle = false;
} else {
digitalWrite(green, LOW);
toggle = true;
}
greenTime = currentTime;
}
}

void blinker5() {
if (currentTime – greenTime > 400) {
if (toggle) {
digitalWrite(green, HIGH);
toggle = false;
} else {
digitalWrite(green, LOW);
toggle = true;
}
greenTime = currentTime;
}
}

LED Light Programming

Last week we simulated programming LED lights in Processing. I have no prior experience in Processing, only p5js, so I’m still getting used to the syntax. I kept messing with cos and sin parameters to create different strobing effects with the lights.

Well I guess I still have work to do running a processing sketch on my blog, as the same method for p5js does not seem to be working. However I’m pretty happy with the variety of strobe effects that I got with 4 different variations.

Right now I’m reading up on my Adafruit Feather to try and get a better idea of its capabilities until we have access to them.

Cultural Event 1 – Solastalgia

Solastalgia – 3/31/17

Dateline: 3004 Larimer St.

Denver, CO

Jayne Butler / Molly Lofton / Noah Travis Phillips / Sarah Richter / Bart Rondet / Anna Winter

A mixed exhibition of EDP MFA students featuring virtual reality, digital, tactile and sonic arts.

I had a great time experiencing the wide breadth of work from our program’s graduate students at Solastalgia. I started with Bart’s HTC Vive virtual reality piece, which successfully conveyed a vast sense of space and constant shifts in environment. Molly’s digital art print from Cinema 4D was well lit and did a great job contrasting digitally inspired renderings with a natural mountainous landscape. I liked Anna’s combination of tactility with her video art, and thought that projection mapping the video directly onto the GAK may have made an interesting iteration of this project. Jayne’s jacket camera was well-conceived and raised great questions regarding rights to safety vs. rights to privacy. Noah’s audio experience was deeply immersive. A mask was worn while focusing on the soundscape and created a sense of ritualism which I picked up from the alien-like mantras. Sarah’s projection mapping was scaled intimately and drew me in for several minutes, watching the simple cube structure slowly shift in context. Overall this was a fun show and I was really inspired to dig into Unity over this Summer to start creating immersive environments in VR.

Tangible Test

Test post!

-Stephen