1int pb1 = 2;
2int pb2 = 3;
3int pb3 = 4;
4int pb4 = 5;
5int pb5 = 6;
6int pb6 = 7;
7int pb7 = 8;
8int pb8 = 9;
9
10int buzz = 13;
11
12void setup()
13{
14
15 pinMode(pb1,INPUT);
16 pinMode(pb2,INPUT);
17 pinMode(pb3,INPUT);
18 pinMode(pb4,INPUT);
19 pinMode(pb5,INPUT);
20 pinMode(pb6,INPUT);
21 pinMode(pb7,INPUT);
22 pinMode(pb8,INPUT);
23
24 pinMode(buzz,OUTPUT);
25
26}
27
28void loop()
29{
30
31 int C = digitalRead(pb1);
32 int D = digitalRead(pb2);
33 int E = digitalRead(pb3);
34 int F = digitalRead(pb4);
35 int G = digitalRead(pb5);
36 int A = digitalRead(pb6);
37 int B = digitalRead(pb7);
38 int C2 = digitalRead(pb8);
39
40 if( C == 1 ){
41 tone(buzz,262,100);
42 }
43 if( D == 1 ){
44 tone(buzz,294,100);
45 }
46 if( E == 1 ){
47 tone(buzz,330,100);
48 }
49 if( F == 1 ){
50 tone(buzz,349,100);
51 }
52 if( G == 1 ){
53 tone(buzz,392,100);
54 }
55 if( A == 1 ){
56 tone(buzz,440,100);
57 }
58 if( B == 1 ){
59 tone(buzz,494,100);
60 }
61 if( C2 == 1 ){
62 tone(buzz,523,100);
63 }
64
65 delay(10);
66
67
68}