blob: 09880b80514bd17660bba72a69fe509043d96dad (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
|
const int sensorPin = 12; // Declare the push-button
int sensorValue = 0;
void setup() {
Serial.begin(115200);
pinMode(sensorPin, INPUT); // declare the sensorPin as an INPUT
for (int i = 0; i < 50; i++){
sensorValue = digitalRead(sensorPin); // read push-button value
Serial.println(sensorValue); // print it at the Serial Monitor
delay(200);
}
}
void loop() {
}
|