Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

task-1- #1

Open
sallyibaid19 opened this issue Jul 17, 2021 · 0 comments
Open

task-1- #1

sallyibaid19 opened this issue Jul 17, 2021 · 0 comments

Comments

@sallyibaid19
Copy link
Owner

5-servo motor control using Arduino
Fabulous Jaiks
`#include "Servo.h"

Servo servo1;
Servo servo2;
Servo servo3;
Servo servo4;
Servo servo5;
int POT = 0;
//int SERVO = 6;
int valorPot;
int valorMotor = 0;

void setup()
{
servo1.attach(3);
servo2.attach(5);
servo3.attach(6);
servo4.attach(9);
servo5.attach(10);
Serial.begin(9600);
}

void loop()
{
valorPot = analogRead(POT);
valorMotor = map(valorPot,0,1023,0,180);
servo1.write (valorMotor);
servo2.write (valorMotor);
servo3.write (valorMotor);
servo4.write (valorMotor);
servo5.write (valorMotor);

Serial.print (valorMotor);
delay (20);

}`

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant