Skip to content

Instantly share code, notes, and snippets.

@eltallerdetd
Created August 21, 2018 01:35
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save eltallerdetd/7930f843ca991f0b28997a39a3d09b81 to your computer and use it in GitHub Desktop.
Save eltallerdetd/7930f843ca991f0b28997a39a3d09b81 to your computer and use it in GitHub Desktop.
//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