GLANCE

Track price changes and important sales with just a glance

Made by Hayley, Jeremy Jiang, Rajlakshmee Rajlakshmee, jknilans and kaylageer

Want to get that suddenly cheap flight while it's available or know when Nordstrom's is offering a 1-hr flash sale? How about if an item you posted on eBay is sold and needs to be mailed, or when your grocery store has your favorite foods on special? No need to log into your e-mail multiple times an hour or wade through all of the offers you've received when you can know the important information at just a GLANCE. GLANCE is an ambient device that acts as both a desk light as well as a glance-able notification device. Based on your needs, you can tell your GLANCE to notify you on a multitude of different price changes: *Amazon WishList Price Drops *Flight Tracker Price Changes *Price Drops at Best Buy *Ebay max price hit or winning bid notifications *And more!... ... For example, if you are tracking when rugs go on sale at any of your favorite furniture stores, you can set your GLANCE up to let you know if one does go on sale. No need to wade through your junk mail daily just to make sure you don't miss that sale you were looking for.

Created: February 8th, 2015

0

Recipes created on IFTTT send information between applications and Gmail and Spark.

Spark code writes a function to the cloud.

When Spark sees an unread email, it flashes the appropriate light, then stays on .

A second Spark function turns the lights off if the email is no longer marked "unread."

0
int rPinWish = A0;
int gPinWish = D0;
int bPinWish = D1;

int rPinSub = A1;
int gPinSub = A4;
int bPinSub = A5;

int rPinPrice = D2;
int gPinPrice = A6;
int bPinPrice = D3;

// first column is Wish, second column is Sub, third column is Price
int r[3] = {0, 0, LOW};
int g[3] = {0, 0, 0};
int b[3] = {0, 0, LOW};

int wishCount = 0;
int subCount = 0;
int priceCount = 0;

int delayTime = 500;

void setup() {
  pinMode(rPinWish, OUTPUT);
  pinMode(gPinWish, OUTPUT);
  pinMode(bPinWish, OUTPUT);
  pinMode(rPinSub, OUTPUT);
  pinMode(gPinSub, OUTPUT);
  pinMode(bPinSub, OUTPUT);
  pinMode(rPinPrice, OUTPUT);
  pinMode(gPinPrice, OUTPUT);
  pinMode(bPinPrice, OUTPUT);

  resetLED(0); //0 is wish
  resetLED(1); //1 is sub
  resetLED(2); //2 is price

  Spark.function("wishlist", wishlistPulse);
  Spark.function("subscription", subscriptionPulse);
  Spark.function("price", pricePulse);
}

void loop() {
  //code below is for testing purposes
  /*wishlistPulse("HIGH");
  delay(5000);
  wishlistPulse("HIGH");
  wishlistPulse("LOW");
  delay(5000);
  wishlistPulse("LOW");
  delay(2000);

  subscriptionPulse("HIGH");
  delay(5000);
  subscriptionPulse("HIGH");
  subscriptionPulse("LOW");
  delay(5000);
  subscriptionPulse("LOW");
  delay(2000);

  pricePulse("HIGH");
  delay(5000);
  pricePulse("HIGH");
  pricePulse("LOW");
  delay(5000);
  pricePulse("LOW");
  delay(2000);*/
}

int wishlistPulse(String command) {
  if (command == "HIGH") {
    wishCount++;
    r[0] = 0;
    g[0] = 255;
    b[0] = 0;
    pulseLED(0);
    //resetLED(0);
  }
  else if (command == "LOW")
  {
    if (wishCount > 0)
    {
      wishCount--;
    }

    if (wishCount == 0) {
      r[0] = 0;
      g[0] = 0;
      b[0] = 0;
      resetLED(0);
    }
  }

  return 1;
}

