4. Reference
• Language Reference
– http://arduino.cc/en/Reference/HomePage
• Tutorial
– http://arduino.cc/en/Tutorial/HomePage
Multi Sensory Communication
4
5. Schedule
• 11/28
– Introduction to Multi sensory communication
• 11/29
– Sensor & Actuator
• 12/05
– Prototyping
• 12/06
– Haptic Workshop01
• 12/19
– Haptic Workshop02
• 12/20
– Quick Presentation
Multi Sensory Communication
5
6. Presentation
• Prototyping
– What is your Multi Sensory Communication System?
• Storytelling
– What is your concept?
Multi Sensory Communication
6
7. Outline
• Introduction to Multi Sensory Communication
– Definition
– Example
• Basis of Arduino
Multi Sensory Communication
7
8. What is Multi Sensory Communication?
Multi Sensory Communication
8
23. Arduino
• Arduino is an open-source electronics prototyping
platform based on flexible, easy-to-use hardware and
software.
• It's intended for artists, designers, hobbyists, and
anyone interested in creating interactive objects or
environments.
Multi Sensory Communication
23
24. Arduino
• Arduino Board
– ATMega328
– USB
– Open Source
• Arduino IDE(Integrated Development Environment)
– Windows, Linux, Mac OSX
– Opern Source
– Based on Processing
• Arudino Programming language
– Based on Wiring
Multi Sensory Communication
24
25. Arduino Board /UNO
Multi Sensory Communication
Analog Input x 6
Digital Input and
Output x 14
3.3V
Ground
Ground
5V
Power Indicator
External Power
25
31. Arduino IDE
Multi Sensory Communication
Verify
Checks your code for
errors.
Stop
Stops the serial monitor, or
unhighlight other buttons. .
Creates a new sketch..
New
Presents a menu of all the
sketches in your sketchbook.
Clicking one will open it within
the current window.
Open
Upload
Compiles your code and
uploads it to the Arduino I/O
board.
Serial Monitor
Opens the serial monitor.
Save
Saves your sketch.
31
32. Setup(Windows)
• Tools-> Board-> Arduino UNO
• Tools->Serial Port COMxx
※Please Check Device Manager
[XP] My Computer->Right Click->Property->Hardware-> Device Manager
[Vista/Win7] Start->Control Panel->System & Security-> Device Manager
32
Multi Sensory Communication
33. Setup(Mac OS X)
• Tools-> Board-> Arduino UNO
• Tools->Serial Port ->
/dev/tty.usbserial-xxxxxxxx
Multi Sensory Communication
33
35. Test
1. Open a example file.
Menu
->File
->Examples
->Basics
->Blink
Multi Sensory Communication
35
36. Hello World!
void setup() {
// initialize the digital pin as an output.
// Pin 13 has an LED connected on most Arduino boards:
pinMode(13, OUTPUT);
}
void loop() {
digitalWrite(13, HIGH); // set the LED on
delay(1000); // wait for a second
digitalWrite(13, LOW); // set the LED off
delay(1000); // wait for a second
}
36
Multi Sensory Communication
37. Change the BlinkInterval
void setup() {
// initialize the digital pin as an output.
// Pin 13 has an LED connected on most Arduino boards:
pinMode(13, OUTPUT);
}
void loop() {
digitalWrite(13, HIGH); // set the LED on
delay(100); // wait for a second
digitalWrite(13, LOW); // set the LED off
delay(100); // wait for a second
}
37
Multi Sensory Communication
38. Change the BlinkRatio
void setup() {
// initialize the digital pin as an output.
// Pin 13 has an LED connected on most Arduino boards:
pinMode(13, OUTPUT);
}
void loop() {
digitalWrite(13, HIGH); // set the LED on
delay(5); // wait for a second
digitalWrite(13, LOW); // set the LED off
delay(5); // wait for a second
}
38
Multi Sensory Communication
39. Change the BlinkRatio
void setup() {
// initialize the digital pin as an output.
// Pin 13 has an LED connected on most Arduino boards:
pinMode(13, OUTPUT);
}
void loop() {
digitalWrite(13, HIGH); // set the LED on
delay(1); // wait for a second
digitalWrite(13, LOW); // set the LED off
delay(9); // wait for a second
}
39
Multi Sensory Communication
40. Change the BlinkRatio
void setup() {
// initialize the digital pin as an output.
// Pin 13 has an LED connected on most Arduino boards:
pinMode(13, OUTPUT);
}
void loop() {
digitalWrite(13, HIGH); // set the LED on
delay(9); // wait for a second
digitalWrite(13, LOW); // set the LED off
delay(1); // wait for a second
}
40
Multi Sensory Communication
41. PWM
• PWM(Pulse Width Modulation)
D = τ/ T
D : duty cycle
τ: pulse
T : transition
Multi Sensory Communication
ex: 0.25(D) = 1(τ)/4(T)
Pulse
time
41
45. Basic Knowledge
• Voltage
– The difference in electric potential between two
points.
– Unit symbol V(Volt)
• Electric current
– A flow of electric charge through a medium.
– Unit symbol A(Ampere)
• Resistance
– The opposition to the passage of an electric current.
– Unit symbol Ω(Ohm)
Multi Sensory Communication
45
50. Control using servo library
Methods see… http://www.arduino.cc/en/Reference/Servo
– attach(pin/number)
• Attach the Servo variable to a pin
– write(angle/degrees 0 - 180)
– writeMicroseconds(time/micro seconds1250 - 1750)
– read(pin/number)
• The angle of the servo, from 0 to 180 degrees.
– attached()
• Use as ServoObject.attached() returns true/false
– detach()
• Use as ServoObject.detach() detach pin from servo
Multi Sensory Communication
50
51. Tutrial
• File > Examples > Servo > Sweep
Multi Sensory Communication
51
http://arduino.cc/en/Tutorial/Sweep
orange
brown
red
52. Points
#include <Servo.h> //a maximum of eight servo objects can be created
Servo myservo; // create servo object to control a servo
int pos = 0; // variable to store the servo position
void setup()
{
myservo.attach(9); // attaches the servo on pin 9 to the servo object
}
void loop()
{
for(pos = 0; pos < 180; pos += 1) // goes from 0 degrees to 180 degrees
{ // in steps of 1 degree
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15ms for the servo to reach the position
}
for(pos = 180; pos>=1; pos-=1) // goes from 180 degrees to 0 degrees
{
myservo.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 15ms for the servo to reach the position
}
} Multi Sensory Communication
52
// is comment
pinMode = Configures the specified pin to behave either as an input or an output.
digitalWrite = Write a HIGH or a LOW value to a digital pin.
HighとLowをすばやく切りかえることで、 中間量の電流が流れているときと同じ状態を作ることができる。
http://monoist.atmarkit.co.jp/fembedded/h8/h8primer09/h8primer09a.html
1/10 = 0.1 D
9/10 = 0.9 D