-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsketch_7_segment_processing.pde
64 lines (62 loc) · 1.27 KB
/
sketch_7_segment_processing.pde
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
import controlP5.*;
ControlP5 cp5;
import processing.serial.*;
Serial myPort;
void setup()
{
size(800,700);
cp5=new ControlP5(this);
cp5.addButton("a").setValue(0).setPosition(350,100).setSize(100,10);
cp5.addButton("b").setValue(0).setPosition(340,100).setSize(10,100);
cp5.addButton("c").setValue(0).setPosition(450,100).setSize(10,100);
cp5.addButton("d").setValue(0).setPosition(350,200).setSize(100,10);
cp5.addButton("e").setValue(0).setPosition(340,200).setSize(10,100);
cp5.addButton("f").setValue(0).setPosition(450,200).setSize(10,100);
cp5.addButton("g").setValue(0).setPosition(340,300).setSize(120,10);
cp5.addButton("dp").setValue(0).setPosition(470,300).setSize(10,10);
myPort=new Serial(this, "COM18", 9600);
}
void draw()
{
background(0);
}
public void a()
{
println("a");
myPort.write("a");
}
public void b()
{
println("b");
myPort.write("b");
}
public void c()
{
println("c");
myPort.write("c");
}
public void d()
{
println("d");
myPort.write("d");
}
public void e()
{
println("e");
myPort.write("e");
}
public void f()
{
println("f");
myPort.write("f");
}
public void g()
{
println("g");
myPort.write("g");
}
public void dp()
{
println("dp");
myPort.write("h");
}