Stack Exchange Network

Stack Exchange network consists of 175 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [servo]

A servo is a type of motor which uses a feedback mechanism for precise control of speed and position.

6
votes
7answers
75k views

What is commonly done to stop a servo after reaching desired position?

When I started Arduino, I did not expect that everything must be contained in an infinite loop. I thought I could just write something like: motor start -> motor stop. But in actuality, what I get is ...
4
votes
1answer
233 views

Change Servo Speed With RedBearLabs BLE Shield

I recently got the RedBearLabs BLE shield to use it to control two high spped continuous rotation servos. I have the BLE example sketch loaded and the ios controller app works. The problem is that the ...
0
votes
1answer
320 views

How to achieve smooth motion with a servo motor?

I'm trying to control the MG995 servo motor with an Arduino Uno, but the motion achieved by the motor is kind of erratic. The servo motor is externally powered from a 2200mAh 7.4V 30C LiPo battery ...
2
votes
3answers
1k views

Arduino starter kit servo is shaking

In the example of the arduino starter kit the point is to use a potenciometer to control a servo. The code is angle = map(potVal, 0, 1023, 0, 179); The output in the serial potVal: 1023, angle: ...
2
votes
2answers
815 views

Problem with tachometer using attachInterrupt and servo

So I am creating a tachometer using black/white detector sensor. Here's the code. unsigned long WaktuOLD; unsigned long WaktuNOW; int Detection = HIGH; int Counter = HIGH; float HitungWaktu; float ...
2
votes
1answer
528 views

Why does timer1 not generate correct period on CTC mode with a resolution of 5us?

I have defined my code to generate an interrupt over each 5μs on CTC mode using timer1 but the output shows a time of ~15μs. Following the equation to set the counting number to achieve the ...
1
vote
1answer
674 views

Servo motors won't work with motor controller

I have a motor controller controlling two motors, which works perfectly fine when I comment out the two servos in the below code. These two servos are not connected to the motor controller but simply ...
1
vote
0answers
342 views

ATtiny Mapping PPM Inputs to Move Servo Issue

Short Version: Not able to get a servo to move to mapped input from RC remote control PPM signal. Detailed Verison: I am trying to take an input signal from a hobby RC radio (D4RII receiver ppm ...
1
vote
1answer
371 views

Servomotor and music shield

I’m trying to make an art sculpture, with an Arduino-uno, a servomotor and a seeduino musicshield v2.0. I’m making the servo motor moving a stick with the attached fans of the servo, and I want to ...
1
vote
2answers
1k views

Code to control servo with shield

I recently bought an Arduino MEGA2560 and a SainSmart InstaBots Robot Controller Shield for Arduino MEGA2560 R3 Robot Arm Control. I understand how to control a servo in the method described in Sweep....
1
vote
1answer
8k views

Why does it say “Servo” does not name a type

#define pingTrig 6 #define pingEcho 7 #include Servo myservo; void setup() { pinMode(pingTrig, OUTPUT); pinMode(pingEcho, INPUT); myservo.attach(9); } void loop() { long duration, inches, cm; ...
1
vote
1answer
109 views

Servo causes disconnection

I've only started using Arduino in the last week, and I'm having a problem with the servo supplied with the kit I purchased. It's a SG90 microservo. I'm trying to connect the servo as shown on the ...
1
vote
2answers
1k views

code for automatic door

I want it running as a normal automatic door so both sensors work as a separate activate. The only problem I've seen is that the servo remains active waiting for another high read and you can hear the ...
0
votes
3answers
3k views

Arduino Mega with two Arduino Unos as slaves via I2C?

Good morning! This is my first post here, and my first time diving into the world of microcontrollers. Bear with me, as I describe this theoretical project. I've got an Arduino Mega 2560, two ...