forked from NAG-IoT/odevzdani
Nahrát soubory do „08“
This commit is contained in:
@@ -0,0 +1,27 @@
|
|||||||
|
#include <Servo.h>
|
||||||
|
Servo servo;
|
||||||
|
int tlacitko = D6;
|
||||||
|
int sensor = D8;
|
||||||
|
void setup() {
|
||||||
|
pinMode(tlacitko, INPUT_PULLUP);
|
||||||
|
pinMode(sensor, INPUT);
|
||||||
|
servo.attach(2);
|
||||||
|
servo.write(0);
|
||||||
|
delay(2000);
|
||||||
|
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
void loop() {
|
||||||
|
long stav = digitalRead(sensor);
|
||||||
|
if(stav == LOW)
|
||||||
|
{
|
||||||
|
servo.write(90);
|
||||||
|
delay(10000);
|
||||||
|
servo.write(0);
|
||||||
|
delay(500);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Binary file not shown.
Reference in New Issue
Block a user