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
2
votes
0 answers

How do I control an arduino servo through a python IDE?

I am using pyserial to communicate with my arduino on com5. Everythin works well when I use IDLE, BUT then when I use Spyder the servo does not rotate. I know it connects however, because I get RX blinks on the Arduino uno every 2 seconds, showing…
Traviccc
  • 147
  • 1
  • 4
2
votes
1 answer

How to convert degrees to duty cycles for a smooth move using pwm on a servo motor?

I want to make smooth move with servo motor from 0 to 180 degrees and vice versa. I only know three values: 2.5 duty cycles for 0 degrees,7.5 duty cycles for 90 degrees and 12.5 duty cycles for 180 degrees. I want to make smooth move between all…
2
votes
1 answer

Redeclared as different kind of symbol in Arduino

I'm currently working on a school project. I want the servo to move according to the number of coins selected. I keep getting the error " 'void servoOne()' redeclared as different kind of symbol " I know this has been asked but I'm not sure how to…
Katherine
  • 37
  • 1
  • 1
  • 9
2
votes
0 answers

Arduino Uno: how to make it run in figure 8 continuously?

My assignment is to design and implement software to cause your Shield-Bot to run continuously in a “figure 8” where the two loops are at least 1 foot in diameter. I have put the following code together, which makes a figure 8 correctly the first…
familyGuy
  • 425
  • 2
  • 5
  • 22
2
votes
1 answer

How do I attach 2 pins together and then detach them in the loop?

I've got - for example - pin 1, which has a current in (and therefore set as an input in the setup) and pin 2, which has to be routed to pin 1 (and therefore has pin 1's current out - which may NOT be the same as using Arduino's built in current out…
2
votes
2 answers

How do I make two servo's move in opposite directions?

I am trying to make a model of the muscle system in the arm for a project with Arduino, but to accomplish this I need bicep and triceps to move in opposite direction. I am currently experimenting with a potentiometer and trying to make the two…
Thing
  • 51
  • 6
2
votes
2 answers

How can I make a python script stop itself after 10 seconds?

I am working on a project of my own that involves servos on a raspberry pi. I have them spinning when I execute the code but I'd prefer to have the python script kill itself after 10 seconds, rather then having to hit CTRL + C all the time. Is there…
TGFoxy
  • 39
  • 5
2
votes
1 answer

How to make a Servo motor do something, have the uno check a value and then do something based on the updated value?

I want to be able to make a (continuous motion) servo motor rotate a lens/filter/polariser and have it be fed an intensity value in real time and then stop once it reaches a minimum, then doing it again and again. I have got it to stop when the…
2
votes
1 answer

arduino: program with else not working

#include Servo myservo; // create servo object to control a servo int pos = 90; String kontrolstr = ""; char kontrol; void setup() { Serial.begin(9600); myservo.attach(9);// attaches the servo on pin 9 to the servo object }…
Bahadır
  • 454
  • 1
  • 4
  • 8
2
votes
1 answer

Figure out code from what module is "use"d in a large rust project (servo)

I'm trying to read the code of servo. As an example, I'm looking at this code in layout_task.rs: use url::Url; ..and I want to know which code this refers to (the answer is rust-url).
Nickolay
  • 31,095
  • 13
  • 107
  • 185
1
vote
1 answer

Dead time delay between axis command (SetPos) and execution in TwinCAT3 with EtherCAT

I want to measure the time between a) setting a target position for my axis on my computer and b) the variable is set on the axis. I Setup the scope view of TwinCAT3 and displayed the SetPos variable (from the axis) and the setTarget Variable from…
Chris
  • 23
  • 3
1
vote
1 answer

asyncio.run() seems to be blocking the other process i started

This code is supposed to control a servo from stdin import asyncio import sys import threading from multiprocessing import Process async def connect_stdin_stdout(): loop = asyncio.get_event_loop() reader = asyncio.StreamReader() …
1
vote
1 answer

"No module name adafruit_servokit"

I am working on Jetson Nano and trying to control servo motors. I am using PCA9685. I have installed all the pre-requisites for that sudo pip3 install adafruit-circuitpython-servokit Faced an error called SyntaxError: future feature annotations is…
X Z
  • 13
  • 3
1
vote
1 answer

why the program give "Segmentation fault" after 1018 try

I'm writing a C code to open txt file and read two lines on it then print the value it worked for 1018 time then it gives "Segmentation fault" I've tried to flush the buffer but it don't work while(running) { i = 0; if ((fptr =…
Majd Zahra
  • 13
  • 4
1
vote
1 answer

WriteFile failed (PermissionError(13, 'the device does not recognize the command.', None, 22)), pyserial and Arduino

I'm controlling the position of a servo with Python and an Arduino. I type in the angle in python and it sends to the Arduino which then moves the servo to that specific angle. Arduino code: #include Servo servo; void setup() { …
LUGG4S
  • 45
  • 5
1
2
3
19 20