Weitere ähnliche Inhalte
Ähnlich wie YCAM Workshop Part 2
Ähnlich wie YCAM Workshop Part 2 (20)
Mehr von Shigeru Kobayashi
Mehr von Shigeru Kobayashi (20)
Kürzlich hochgeladen (20)
YCAM Workshop Part 2
- 2. 2 1 14:40 15:00
•
•
• LED
- 9. • 1,000 1kΩ
• 1,000,000 1MΩ
• 1,000
1
1mA
• 1,000,000
1
50µA
- 23. − LED = LED ×R
R
− LED
R=
LED
5.0V LED 1.8V 10mA
5 − 1.8 3.2
R= = =
0.01 0.01
- 27. 2 2 15:00 15:20
Processing
•
•
•
- 30. Processing 1
1
// 1
void setup()
{
// Display Window
size(200, 200);
}
//
void draw()
{
//
background(255, 255, 255);
}
- 32. Processing 2
2
PFont myFont; //
void setup()
{
size(200, 200);
myFont = loadFont(quot;HelveticaNeue-32.vlwquot;); //
textFont(myFont, 32); //
}
void draw()
{
background(120, 120, 120);
text(quot;Hello!!quot;, 15, 50); //
}
- 34. 2 3 15:20 16:30
Funnel
• Gainer I/O
•
• LED
•
- 35. Funnel Gainer I/O
1. Funnel Server
2. I/O LED
3. I/O LED
- 36. Funnel
3 I/O LED
import processing.funnel.*;
Gainer gainer;
void setup()
{
size(200, 200);
frameRate(30);
gainer= new Gainer(this, Gainer.MODE1);
gainer.autoUpdate = true;
}
void draw()
{
background(100);
}
- 37. Funnel
4 I/O LED
void mousePressed()
{
gainer.led().value = 1.0;
}
void mouseReleased()
{
gainer.led().value = 0.0;
}
- 38. Funnel
5 I/O LED
import processing.funnel.*;
Gainer gainer;
void setup()
{
size(200, 200);
frameRate(30);
gainer= new Gainer(this, Gainer.MODE1);
gainer.autoUpdate = true;
}
void draw()
{
background(100);
}
- 39. Funnel
6 I/O LED
void gainerButtonEvent(boolean pressed)
{
if (pressed) {
gainer.led().value = 1.0;
} else {
gainer.led().value = 0.0;
}
}
- 40. Funnel Gainer I/O
2
• dout 0 1 2
– LED
–
• aout 0 255 256
– LED
–
- 43. Funnel
7 aout 0 LED
void setup()
{
...
osc = new Osc(this, Osc.SQUARE, 1.0, 0);
osc.serviceInterval = 30;
osc.addEventListener(Osc.UPDATE, quot;oscUpdatedquot;);
}
void oscUpdated(Osc osc)
{
gainer.led().value = osc.value;
}
- 44. Funnel
8 aout 0 LED
void risingEdge(PortEvent e)
{
if (e.target.number == gainer.button) {
osc.reset();
osc.start();
}
}
void fallingEdge(PortEvent e)
{
if (e.target.number == gainer.button) {
osc.stop();
}
}
- 45. Funnel Gainer I/O
2
• din 0 1 2
–
–
• ain 0 255 256
–
–
- 48. Funnel ain 0
1. SimpleScope
2.
3. ain 1
4.
- 54. Funnel ain 0
1. Tree
2. SimpleScope
3. Scaler
4.
- 63. Funnel ain
1. SimpleScope
2. 3
3. x, y, z
•
•
- 70. 2 16:30 17:00
• LED
9 analogInput(0) SetPoint
void setup()
{
...
gainer.analogInput(0).filters = filters;
...
}
void risingEdge(PortEvent e)
{
if (e.target.number == gainer.analogInput[0]) {
...
}
}
- 71. 3 17:00 18:00
1. 30
2. 1