
No title available
Today's Document
DEAR READER
Mike Driver
trying on a metaphor
Sweet Seals For You, Always
todays bird
Not today Justin

if i look back, i am lost

tannertan36
d e v o n
$LAYYYTER
Lint Roller? I Barely Know Her
we're not kids anymore.
untitled
almost home
taylor price

pixel skylines
Cosmic Funnies

No title available
seen from United States
seen from United States
seen from United States
seen from United States
seen from United States
seen from United States
seen from United States

seen from Germany
seen from United States

seen from United States

seen from Singapore
seen from Australia
seen from India
seen from India

seen from Malaysia

seen from Bangladesh
seen from Iraq

seen from United States

seen from Netherlands

seen from United States
@mddn251physicalcomputing2015
Final Code
#include <SPI.h> #include <Dhcp.h> #include <Dns.h> #include <Ethernet.h> #include <EthernetClient.h> #include <Temboo.h> #include "TembooAccount.h" // Contains Temboo account information
#include <Wire.h> // Must include Wire library for I2C #include <SparkFun_MMA8452Q.h> // Includes the SFE_MMA8452Q library
#include <Adafruit_NeoPixel.h> #include <avr/power.h>
#define PIN 7
MMA8452Q accel; // instance of the MMA8452Q
Adafruit_NeoPixel strip = Adafruit_NeoPixel(16, PIN, NEO_GRB + NEO_KHZ800);
int r; int g; int b;
byte ethernetMACAddress[] = ETHERNET_SHIELD_MAC; EthernetClient client;
//limit Temboo calls while testing //int maxCalls = 3;
// The number of times this Choreo has been run so far in this sketch //int calls = 0;
boolean portraitu = true; boolean portraitd = true;
void setup() { Serial.begin(9600);
// --- pixelring ---// strip.begin(); //strip.setBrightness(64); strip.show(); // Initialize all pixels to 'off' // ---pixelring end ---//
accel.init(); // initialize accelerometer
// For debugging, wait until the serial console is connected delay(4000);
while (!Serial);
// Serial.print("DHCP:"); if (Ethernet.begin(ethernetMACAddress) == 0) { // Serial.println("FAIL"); while (true); } // Serial.println("OK"); //delay(5000);
Serial.println("GO\n"); }
void loop() {
accel.read(); byte pl = accel.readPL();
if (/*(calls < maxCalls) &&*/ (PORTRAIT_D == pl) && (portraitd == true)) { //Serial.print("\r"); Serial.println("Wellington"); runGetWeatherWellington();
//calls++;
portraitd = false; portraitu = true;
} else if (/*(calls < maxCalls) &&*/ (PORTRAIT_U == pl) && (portraitu == true)) { //Serial.print("\r"); Serial.println("Munich");
runGetWeatherMunich(); //calls++;
portraitd = true; portraitu = false;
} /*else if (LANDSCAPE_L == pl || LANDSCAPE_R == pl || LOCKOUT == pl){ Serial.println("LED OFF");
}*/ }
// ---PixelRing fancy wipe---
void colorWipe(uint32_t c, uint8_t wait) { for (uint16_t i = 0; i < strip.numPixels(); i++) { strip.setPixelColor(i, c); strip.show(); delay(wait); } }
//WEATHER WELLINGTON
void runGetWeatherWellington() { TembooChoreo GetWeatherByAddressChoreo(client);
// Set Temboo account credentials GetWeatherByAddressChoreo.setAccountName(TEMBOO_ACCOUNT); GetWeatherByAddressChoreo.setAppKeyName(TEMBOO_APP_KEY_NAME); GetWeatherByAddressChoreo.setAppKey(TEMBOO_APP_KEY);
// Set Choreo inputs String UnitsValue = "c"; GetWeatherByAddressChoreo.addInput("Units", UnitsValue); String AddressValue = "Wellington, NZ"; // Adress here GetWeatherByAddressChoreo.addInput("Address", AddressValue); String DayValue = "1"; // 1 = today, 2 = tmr... GetWeatherByAddressChoreo.addInput("Day", DayValue); // Identify the Choreo to run GetWeatherByAddressChoreo.setChoreo("/Library/Yahoo/Weather/GetWeatherByAddress");
// Run the Choreo unsigned int returnCode = GetWeatherByAddressChoreo.run();
// A return code of zero means everything worked if (returnCode == 0) { while (GetWeatherByAddressChoreo.available()) {
String name = GetWeatherByAddressChoreo.readStringUntil('\x1F'); name.trim();
String data = GetWeatherByAddressChoreo.readStringUntil('\x1E'); data.trim();
if (name == "Temperature") { Serial.print(data.toInt()); //print current Temp
if (data.toInt() <= -10) { r = 0; g = 255; b = 255; } // wenn Temperatur zwischen -10 und 5 if (-10 < data.toInt() && data.toInt() <= 5) { r = 0; g = 255; b = 255; int steps = 0; for (int i = -10; i < data.toInt(); i++) { steps++; } b = b - (steps * 17); } // wenn Temperatur zwischen 5 und 20 if (5 < data.toInt() && data.toInt() <= 20) { r = 0; g = 255; b = 0; int steps = 0; for (int i = 5; i < data.toInt(); i++) { steps++; } r = r + (steps * 17); } // wenn Temperatur zwischen 20 und 35 if (20 < data.toInt() && data.toInt() <= 35) { r = 255; g = 255; b = 0; int steps = 0; for (int i = 20; i < data.toInt(); i++) { steps++; } g = g - (steps * 17); } // wenn Temperatur über 35 if (35 < data.toInt()) { r = 255; g = 255; b = 0; }
colorWipe(strip.Color(r, g, b), 50); strip.show();
} }
}
GetWeatherByAddressChoreo.close(); }
//WEATHER WELLINGTON FIN
//WEATHER MUNICH
void runGetWeatherMunich() { TembooChoreo GetWeatherByAddressChoreo(client);
// Set Temboo account credentials GetWeatherByAddressChoreo.setAccountName(TEMBOO_ACCOUNT); GetWeatherByAddressChoreo.setAppKeyName(TEMBOO_APP_KEY_NAME); GetWeatherByAddressChoreo.setAppKey(TEMBOO_APP_KEY);
// Set Choreo inputs String UnitsValue = "c"; GetWeatherByAddressChoreo.addInput("Units", UnitsValue); String AddressValue = "Munich"; GetWeatherByAddressChoreo.addInput("Address", AddressValue); String DayValue = "1"; GetWeatherByAddressChoreo.addInput("Day", DayValue); // Identify the Choreo to run GetWeatherByAddressChoreo.setChoreo("/Library/Yahoo/Weather/GetWeatherByAddress");
// Run the Choreo unsigned int returnCode = GetWeatherByAddressChoreo.run();
// A return code of zero means everything worked if (returnCode == 0) { while (GetWeatherByAddressChoreo.available()) { String name = GetWeatherByAddressChoreo.readStringUntil('\x1F'); name.trim();
String data = GetWeatherByAddressChoreo.readStringUntil('\x1E'); data.trim();
if (name == "Temperature") { Serial.print(data.toInt()); //print current Temp
if (data.toInt() <= -10) { r = 0; g = 255; b = 255; } // wenn Temperatur zwischen -10 und 5 if (-10 < data.toInt() && data.toInt() <= 5) { r = 0; g = 255; b = 255; int steps = 0; for (int i = -10; i < data.toInt(); i++) { steps++; } b = b - (steps * 17); } // wenn Temperatur zwischen 5 und 20 if (5 < data.toInt() && data.toInt() <= 20) { r = 0; g = 255; b = 0; int steps = 0; for (int i = 5; i < data.toInt(); i++) { steps++; } r = r + (steps * 17); } // wenn Temperatur zwischen 20 und 35 if (20 < data.toInt() && data.toInt() <= 35) { r = 255; g = 255; b = 0; int steps = 0; for (int i = 20; i < data.toInt(); i++) { steps++; } g = g - (steps * 17); } // wenn Temperatur über 35 if (35 < data.toInt()) { r = 255; g = 255; b = 0; }
colorWipe(strip.Color(r, g, b), 50); strip.show();
} }
}
GetWeatherByAddressChoreo.close(); }
//WEATHER MUNICH FIN
Pictures of my finalised project.
I spent about 3 hours to cut a ugly circle out of a piece of plastic (see background) my friend Ezra brought me this. The lid of a pepper grinder. And it fits perfectly into the round hole in my box.
To hide the electronic components I made a wooden box with a circular hole in it.
Here you can see the breadboard plan and how the elements are hooked up, after i soldered them to stripboards.
From breadboard to stripboard.
This is one of my first tests after I hooked up the accelerometer.
For the data pins of my accelerometer I needed two 330 Ohm resistors. I found two on the board of the CD player I have taken apart in project 1.
My accelerometer just arrived with the morning post.
Accelerometer Guide + Library
https://learn.sparkfun.com/tutorials/mma8452q-accelerometer-breakout-hookup-guide
https://github.com/sparkfun/MMA8452_Accelerometer/tree/V_H1.1_L1.1.0
Colour Fade
colourfade: blue ( = cold ) - green - yellow - orange - red ( = hot )
#include <Adafruit_NeoPixel.h> #include <avr/power.h>
#define PIN 7
// Parameter 1 = number of pixels in strip // Parameter 2 = Arduino pin number (most are valid) // Parameter 3 = pixel type flags, add together as needed: // NEO_KHZ800 800 KHz bitstream (most NeoPixel products w/WS2812 LEDs) // NEO_KHZ400 400 KHz (classic 'v1' (not v2) FLORA pixels, WS2811 drivers) // NEO_GRB Pixels are wired for GRB bitstream (most NeoPixel products) // NEO_RGB Pixels are wired for RGB bitstream (v1 FLORA pixels, not v2) Adafruit_NeoPixel strip = Adafruit_NeoPixel(16, PIN, NEO_GRB + NEO_KHZ800);
int r; int g; int b; int celsius = 28; //set the temperature manually
void setup() {
Serial.begin(9600);
strip.begin(); strip.setBrightness(64); strip.show(); // Initialize all pixels to 'off'
}
void loop() {
// wenn Temperatur kleiner als -10 if (celsius <= -10) { r = 0; g = 255; b = 255; } // wenn Temperatur zwischen -10 und 5 if (-10 < celsius && celsius <= 5) { r = 0; g = 255; b = 255; int steps = 0; for (int i = -10; i < celsius; i++) { steps++; } b = b - (steps * 17); } // wenn Temperatur zwischen 5 und 20 if (5 < celsius && celsius <= 20) { r = 0; g = 255; b = 0; int steps = 0; for (int i = 5; i < celsius; i++) { steps++; } r = r + (steps * 17); } // wenn Temperatur zwischen 20 und 35 if (20 < celsius && celsius <= 35) { r = 255; g = 255; b = 0; int steps = 0; for (int i = 20; i < celsius; i++) { steps++; } g = g - (steps * 17); } // wenn Temperatur über 35 if (35 < celsius) { r = 255; g = 255; b = 0; }
colorWipe(strip.Color(r, g, b), 50); strip.show();
}
void colorWipe(uint32_t c, uint8_t wait) { for (uint16_t i = 0; i < strip.numPixels(); i++) { strip.setPixelColor(i, c); strip.show(); delay(wait); } }
PROJECT 3 BRIEF
PROJECT 3 Final Project | 4 weeks | Assessment: 25%
In this Final Project you will combine the tools and techniques picked up in the first two assignments, and combine them into a new project. You can propose an entirely new concept, unrelated to previous iterations of your work made in the first two assignments, or you can choose to continue the progress made from projects 1 & 2. In any case you will treat this final project as if it’s a new proposal, and create the appropriate documents including your research, ideation, topic of focus and production outlines. Additionally, throughout this assignment you will create and assemble documentation of your theoretical and technical work of this trimester, in written and audio-visual form –for which the details are outlined below.
Schedule:
• Create your final project contextualisation document. It should include: One paragraph description of your interface or interactive environment One paragraph description explaining how this project departs from earlier work in this course Visuals (sketches, diagrams, etc.) of your concept Hardware and software to be used Theoretical outline of technical concepts used in your design Visuals of any related previous work related to your proposal Your topic of focus (interface and/or mode of interaction) Your production focus Ideation: sketches, timeline, flowchart Timeline with milestones
• Each proposal will be assessed for its creative and artistic merit weighted against its achievable potential
• Proposals are reworked to accommodate set milestones
• Progress checks
• Present your design, a functional prototype and hand-in required material
Hand-in format:
• Submit to hand-ins drive: finalised proposal based on your research.
• Present finalised design and functional prototype in class (details of presentation to be discussed in class)
• Submit to hand-ins drive(to be discussed in more detail in class):
finalised presentation materials of course work including properly documented electronic circuits (format to be discussed in class), at least three high-quality, high-resolution images (min. 250dpi) per iteration of your work, text with original title of the final project, concept description and production outlines (min. 500 words as .pdf or .txt), and short video following the guidelines listed in the ‘SUBMISSION AND RETURN OF WORK’ section below.
Serial Monitor:
1st: check Internet connection ---> DHCP:OK...Setup complete.
2nd: press button ---> calling funktions ---> calling specific weather API ---> show current temperature (--> set LED colour
Demo of my final project 2 prototype: As soon as the ethernet shield is connected with the internet i can call a certain yahoo weather API by pressing one of the three buttons. I can retrieve the current temperature of Moscow, Dubai and Wellington. The temperature is visualised through different colours.
Final hardware setup for project 2.