read pin
This commit is contained in:
1 parent
222e1c54ea
commit
3fbcd57b63
2 files changed
+16
-9
No files matched your search
@@ -0,0 +1,16 @@
|
||||
|
||||
#define PIN_INPUT 7 //вход7
|
||||
|
||||
|
||||
void setup (){
|
||||
Serial.begin(9600);
|
||||
pinMode(PIN_INPUT, INPUT); //задаём вход
|
||||
}
|
||||
|
||||
void loop (){
|
||||
if(digitalRead(PIN_INPUT) == HIGH) {
|
||||
Serial.println("1");
|
||||
} else {
|
||||
Serial.println("0");
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user