CalPal
Made by vaishnas, Stamp Siripanich, ankitaa, skokate and Alanna Libbrecht
Made by vaishnas, Stamp Siripanich, ankitaa, skokate and Alanna Libbrecht
Created: February 7th, 2015
Concept
We do not have to starve ourselves to lose weight, this is one of the most common misconceptions people have when trying to lose weight. The key is to eat a balanced diet. Our bodies require foods from each of the nutrition groups to maintain a healthy state. Some diet methods may asked you to eliminate food from certain nutrition groups from your meal and only focus on a few of them. This might works, but our body requires vitamins, minerals, fats, carbs, and protein to maintain a healthy lifestyle in the long run. Completely cutting out any groups can have damaging and harmful effects on our body.
The lack of awareness among many led us to the idea of using ambient display to encourage people to eat a balanced diet appropriate to their activity level of each day.
How It Works?
The ambient display is divided into three parts which represent portions of proteins, whole grains and fruits & vegetables. Each part lights up in a different color. This ambient display is linked to the users Google calendar which has their schedule including their exercise plan. The food proportion depends on the physical activity planned and noted in the Google calendar for each day. This ambient display can be positioned by the user in any part of the house be it kitchen or bedroom.
int redPin1 = A0; // RED pin of the LED to PWM pin **A0**
int bluePin1 = D0; // BLUE pin of the LED to PWM pin **D1**
int redPin2 = D1;
int bluePin2 = A1;
int greenPin3 = A4; // RED pin of the LED to PWM pin **A0**
int bluePin3 = A5; // BLUE pin of the LED to PWM pin **D1**
int greenPin4 = A6;
int bluePin4 = A7;
int redValue = 255; // Full brightness for an Cathode RGB LED is 0, and off 255
int greenValue = 255; // Full brightness for an Cathode RGB LED is 0, and off 255
int blueValue = 255; // Full brightness for an Cathode RGB LED is 0, and off 255
void setup()
{
// Set up our pins for output
pinMode( redPin1, OUTPUT);
pinMode( bluePin1, OUTPUT);
pinMode( redPin2, OUTPUT);
pinMode( bluePin2, OUTPUT);
pinMode( greenPin3, OUTPUT);
pinMode( bluePin3, OUTPUT);
pinMode( greenPin4, OUTPUT);
pinMode( bluePin4, OUTPUT);
//Register our Spark function here
Spark.function("none", setNone);
Spark.function("yoga", setYoga);
Spark.function("cardio", setCardio);
Spark.function("weights", setWeights);
// turn them all off...
//analogWrite( redPin, redValue);
//analogWrite( greenPin, greenValue);
//analogWrite( bluePin, blueValue);
}
int setNone(String dummy)
{
// 6 leds for protein, 8 leds for grain, 6 leds for veggies
analogWrite( redPin1,0); // one more protein
analogWrite( bluePin1,255);
analogWrite( redPin2,255); // one more grain
analogWrite( bluePin2, 0);
analogWrite( greenPin3,255); // two more grains
analogWrite( bluePin3,0);
analogWrite( greenPin4,255);
analogWrite( bluePin4, 0);
}
int setYoga(String dummy)
{
// 5 leds for protein, 7 leds for grain, 8 leds for veggies
analogWrite( redPin1,255); // two more grains
analogWrite( bluePin1,0);
analogWrite( redPin2,255);
analogWrite( bluePin2, 0);
analogWrite( greenPin3,0); // two more veggies
analogWrite( bluePin3,255);
analogWrite( greenPin4,0);
analogWrite( bluePin4, 255);
}
int setCardio(String dummy)
{
// 6 leds for protein, 6 leds for grains, 8 leds for veggies
analogWrite( redPin1,0); // one more protein
analogWrite( bluePin1,255);
analogWrite( redPin2, 255); // one more grain
analogWrite( bluePin2, 0);
analogWrite( greenPin3,0); // two more veggies
analogWrite( bluePin3,255);
analogWrite( greenPin4,0);
analogWrite( bluePin4, 255);
}
int setWeights(String dummy)
{
// 7 leds for protein, 5 leds for grain, 8 leds for veggies
analogWrite( redPin1,0); // two more proteins
analogWrite( bluePin1,255);
analogWrite( redPin2, 0);
analogWrite( bluePin2, 255);
analogWrite( greenPin3,0); // two more veggies
analogWrite( bluePin3,255);
analogWrite( greenPin4,0);
analogWrite( bluePin4, 255);
}
Click to Expand