Un peu coup de main? transmission RF


bonjour, je débute dans le domaine de la programmation, j'ai un petit char tamiya avec double gear avec un dual h bridge dc stepper motor et un joystick, mon code fonctionne très bien en filaire joystick -> arduino -> pont h -> motor

le code en question:

quote

#define motorpin1a 3 // marche avant du premier moteur
#define motorpin1b 4 // marche arrière du premier moteur
#define speedpin1 9 // l293d enable pin pour le premier moteur
#define motorpin2a 5 // marche avant du deuxième moteur
#define motorpin2b 6 // marche arrière du deuxième moteur
#define speedpin2 10 // l293d enable pin pour le deuxième moteur
#define joystickpin1 1  //analog 1
#define joystickpin2 2  //analog 2

int mspeed= 0;
int mspeed1 = 0;
int mspeed2 = 0;  

unsigned long time;

void setup() {

// réglage des broches à  output
pinmode(motorpin1a, output);
pinmode(motorpin1b, output);

pinmode(speedpin1, output);
pinmode(motorpin2a, output);
pinmode(motorpin2b, output);
pinmode(speedpin2, output);
}

void loop() {
 mspeed1 = (analogread(joystickpin1)-511)/2;
 mspeed1 = mspeed1 - (analogread(joystickpin2)-511)/2;
 if (mspeed1 > 255) {
   mspeed1 = 255;
 }
   if (mspeed1 < -255) {
   mspeed1 = -255;
 }
 
 mspeed2 = (analogread(joystickpin1)-511)/2;
 mspeed2 = mspeed2 + (analogread(joystickpin2)-511)/2;
 if (mspeed2 > 255) {
   mspeed2 = 255;
 }    
 if (mspeed2 < -255) {
   mspeed2 = -255;
 }
 
 if (mspeed1 > 0)  // donc marche arrière
 {
   analogwrite(speedpin1, abs(mspeed1));
   digitalwrite(motorpin1a, low);
   digitalwrite(motorpin1b, high);
 }
 else {   // donc marche avant (ou repos)
   analogwrite(speedpin1, abs(mspeed1));
   digitalwrite(motorpin1a, high);
   digitalwrite(motorpin1b, low);
 }
 
 if (mspeed2 > 0)  // donc marche arrière
 {  
   analogwrite(speedpin2, abs(mspeed2));
   digitalwrite(motorpin2a, low);
   digitalwrite(motorpin2b, high);    
 }
 else  // donc marche avant (ou repos)
 {  
   analogwrite(speedpin2, abs(mspeed2));
   digitalwrite(motorpin2a, high);
   digitalwrite(motorpin2b, low);
 }
}



mais j'aimerais, possédant 2 carte arduino (duemilanove et uno) (et c'est la que je bloc) le controler en transmission rf 433mhz

le kit rf

http://apexlogic.net/code-bank/arduino/cheap-rf-solution-for-arduino/

si quelqu'un une idée xd

http://www.lmgtfy.com/?q=radio+433+arduino


Arduino Forum > International > Français (Moderators: jfs, Snootlab) > Un peu coup de main? transmission RF


arduino

Comments

Popular posts from this blog

Convierte tu Raspberry en un NAS. Firmware fvdw-sl 15.3 - Raspberry Pi Forums

Rasperry Wifi LAN Controller - Raspberry Pi Forums

Unlock car with bluetooth and car key