Faire fonctionner deux moteurs sur moteur shield via telecomande


bonjour,
je suis nouveau sur le forum et je débute sur arduino.
j'ai une carte arduino uno et un shield moteur arduino rev3.
depuis plusieurs jours je cherche faire fonctionner deux moteurs brancher sur le shield via une télécommande de tv.
j'ai décodé les codes ir de la télécommande et j'ai fais plusieurs tentatives qui restent infructueuses.
la touche 1 pour le moteur gauche marche avant . la touche 2 pour les deux moteurs en marche avant. la touche 3 pour le moteur droit marche avant puis 4,5 et 6 pour la marche arrière.
dernier essai avec le code suivant (bouton 1,2 et 3 pour le test) désolé pour les puristes mais je comprend tout :

#include <irremote>
const byte ir_rec = 11;
const byte mot_d1 = 12;
const byte mot_g1 = 3;
const byte mot_d2 = 13;
const byte mot_g2 = 8;

irrecv irrecv(ir_recv);
decode_results results;
void setup()
{
irrecv.enableirin();
pinmode(mot_d1,  output);
pinmode(mot_g1, output);
pinmode(mot_d2, output);
pinmode(mot_g2, output);
}
void loop();
{
if (irrecv.decode(&results))
{
if(results.value == 0x20df8877) {
digitalwrite(mot_d1, low);
digitalwrite(mot_g1, high);
digitalwrite(mot_d2, low);
digitalwrite(mot_g2,  high);
}
else if (results.value == 0x20df88b7)
{
digitalwrite(mot_d1, high);
digitalwrite(mot_g1, low);
digitalwrite(mot_d2, high);
digitalwrite(mot_g2, low);
}
else if (results.value == 0x20dfc837)
{
digitalwrite(mot_d1, low);
digitalwrite(mot_g1, low);
digitalwrite(mot_d2, low);
digitalwrite(mot_g2, low);
}
irrecv.resume();
}
}



merci de votre aide.

bonjour,
déjà dans le bar tu vas avoir peu de réponses ;)

1- tu arrive faire fonctionner ta télécommande pour allumer une led?
2- tu arrives faire tourner tes moteurs avec un prog tout con?


Arduino Forum > International > Français (Moderators: jfs, Snootlab) > Faire fonctionner deux moteurs sur moteur shield via telecomande


arduino

Comments

Popular posts from this blog

Connecting Raspberry Pi 2 to P10(1R)-V706 LED Dot Matrix - Raspberry Pi Forums

TypeError: <unknown> is not a numpy array - Raspberry Pi Forums

datso and removing imagetitle - Joomla! Forum - community, help and support