Académique Documents
Professionnel Documents
Culture Documents
#include <Servo.h>
Servo servo1;
const int flexpin = 1;
Servo myservo;
int potpin = 0;
int val;
void setup()
{
Serial.begin(9600);
servo1.attach(9);
myservo.attach(10);
}
void loop()
{
int flexposition;
int servoposition;
flexposition = analogRead(flexpin);
and 1023)
val = map(val, 0, 1023, 0, 179); // scale it to use it with the servo (value between 0 and 180)
myservo.write(val);
delay(15);