18. Extended Motifwork 2013 ? Make: Hardware Sketching
ハードウェアスケッチの例
? 大学院修士1年生
1st year students of the master course
? プログラミングの経験は少し
She had little programming skills
? 電子工作の経験はゼロ
She had no electronics skills
? 3D CADの経験はゼロ
She had no 3D CAD skills
? 製作期間はスキル習得も含めて六カ月
6 months project including acquiring skills
アクション!ゆびにんぎょう
19. Extended Motifwork 2013 ? Make: Hardware Sketching
IAMASにおける研究プロジェクト // Research Projects at IAMAS
リサーチ // Research
81. Extended Motifwork 2013 ? Make: Hardware Sketching
ワークショップ:基本編
Arduinoで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
}
82. Extended Motifwork 2013 ? Make: Hardware Sketching
ワークショップ:基本編
点滅の間隔を変えてみよう
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
}
83. Extended Motifwork 2013 ? Make: Hardware Sketching
ワークショップ:基本編
点滅の間隔を変えてみよう
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(10); // wait for a second
digitalWrite(13, LOW); // set the LED off
delay(10); // wait for a second
}
84. Extended Motifwork 2013 ? Make: Hardware Sketching
ワークショップ:基本編
点滅の間隔を変えてみよう
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
}
99. Extended Motifwork 2013 ? Make: Hardware Sketching
ワークショップ:基本編
アナログ入力:自分でコードを書いてみる
const int sensorPin = A0;
void setup() {
Serial.begin(9600);
}
void loop() {
// read the value from the sensor:
int sensorValue = analogRead(sensorPin);
// send the value to the PC via serial
Serial.println(sensorValue);
// wait for a little bit
delay(100);
}
104. Extended Motifwork 2013 ? Make: Hardware Sketching
ワークショップ:基本編
PC連携:4.Communication/Dimmer
const int ledPin = 9;
void setup() {
// initialize the serial communication:
Serial.begin(9600);
pinMode(ledPin, OUTPUT);
}
void loop() {
byte brightness;
// check if data has been sent from the computer:
if (Serial.available()) {
// read the most recent byte (0-255)
brightness = Serial.read();
// set the brightness of the LED:
analogWrite(ledPin, brightness);
}
}
105. Extended Motifwork 2013 ? Make: Hardware Sketching
ワークショップ:基本編
PC連携:4.Communication/Dimmer
import processing.serial.*;
Serial port;
void setup() {
size(256, 150);
// Print available serial ports
println(Serial.list());
port = new Serial(this, "COM1", 9600);
}
void draw() {
// draw a gradient from black to white
...
// send the current X-position of the mouse
port.write(mouseX);
}