int subscriptionPulse(String command) {
  if (command == "HIGH") {
    subCount++;
    r[1] = 255;
    g[1] = 0;
    b[1] = 0;
    pulseLED(1);
    //resetLED(1);
  }
  else if (command == "LOW")
  {
    if (subCount > 0)
    {
      subCount--;
    }

    if (subCount == 0) {
      r[1] = 0;
      g[1] = 0;
      b[1] = 0;
      resetLED(1);
    }
  }

  return 1;
}

int pricePulse(String command) {
  if (command == "HIGH") {
    priceCount++;
    r[2] = HIGH;
    g[2] = 0;
    b[2] = HIGH;
    pulseLED(2);
    //resetLED(2);
  }
  else if (command == "LOW")
  {
    if (priceCount > 0)
    {
      priceCount--;
    }

    if (priceCount == 0) {
      r[2] = LOW;
      g[2] = 0;
      b[2] = LOW;
      resetLED(2);
    }
  }

  return 1;
}

void resetLED(int i) {
  switch (i) {
    case 0:
      analogWrite(rPinWish, r[i]);
      analogWrite(gPinWish, g[i]);
      analogWrite(bPinWish, b[i]);
      break;
    case 1:
      analogWrite(rPinSub, r[i]);
      analogWrite(gPinSub, g[i]);
      analogWrite(bPinSub, b[i]);
      break;
    case 2:
      digitalWrite(rPinPrice, r[i]);
      analogWrite(gPinPrice, g[i]);
      digitalWrite(bPinPrice, b[i]);
  }
}

void pulseLED(int i) {
  switch (i) {
  case 0:
    analogWrite(rPinWish, r[i]);
    analogWrite(gPinWish, g[i]);
    analogWrite(bPinWish, b[i]);
    delay(delayTime);

    analogWrite(rPinWish, r[i]+255);
    analogWrite(gPinWish, g[i]);
    analogWrite(bPinWish, b[i]+255);
    delay(delayTime);

    analogWrite(rPinWish, r[i]);
    analogWrite(gPinWish, g[i]);
    analogWrite(bPinWish, b[i]);

    break;
  case 1:
    analogWrite(rPinSub, r[i]);
    analogWrite(gPinSub, g[i]);
    analogWrite(bPinSub, b[i]);
    delay(delayTime);

    analogWrite(rPinSub, r[i]);
    analogWrite(gPinSub, g[i]+255);
    analogWrite(bPinSub, b[i]+255);
    delay(delayTime);

    analogWrite(rPinSub, r[i]);
    analogWrite(gPinSub, g[i]);
    analogWrite(bPinSub, b[i]);

    break;
  case 2:
    digitalWrite(rPinPrice, r[i]);
    analogWrite(gPinPrice, g[i]);
    digitalWrite(bPinPrice, b[i]);
    delay(delayTime);

    digitalWrite(rPinPrice, r[i]);
    analogWrite(gPinPrice, g[i]+255);
    digitalWrite(bPinPrice, b[i]);
    delay(delayTime);

    digitalWrite(rPinPrice, r[i]);
    analogWrite(gPinPrice, g[i]);
    digitalWrite(bPinPrice, b[i]);
  }
}
Click to Expand
x
Share this Project


About

Want to get that suddenly cheap flight while it's available or know when Nordstrom's is offering a 1-hr flash sale? How about if an item you posted on eBay is sold and needs to be mailed, or when your grocery store has your favorite foods on special?

No need to log into your e-mail multiple times an hour or wade through all of the offers you've received when you can know the important information at just a GLANCE.

GLANCE is an ambient device that acts as both a desk light as well as a glance-able notification device. Based on your needs, you can tell your GLANCE to notify you on a multitude of different price changes:

*Amazon WishList Price Drops
*Flight Tracker Price Changes
*Price Drops at Best Buy
*Ebay max price hit or winning bid notifications
*And more!...

... For example, if you are tracking when rugs go on sale at any of your favorite furniture stores, you can set your GLANCE up to let you know if one does go on sale. No need to wade through your junk mail daily just to make sure you don't miss that sale you were looking for.