Created
August 21, 2018 01:35
-
-
Save eltallerdetd/7930f843ca991f0b28997a39a3d09b81 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//C odigo por El Taller De TD | |
// eltallerdetd.wordpress.com | |
// youtube.com/ElTallerDeTD | |
#include <Servo.h> | |
int valor = 0; | |
Servo serv; | |
void setup() { | |
Serial.begin(9600); | |
pinMode(13, OUTPUT); | |
serv.attach(9); | |
} | |
void loop() { | |
valor = analogRead(0); | |
Serial.println(valor); | |
if(690>valor){ | |
digitalWrite(13, HIGH); | |
serv.write(70); | |
}else{ | |
digitalWrite(13, LOW); | |
serv.write(90); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment