Salut à toutes et à tous,
Dans la continuation de mon robot je souhaite lui adjoindre des bras. j'ai donc acheté 2 bras similaire à celui-ci
Je le regrette déjà. Trop lourd, le moteur de base pas assez costaud.
J'ai quand même essayé de le faire bouger. Catastrophe... Ce truc là part dans tous les sens. j'ai bien sûr essayé de nombreux codes
trouvés sur la toile mais je n'ai pas réussi à les faire fonctionner. Par contre j'a trouvé un petite programme tous simple rien que pour tester les moteurs.
[code]
// http://www.arduino.cc/en/Tutorial/Sweep
#include <Servo.h>
Servo servoBaseG; // create servo object to control a servo
Servo servoEpauleG; // create servo object to control a servo
Servo servoCoudeG; // create servo object to control a servo
Servo servoPoigneHBG; // create servo object to control a servo
Servo servoPoigneROG; // create servo object to control a servo
Servo servoPinceG; // create servo object to control a servo
// twelve servo objects can be created on most boards
int posBaseG =0; // variable to store the servo position
int posEpauleG =45; // variable to store the servo position
int posCoudeG = 90; // variable to store the servo position
int posPoigneHBG = 110; // Poignet ????
int posPoigneROG = 180; // Poignet Vertical
int posPinceG = 0; // 0 Pince Ouverte
void setup() {
servoBaseG.attach(7); // attaches the servo on pin 7 to the servo object
servoEpauleG.attach(8); // attaches the servo on pin 8 to the servo object
servoCoudeG.attach(9); // attaches the servo on pin 9 to the servo object
servoPoigneHBG.attach(3); // attaches the servo on pin 10 to the servo object
servoPoigneROG.attach(4); // attaches the servo on pin 11 to the servo object
servoPinceG.attach(12); // attaches the servo on pin 12 to the servo object
}
void loop() {
// in steps of 1 degree
servoBaseG.write(posBaseG); // tell servo to go to position in variable 'pos'
delay(20); // waits 15ms for the servo to reach the position
servoEpauleG.write(posEpauleG); // tell servo to go to position in variable 'pos'
delay(20); // waits 15ms for the servo to reach the position
// in steps of 1 degree
servoCoudeG.write(posCoudeG); // tell servo to go to position in variable 'pos'
delay(20); // waits 15ms for the servo to reach the position
servoPoigneHBG.write(posPoigneHBG); // tell servo to go to position in variable 'pos'
delay(20); // waits 15ms for the servo to reach the position
servoPoigneROG.write(posPoigneROG); // tell servo to go to position in variable 'pos'
delay(20); // waits 15ms for the servo to reach the position
servoPinceG.write(posPinceG); // tell servo to go to position in variable 'pos'
delay(20); // waits 15ms for the servo to reach the position
}
[/code]
Malgré cela mon bras à tendance à s’énerver lorsque je le branche.
Les moteurs sont connectés à un Sensor Shield v5.0 sur un UNO. Le shield est connecté sur une batterie 12V . Entre la batterie et le shield un réducteur de tension règlé à 5V. J'ai vu aussi qu'il fallait régler l'ampérage.
La UNO est branché sur 9V
Si une généreuse âme pouvait m'aider, merci d'avance.
Encore une question. Si on pouvait m’orienter vers un bras plus enclin à répondre à mon souhait.
Cordialement