1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-06-17 22:23:10 +03:00
Files
esp8266/build/shared/examples/1.Basics/DigitalReadSerial/DigitalReadSerial.pde
2010-07-26 23:02:46 +00:00

20 lines
300 B
Plaintext

/*
DigitalReadSerial
Reads a digital input on pin 2, prints the result to the serial monitor
This example code is in the public domain.
*/
void setup() {
Serial.begin(9600);
pinMode(2, INPUT);
}
void loop() {
int sensorValue = digitalRead(2);
Serial.println(sensorValue, DEC);
}