Upload
sebastienjouhans
View
112
Download
6
Tags:
Embed Size (px)
DESCRIPTION
Presentation for the IXDA workshop about Arduino and Processing
Citation preview
IxDA 14
rgaixda14.tumblr.com#rgaixda14
Thursday, February 6, 14
IxDA 14 Getting Real with Connected Devices
A bit about us...
2
Thursday, February 6, 14
IxDA 14 Getting Real with Connected Devices
IliaSebStuartTimVincentJonny
3
Thursday, February 6, 14
Thursday, February 6, 14
IxDA 14 Getting Real with Connected Devices
We transform the way people experience brands
5
Thursday, February 6, 14
IxDA 14 Getting Real with Connected Devices
R/GA Make Day
7
Thursday, February 6, 14
IxDA 14 Getting Real with Connected Devices
Why prototype?
9
Thursday, February 6, 14
IxDA 14 Getting Real with Connected Devices
Experience wins over specification
10From Prototyping, A Practioners Guide by Todd Zaki Warfel
Thursday, February 6, 14
IxDA 14 Getting Real with Connected Devices
Reduces misinterpretation
11From Prototyping, A Practioners Guide by Todd Zaki Warfel
Thursday, February 6, 14
IxDA 14 Getting Real with Connected Devices
Saves time, money & effort
12From Prototyping, A Practioners Guide by Todd Zaki Warfel
Thursday, February 6, 14
IxDA 14 Getting Real with Connected Devices
Reduces waste
13From Prototyping, A Practioners Guide by Todd Zaki Warfel
Thursday, February 6, 14
IxDA 14 Getting Real with Connected Devices
Prototyping is generative
14From Prototyping, A Practioners Guide by Todd Zaki Warfel
Thursday, February 6, 14
IxDA 14 Getting Real with Connected Devices
The opportunity to craft
15
Thursday, February 6, 14
IxDA 14 Getting Real with Connected Devices
Design by making
16
Thursday, February 6, 14
IxDA 14 Getting Real with Connected Devices
Today
17
Thursday, February 6, 14
IxDA 14 Getting Real with Connected Devices
ToolkitBriefIdeateBuildImprove
18
Thursday, February 6, 14
IxDA 14 Getting Real with Connected Devices
You won’t learn to be an expert coder
19
Thursday, February 6, 14
IxDA 14 Getting Real with Connected Devices
You might not understand everything
20
Thursday, February 6, 14
IxDA 14 Getting Real with Connected Devices
You’ll expand your design vocabulary
21
Thursday, February 6, 14
IxDA 14 Getting Real with Connected Devices
You’ll see the value in building to learn
22
Thursday, February 6, 14
IxDA 14 Getting Real with Connected Devices
Arduino
23
Thursday, February 6, 14
IxDA 14 Getting Real with Connected Devices
24
Arduino = Hardware + Software
+
Thursday, February 6, 14
IxDA 14 Getting Real with Connected Devices
The hardware
25
Thursday, February 6, 14
IxDA 14 Getting Real with Connected Devices
Arduino Board
26
Analog inputonly
Digital input & output
USB
Thursday, February 6, 14
IxDA 14 Getting Real with Connected Devices
Inputs / Sensors
27
TiltSensor
PushButtons
Potentiometer(variable resistor)
Photocell(light sensor)
FlameSensor
TemperatureSensor
Infraredreceivermodule
ANALOG DIGITAL
Thursday, February 6, 14
IxDA 14 Getting Real with Connected Devices
Outputs / Actuators
28
Buzzers LED Matrix Multi-colour LEDNixie Tube LED
Thursday, February 6, 14
IxDA 14 Getting Real with Connected Devices
Breadboard
29
Thursday, February 6, 14
IxDA 14 Getting Real with Connected Devices
Breadboard
29
Thursday, February 6, 14
IxDA 14 Getting Real with Connected Devices
Other
30
ResistorsUSBCable
BatteryCase
RemoteControl
Thursday, February 6, 14
IxDA 14 Getting Real with Connected Devices
Installation
31
Thursday, February 6, 14
IxDA 14 Getting Real with Connected Devices
Installing Arduino
32
Mac:http://arduino.cc/en/Guide/MacOSX
Windows:http://arduino.cc/en/Guide/Windows
Thursday, February 6, 14
IxDA 14 Getting Real with Connected Devices
The Code
33
Thursday, February 6, 14
IxDA 14 Getting Real with Connected Devices
Basics
34
Thursday, February 6, 14
IxDA 14 Getting Real with Connected Devices
Variable - Store things
35
String myName = “Sebastien”; // a string
int myAge = 10; // an integer
float myHight = 1.78; // a float
bool isMale = true; // a boolean
Thursday, February 6, 14
IxDA 14 Getting Real with Connected Devices
If / Else Statements - Conditions
36
int myAge = 10;String myName = “”;
If(myAge==20) // false{ myName = “Sebastien”;}else // do this now{ myName = “Ilia”;}
Thursday, February 6, 14
IxDA 14 Getting Real with Connected Devices
Functions
37
Self-contained bit of code that can be called whenever. It
can take parameters and return a value.
Important uses:
- Encapsulate code/functionality
- Stops code duplication
Thursday, February 6, 14
IxDA 14 Getting Real with Connected Devices
Functions
38
void storeMyName(){ myName = “Sebastien”;}
storeMyName(); // stores Sebastien in myName
String getMyName(){ return “Sebastien”;}
getMyName(); // returns Sebastien
int multiply(int firstNumber, int secondNumber){ int result = firstNumber * secondNumber; return result;}
multiply( 2, 2); // returns 4
Thursday, February 6, 14
IxDA 14 Getting Real with Connected Devices
Basic Arduino Sketch
39
The setup() function is called when a sketch starts. Use it to initialize variables, pin modes, start using libraries, etc. The setup function will only run once, after each power up or reset of the Arduino board.
The loop() function does precisely what its name suggests, and loops consecutively, allowing your program to change and respond. Use it to actively control the Arduino board.
Thursday, February 6, 14
IxDA 14 Getting Real with Connected Devices
Debugging
40
void setup(){Serial.begin(9600);// opens serial port, sets data rate to 9600 bps}
void loop(){Serial.println("Hello World!");}
Thursday, February 6, 14
IxDA 14 Getting Real with Connected Devices
Exercise 1:Flashing LED
41
Thursday, February 6, 14
IxDA 14 Getting Real with Connected Devices
Flashing LED - schematic
42
Thursday, February 6, 14
IxDA 14 Getting Real with Connected Devices
Flashing LED - Arduino code
43
int ledPin=10; //set IO pin of LED in control
void setup(){
pinMode(ledPin,OUTPUT); //set digital pinIO is OUTPUT
}void loop(){
digitalWrite(ledPin,HIGH); //set PIN 10to HIGHdelay(1000); //delay 1000ms, 1000ms = 1sdigitalWrite(ledPin,LOW); //set PIN 10 is LOW, 0Vdelay(1000); //delay 1000ms, 1000ms = 1s
}
Thursday, February 6, 14
IxDA 14 Getting Real with Connected Devices
The Brief
44
Thursday, February 6, 14
IxDA 14 Getting Real with Connected Devices
The Brief
45
A new music streaming service wants to create a ‘connected device’ that will be able to interact with the service.
They want to create an experience that is new, and fun. They want to launch within a year and they want to keep the price point around €100
You have access to any sensors in your kit, plus an accelerometer (that measures angles of rotations).
Thursday, February 6, 14
IxDA 14 Getting Real with Connected Devices
3 up
46
Thursday, February 6, 14
IxDA 14 Getting Real with Connected Devices
The Cube
47
Thursday, February 6, 14
IxDA 14 Getting Real with Connected Devices
The Idea
48
Thursday, February 6, 14
IxDA 14 Getting Real with Connected Devices
The Idea
49
Thursday, February 6, 14
IxDA 14 Getting Real with Connected Devices
The Idea
50
A cube that controls music with gestures
Wireless
Directly connected to music streaming service
No need for a computer or other device
Connects to a wireless speaker
Thursday, February 6, 14
IxDA 14 Getting Real with Connected Devices
Designing the prototype
51
A cube that controls music with gestures
Wireless
Directly connected to music streaming service
No need for a computer or other device
Connects to a wireless speaker
Thursday, February 6, 14
IxDA 14 Getting Real with Connected Devices
Designing the prototype
58
A cube that controls music with gestures
Connect via USB
Play MP3s instead
Connect to computer
Connects to a wireless speaker
Thursday, February 6, 14
IxDA 14 Getting Real with Connected Devices
Arduino + Processing
59
Thursday, February 6, 14
IxDA 14 Getting Real with Connected Devices
Processing
60
Thursday, February 6, 14
IxDA 14 Getting Real with Connected Devices
Speaking to Arduino
61
via USB
Thursday, February 6, 14
IxDA 14 Getting Real with Connected Devices
The Environment
62
Thursday, February 6, 14
IxDA 14 Getting Real with Connected Devices
Building the Cube
63
Thursday, February 6, 14
IxDA 14 Getting Real with Connected Devices
The Sensor
64
Thursday, February 6, 14
IxDA 14 Getting Real with Connected Devices
Accellerometer + Gyro: MPU6050
65
Thursday, February 6, 14
IxDA 14 Getting Real with Connected Devices
66
Z
X Y
Accellerometer + Gyro: MPU6050
Thursday, February 6, 14
IxDA 14 Getting Real with Connected Devices
67
Z
X Y
Accellerometer + Gyro: MPU6050
Thursday, February 6, 14
IxDA 14 Getting Real with Connected Devices
68
Z
X Y
Accellerometer + Gyro: MPU6050
Thursday, February 6, 14
IxDA 14 Getting Real with Connected Devices
Buildingthe Circuit
69
Thursday, February 6, 14
IxDA 14 Getting Real with Connected Devices
The Components
70
Thursday, February 6, 14
IxDA 14 Getting Real with Connected Devices
Putting it Together
71
Accelerometer+ Gyro
VCCGNDSCLSDA
Arduino
3.3VGNDA5A4
Thursday, February 6, 14
IxDA 14 Getting Real with Connected Devices
The Files
72
Thursday, February 6, 14
IxDA 14 Getting Real with Connected Devices
The Arduino Files
73
MPU6050_DMP6.ino
MPU6050.h
MPU6050.cpp
I2Cdev.h
I2Cdev.ccp
helper_3dmath.h
MPU6050_6Axis_MotionApps20.h
The main Arduino program
that the other files support
To facilitate communication
with the sensor
These 2 files are math
helpers to get the rotations
https://github.com/jrowberg/i2cdevlib/tree/master/Arduino
Thursday, February 6, 14
IxDA 14 Getting Real with Connected Devices
1. Getting data from the sensor with the Arduino
74
Thursday, February 6, 14
IxDA 14 Getting Real with Connected Devices
2. Reading data from Ardiuno with Processing
75
Thursday, February 6, 14
IxDA 14 Getting Real with Connected Devices
3. Using the data in Processing
76
Thursday, February 6, 14
IxDA 14 Getting Real with Connected Devices
Buildingthe Box
77
Thursday, February 6, 14
IxDA 14 Getting Real with Connected Devices
Building the Box
78
Thursday, February 6, 14
IxDA 14 Getting Real with Connected Devices
Building the Box
79
Thursday, February 6, 14
IxDA 14 Getting Real with Connected Devices
Testing
80
Thursday, February 6, 14
IxDA 14 Getting Real with Connected Devices
How can it be improved?
81
Usability issues?
Communication of functionality?
Better feedback?
Other forms?
Unexpected ideas?
Additional functionlity?
How to navigate playlists?
Thursday, February 6, 14
IxDA 14 Getting Real with Connected Devices
Sketching
82
Thursday, February 6, 14
IxDA 14 Getting Real with Connected Devices
3 up
83
Thursday, February 6, 14
IxDA 14 Getting Real with Connected Devices
1 up
84
Thursday, February 6, 14
IxDA 14 Getting Real with Connected Devices
Share
85
Thursday, February 6, 14
IxDA 14 Getting Real with Connected Devices
Re-using the interaction model
86
Thursday, February 6, 14
IxDA 14 Getting Real with Connected Devices
Stay inTouch
87
Thursday, February 6, 14
IxDA 14 Getting Real with Connected Devices
88
rgaixda14.tumblr.com/submit
Thursday, February 6, 14
IxDA 14 Getting Real with Connected Devices
Further Reading
89
Thursday, February 6, 14
IxDA 14 Getting Real with Connected Devices
90
Making Things Talk by Tom Igoe
Further Reading
Getting Startedwith Processing byCasey Reas & Ben Fry
Getting Startedwith Arduino byMassimo Banzi
Thursday, February 6, 14
IxDA 14
Thank You
Thursday, February 6, 14