Created
August 8, 2020 14:16
-
-
Save myarduinosale/3c0e934a76e0969950037cb214bc03d8 to your computer and use it in GitHub Desktop.
RA117_Arduino
This file contains hidden or 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> | |
| int servo = 6; | |
| Servo myservo; | |
| int analogPin = 5; | |
| int val = 0; | |
| void setup() { | |
| myservo.attach(servo); | |
| Serial.begin(9600); | |
| } | |
| void loop() { | |
| val = analogRead(analogPin); | |
| Serial.print("val = "); | |
| Serial.println(val); | |
| val = val/6; | |
| myservo.write(val); | |
| delay(100); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment