Skip to content

Commit 4ba7b7d

Browse files
authored
Add files via upload
1 parent b1b9f5b commit 4ba7b7d

File tree

1 file changed

+29
-0
lines changed

1 file changed

+29
-0
lines changed

PiezoTapVoltageMeasure.ino

+29
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
/*
2+
* This script checks whether the arduino board is able to capture the voltage signals generated by the piezos
3+
*
4+
* By:
5+
* Jash Bharat Mota
6+
7+
* http://www.jashmota.esy.es
8+
*/
9+
10+
// these constants won't change:
11+
const int knockSensor = A1; // the piezo is connected to analog pin 0
12+
13+
14+
// these variables will change:
15+
int sensorReading = 0; // variable to store the value read from the sensor pin
16+
17+
void setup() {
18+
Serial.begin(9600); // use the serial port
19+
}
20+
21+
void loop() {
22+
// read the sensor and store it in the variable sensorReading:
23+
sensorReading = analogRead(knockSensor);
24+
25+
delay(200); // delay to avoid overloading the serial port buffer
26+
Serial.print("Voltage: ");
27+
Serial.println(sensorReading);
28+
}
29+

0 commit comments

Comments
 (0)