Questions tagged [servo]

Programming questions related to controlling a servo motor through programming.

A servo is a hardware mechanism that moves with signal input. It uses negative feedback to control itself precisely.

297 questions
1
vote
1 answer

Arduino Uno + servo motor (SG-90) + ultrasonic sensor(HC-S04) detects an obstacle

I'm a newbie to Arduino. The goal is to write a program that can stop a hypothetical conveyor belt (read a servo motor) if too many objects are stacked on a belt, that is detected by HC-S04 sensor. If the the distance exceeds the minimum threshold…
1
vote
1 answer

Change servo angle based on Bluetooth input

I'm using an app to either turn on an LED or change the angle of a micro servo depending on which button is pressed (using Arduino). My code works for the LED (while the button is pressed, the LED is on) but nothing happens when I press the button…
1
vote
1 answer

Program stops after while loop begins

I'm trying to move my servos according to data from my gyro. Unfortunately, my program stops after the while loop begins. For instance, in my code once the gyroX value reaches 3000 the serial monitor stops giving me gyro data and the servo does not…
1
vote
1 answer

how to run 2 loop for servo motors in arduino code

I'm trying to make a project where two servos rotate at the same time. However, my code doesn't work. #include Servo servo1; // servo control object Servo servo2; void setup() { servo1.attach(10); servo2.attach(9); } void…
1
vote
1 answer

I2C with Atmega168

I'm trying to control several servos using the adafruit PWM servo controller. It uses i2c interface to communicate from the micro controller. https://www.adafruit.com/product/815 I'm using an Atmega 168 to attempt to send i2c instructions to the…
Wezley
  • 413
  • 1
  • 3
  • 19
1
vote
2 answers

Control continuous servo motor with Raspberry Pi and Python

I am trying to control my continuous servo motor using this code: import RPi.GPIO as GPIO import time GPIO.setmode(GPIO.BCM) GPIO.setup(17, GPIO.OUT) p = GPIO.PWM(17, 50) p.start(7.5) try: while True: p.ChangeDutyCycle(7.5) …
1
vote
1 answer

Having timer collision issue with using Servo and SoftwareSerial

I'm having timer collision problems with using Servo.h and SoftwareSerial.h on Arduino Nano board. And now I need 2 pairs of Serial pins by using NFC Module and Arduino's Serial Monitor on my laptop. If the information I got is not wrong, there are…
David Kim
  • 23
  • 1
  • 6
1
vote
1 answer

distribute data received from a serial communication with 2 arduino uno

I must send 3 values gave by 3 potentiometers ,connected by an Arduino Uno, and send them to another Arduino Uno whith a serial comunication. The received values must be distributed in 3 servo motors so that each knob able to control the servo motor…
1
vote
0 answers

Arduino Uno: Running multiple servos

I have a Arduino Uno, and I am pretty new to the Arduino stuff. I am new to circuits also. I am thinking about working on a simple spider robot and making it more complex as I learn about the Arduino. Anyways, yesterday I tried seeing if I could run…
Sean.D
  • 97
  • 8
1
vote
1 answer

Arduino servo motors and serial monitor suddenly "crash"

I have been trying to control my 2 servo motors trought serial monitor. When i enter number 1-5 to serial monitor it follows the command as told in code. I write in the numbers 1-5 a couple of times and servos suddenly stop and i cant enter anything…
in2d
  • 544
  • 9
  • 19
1
vote
0 answers

Flex sensor aren't reacted. arduino

I'm trying controlling the 5 servo snd Flex sensor. So, I connect the Arduino with Bled Board(Flex sensor and 5 servo). However, though I bended these Flex sensors, they are not reacted. that code is below. // letsarduino.com // [Project 15] - 5…
tk08
  • 167
  • 1
  • 2
  • 10
1
vote
0 answers

Stopping continuous servo

Do you know how to stop continuous servo in desired position? I tried to code like this (which I found on many forums): myservo.write(10); //moves forward delay (1000); //waits 1s myservo.write(90); //stops My servo indeed moves forward for 1s…
Aśka
  • 11
  • 1
  • 4
1
vote
2 answers

doit 2-way motor & 16-way servo shield board

Got this board cheap from Banggood, but there are minimal details on how to use it. There is a manual here https://www.gitbook.com/book/smartarduino/user-manual-for-2-way-motor-16-way-servos-shield/details , but it is a long way from detailed, and…
Robbie Matthews
  • 1,404
  • 14
  • 22
1
vote
2 answers

How to stop an Arduino Servo from moving during the myservo.attach() command

I'm using the default Servo library in Arduino. When my Arduino Uno starts up and it attaches the servo the motor will move a good portion of its range. I can't have this happen for my project, I need it to turn and stay in its current…
King
  • 45
  • 1
  • 2
  • 4
1
vote
2 answers

Raspberry Pi Python Code Won't Move Servo

So I am doing a little project with a Raspberry Pi that involves moving a servo motor. In the following code in Python 3, I begin by starting the servo at approximately 45 degrees. Later in the code, a different angle is determined based on the…
Chris
  • 191
  • 2
  • 12