-void loop(){
- for (int thisSensor = 2; thisSensor < 5; thisSensor++) {
- int sensorReading = digitalRead(thisSensor);
- if (sensorReading == LOW) {
- Serial.println(thisSensor);
- tone(9, notes[thisSensor -2], 50); // Notes array is translated
+void loop() {
+ for (int thisSensor = 0; thisSensor < 3; thisSensor++) {
+ int sensorReading = digitalRead(tasti[thisSensor]);
+ if (sensorReading == LOW) {
+ Serial.print("Sensore: ");
+ Serial.print(thisSensor);
+ tone(piezo_pin, notes[thisSensor ], 50); // Notes array is translated
+ Serial.print("\t Nota: ");
+ Serial.println(notes[thisSensor]);
+ }
+ //delay(2); // eventuale delay