From d874a44cf24e39ded0c365e3bb996b3bc5edd793 Mon Sep 17 00:00:00 2001 From: Andrea Manni Date: Thu, 16 Apr 2015 15:56:22 +0200 Subject: [PATCH] delete --- .../keyboard_three_pullup_buttons.ino | 47 ------------------- 1 file changed, 47 deletions(-) delete mode 100644 piezo/keyboard_three_pullup_buttons/keyboard_three_pullup_buttons.ino diff --git a/piezo/keyboard_three_pullup_buttons/keyboard_three_pullup_buttons.ino b/piezo/keyboard_three_pullup_buttons/keyboard_three_pullup_buttons.ino deleted file mode 100644 index 13fc24c..0000000 --- a/piezo/keyboard_three_pullup_buttons/keyboard_three_pullup_buttons.ino +++ /dev/null @@ -1,47 +0,0 @@ -/* - Melody keyboard with Input Pullup Serial - Plays a pitch that changes based on 3 digital inputs - - This example demonstrates the use of pinMode(INPUT_PULLUP). It reads a - digital input on pin 2 and prints the results to the serial monitor. - - Thecircuit: - * 3 buttons in pin 2,3,4 with no resistors - * Piezo on digital pin 9 - * Serial debug is available - - This example code is in the public domain - - */ - -// Please take care of the include path -#include "/home/utente/sketchbook-andrea/piezo/piezo_mario_tune/pitches.h"; -int input[]= {1,2,3}; - int notes[] = { - NOTE_A4, NOTE_C4,NOTE_E3 }; - -void setup(){ - //start serial connection - Serial.begin(9600); - //configure pin2 as an input and enable the internal pull-up resistor - pinMode(2, INPUT_PULLUP); - pinMode(3, INPUT_PULLUP); - pinMode(4, INPUT_PULLUP); - pinMode(9, OUTPUT); - - -} - -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 - } - //delay(2); - } -} - - - -- 2.39.2