mirror of
https://github.com/esp8266/Arduino.git
synced 2025-06-16 11:21:18 +03:00
Adding Basics folder for examples, for beginners
This commit is contained in:
@ -0,0 +1,19 @@
|
||||
/*
|
||||
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);
|
||||
}
|
||||
|
||||
|
||||
|
Reference in New Issue
Block a user