Skip to content

Instantly share code, notes, and snippets.

@myarduinosale
Created August 8, 2020 14:16
Show Gist options
  • Select an option

  • Save myarduinosale/3c0e934a76e0969950037cb214bc03d8 to your computer and use it in GitHub Desktop.

Select an option

Save myarduinosale/3c0e934a76e0969950037cb214bc03d8 to your computer and use it in GitHub Desktop.
RA117_Arduino
#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