Why won't this code work with teensy 3.6? It just goes berserk when I open the serial monitor even with nothing connected. I copied the code from the spark fun Piezo Drum Kit Quickstart Guide and connected everything the same. What do I need to do to get 1 piezo working and trigger a note or something-anything?
#define DRUM1 0 // Our analog pin
byte val = 0; // Initializing the variable for the voltage value
void setup()
{
Serial.begin(9600); // Initializing the serial port at 9600 baud
}
void loop()
{
val = analogRead(DRUM1); // Read the voltage
Serial.println(val, DEC); // Print the voltage to the terminal
}
#define DRUM1 0 // Our analog pin
byte val = 0; // Initializing the variable for the voltage value
void setup()
{
Serial.begin(9600); // Initializing the serial port at 9600 baud
}
void loop()
{
val = analogRead(DRUM1); // Read the voltage
Serial.println(val, DEC); // Print the voltage to the terminal
}