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
14
votes
1 answer

How do I parse a page with html5ever, modify the DOM, and serialize it?

I would like to parse a web page, insert anchors at certain positions and render the modified DOM out again in order to generate docsets for Dash. Is this possible? From the examples included in html5ever, I can see how to read an HTML file and do…
kesselborn
  • 533
  • 5
  • 7
5
votes
2 answers

Arduino servo without library

As education exercise on sending digital signals, I'm trying to code the pulse train for a servo without using the servo.h library. The servo is a 9g micro servo. Hardware is correct, as many examples using servo.h work fine. I have the following…
Playing with GAS
  • 565
  • 3
  • 10
  • 18
5
votes
2 answers

Cannot control servos through 32-servo-controller on Aurduino Duamilanove

I have servo (TowerPro sg90) connected to 32 servo controller (this one) through UART interface (RX-TX, GND-GND). Seller provide documentation how to connect and control my servos, but it isn't work. Servo work if I connect it indirectly to…
rkyr
  • 3,131
  • 2
  • 23
  • 38
3
votes
1 answer

ESP32-cam with servo control won't work. Arduino IDE

I've an ESP32-cam and want to controll a servo. My code compiled without error but doesn't work. There are two files involved, a .ino and a .cpp. The .ino seems to work right because the servo contributes to his start position 90° at startup but…
Jo Pare
  • 41
  • 5
3
votes
0 answers

Raspberry Pi Gpio Continuous Servo Motor Control

I am making a node.js raspberry pi app where I need to control a servo motor. When I press the up arrow, it sends a post request to '/fb' and on key up it sends a post request to '/fbTerm'. Here is the code for post requests. const express =…
Ank i zle
  • 2,089
  • 3
  • 14
  • 36
3
votes
2 answers

RPI servo hat python3 library throwing error: 'board' has no attribute 'SCL'

No matter how I rewrite a simple python 3 servo test script for the Adafruit RPI servo hat, I get the following error. Traceback (most recent call last): File "servo_test.py", line 8, in i2c = busio.I2C(board.SCL,…
harlansgs
  • 31
  • 1
  • 2
3
votes
1 answer

Controlling continuous servo using python in Raspberry Pi,but the continuous servo can't stop

I'm trying to control a continuous servo(DF15RSMG) using python in Raspberry Pi, but the continuous servo can't stop. Code as follows: import RPi.GPIO as GPIO import time import signal import atexit atexit.register(GPIO.cleanup) …
XiaoJin
  • 67
  • 1
  • 6
2
votes
0 answers

"The function start is not being executed" error when trying to run the same piServoCtl (Raspberry Pi Servo) function multiple times

Helpful link: https://github.com/naoto64/piServoCtl The code is copied below: from piservo import Servo import time myservo = Servo(12) def rotate(): myservo.write(180) time.sleep(1) myservo.stop() rotate() # running the function once…
SamsUncle
  • 21
  • 1
2
votes
1 answer

MG 996R servo Raspberry Pi angle control

I am using an MG 996R servo connected to a Raspberry Pi and an external power supply. I am using this code: import RPi.GPIO as GPIO import time servoPIN = 17 GPIO.setmode(GPIO.BCM) GPIO.setup(servoPIN, GPIO.OUT) p = GPIO.PWM(servoPIN, 50) # GPIO…
Hamid Rajabi
  • 59
  • 1
  • 8
2
votes
0 answers

Why is my RPIO servo pulse width off by a factor of 10?

I am working on driving motor controllers using a Raspberry Pi. I am using the RPIO library to give me the precise timing I need. I am not using the RPi.GPIO. When I run this code: from RPIO import PWM from time import sleep servo = PWM.Servo() #…
Waldo25
  • 61
  • 3
2
votes
2 answers

Servo Motor not moving properly in Proteus

I'm trying to control a Servo Motor with a PIC18f4550, but before buying one, I'm trying to simulate it on Proteus ISIS, but I'm getting some inconsistencies when setting the angle. I've tried using a 20ms period and 1ms, 1.167ms, 1.333ms, 1.5ms,…
2
votes
1 answer

Pi4j: SG90 doesn't turn all the way to 180°

I have this SG90 servomotor (completely functional and new) that doesn't turn all the way to 180° (or 0°).It stops halfway when i try to make it go right to left (counterclockwise). I have checked 4 times the wiring and the hardware so the problem…
Akk
  • 53
  • 12
2
votes
1 answer

How to program a dead zone in arduino using the mapping function?

I'm using a PS3 controller to control a continuous servo array. I'm using the map function to write the servo position. The relevant part of my code is servo1.writeMicroseconds(map(PS3.getAnalogHat(RightHatY), 0, 255, 1300, 1700)); My…
2
votes
2 answers

python 3.x pyserial communication with arduino uno (servo control)

i have a trouble with serial communicate (python 3.x -> arduino uno). when i run this code in python 2.5 python 2.5: import serial usbport = 'COM3' ser = serial.Serial(usbport, 9600, timeout=1) def move(servo, angle): if (0 <= angle <= 180): …
2
votes
1 answer

XBox One Wireless control of Servo using Analogue Stick withevdev

I'm using Evdev to read the XBOX ONE inputs of A, B, X, Y to great success. However, I am battling to pick up the Analog Stick inputs. Can anyone help me with the Python code for this? I am trying to control a Servo. This is my code so far, it works…
1
2 3
19 20