Last active
October 12, 2020 14:02
-
-
Save margmarg/1803bbce695a37fb0a5f60a6169504f4 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
#include <Servo.h> | |
Servo myservo; | |
void setup() { | |
// put your setup code here, to run once: | |
myservo.attach(9); | |
Serial.begin(9600); | |
} | |
void loop() { | |
// put your main code here, to run repeatedly: | |
int sensorValue = analogRead(A0); | |
// int outputValue = map(sensorValue, 0, 1023, 0, 180); | |
Serial.print(sensorValue); | |
Serial.print(","); | |
// Serial.println(outputValue); | |
myservo.write(sensorValue); | |
delay(50); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment