Bonjour à tous,
Voila j'ai effectué un petit montage pour tester mon arduino uno: un micro servo moteur branché sur une plaque d'essai: un fil sur le GND, un sur le +5V et l'autre sur la pin 9. Un potar 10K sur la PIN A0.
J'utilise le code suivant fourni par arduino IDE:
// Controlling a servo position using a potentiometer (variable resistor)
// by Michal Rinott <http://people.interaction-ivrea.it/m.rinott>
#include <Servo.h>
Servo myservo; // create servo object to control a servo
int potpin = 0; // analog pin used to connect the potentiometer
int val; // variable to read the value from the analog pin
void setup()
{
myservo.attach(9); // attaches the servo on pin 9 to the servo object
}
void loop()
{
val = analogRead(potpin); // reads the value of the potentiometer (value between 0 and 1023)
val = map(val, 0, 1023, 0, 179); // scale it to use it with the servo (value between 0 and 180)
myservo.write(val); // sets the servo position according to the scaled value
}
Lorsque mon arduino est branché à l'alimentation secteur, pas de soucis. Lorsque je bouge le potar avec une forte amplitude ex: passer de 0 à 180° pas de problème. Idem avec faible amplitude.
Par contre lorsque je débranche l'alim secteur et que je fais des grandes amplitudes, le servo s'arrête en plein milieu, comme si l'arduino ramé ou laggé. Par contre c'est OK avec faible amplitudes.
Pourriez-vous me dire pourquoi ca fait ca? Est-ce une question de forte demande en courrant lors de fortes amplitudes?
Merci pour vos réponses.
Cordialement,